[llvm-commits] [llvm] r113275 - /llvm/trunk/include/llvm/Analysis/AliasAnalysis.h

Dan Gohman gohman at apple.com
Tue Sep 7 13:37:48 PDT 2010


Author: djg
Date: Tue Sep  7 15:37:47 2010
New Revision: 113275

URL: http://llvm.org/viewvc/llvm-project?rev=113275&view=rev
Log:
Tidy up the getModRefInfo declarations.

Modified:
    llvm/trunk/include/llvm/Analysis/AliasAnalysis.h

Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasAnalysis.h?rev=113275&r1=113274&r2=113275&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/AliasAnalysis.h (original)
+++ llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Tue Sep  7 15:37:47 2010
@@ -222,44 +222,60 @@
   /// getModRefInfo - Return information about whether or not an instruction may
   /// read or write memory specified by the pointer operand.  An instruction
   /// that doesn't read or write memory may be trivially LICM'd for example.
+  ModRefResult getModRefInfo(const Instruction *I,
+                             const Value *P, unsigned Size) {
+    switch (I->getOpcode()) {
+    case Instruction::VAArg:  return getModRefInfo((const VAArgInst*)I, P,Size);
+    case Instruction::Load:   return getModRefInfo((const LoadInst*)I, P, Size);
+    case Instruction::Store:  return getModRefInfo((const StoreInst*)I, P,Size);
+    case Instruction::Call:   return getModRefInfo((const CallInst*)I, P, Size);
+    case Instruction::Invoke: return getModRefInfo((const InvokeInst*)I,P,Size);
+    default:                  return NoModRef;
+    }
+  }
 
   /// getModRefInfo (for call sites) - Return whether information about whether
   /// a particular call site modifies or reads the memory specified by the
   /// pointer.
-  ///
   virtual ModRefResult getModRefInfo(ImmutableCallSite CS,
                                      const Value *P, unsigned Size);
 
-  /// getModRefInfo - Return information about whether two call sites may refer
-  /// to the same set of memory locations.  See 
-  ///   http://llvm.org/docs/AliasAnalysis.html#ModRefInfo
-  /// for details.
-  virtual ModRefResult getModRefInfo(ImmutableCallSite CS1,
-                                     ImmutableCallSite CS2);
-
-public:
-  /// Convenience functions...
-  ModRefResult getModRefInfo(const LoadInst *L, const Value *P, unsigned Size);
-  ModRefResult getModRefInfo(const StoreInst *S, const Value *P, unsigned Size);
-  ModRefResult getModRefInfo(const VAArgInst* I, const Value* P, unsigned Size);
+  /// getModRefInfo (for calls) - Return whether information about whether
+  /// a particular call modifies or reads the memory specified by the
+  /// pointer.
   ModRefResult getModRefInfo(const CallInst *C, const Value *P, unsigned Size) {
     return getModRefInfo(ImmutableCallSite(C), P, Size);
   }
+
+  /// getModRefInfo (for invokes) - Return whether information about whether
+  /// a particular invoke modifies or reads the memory specified by the
+  /// pointer.
   ModRefResult getModRefInfo(const InvokeInst *I,
                              const Value *P, unsigned Size) {
     return getModRefInfo(ImmutableCallSite(I), P, Size);
   }
-  ModRefResult getModRefInfo(const Instruction *I,
-                             const Value *P, unsigned Size) {
-    switch (I->getOpcode()) {
-    case Instruction::VAArg:  return getModRefInfo((const VAArgInst*)I, P,Size);
-    case Instruction::Load:   return getModRefInfo((const LoadInst*)I, P, Size);
-    case Instruction::Store:  return getModRefInfo((const StoreInst*)I, P,Size);
-    case Instruction::Call:   return getModRefInfo((const CallInst*)I, P, Size);
-    case Instruction::Invoke: return getModRefInfo((const InvokeInst*)I,P,Size);
-    default:                  return NoModRef;
-    }
-  }
+
+  /// getModRefInfo (for loads) - Return whether information about whether
+  /// a particular load modifies or reads the memory specified by the
+  /// pointer.
+  ModRefResult getModRefInfo(const LoadInst *L, const Value *P, unsigned Size);
+
+  /// getModRefInfo (for stores) - Return whether information about whether
+  /// a particular store modifies or reads the memory specified by the
+  /// pointer.
+  ModRefResult getModRefInfo(const StoreInst *S, const Value *P, unsigned Size);
+
+  /// getModRefInfo (for va_args) - Return whether information about whether
+  /// a particular va_arg modifies or reads the memory specified by the
+  /// pointer.
+  ModRefResult getModRefInfo(const VAArgInst* I, const Value* P, unsigned Size);
+
+  /// getModRefInfo - Return information about whether two call sites may refer
+  /// to the same set of memory locations.  See 
+  ///   http://llvm.org/docs/AliasAnalysis.html#ModRefInfo
+  /// for details.
+  virtual ModRefResult getModRefInfo(ImmutableCallSite CS1,
+                                     ImmutableCallSite CS2);
 
   //===--------------------------------------------------------------------===//
   /// Higher level methods for querying mod/ref information.





More information about the llvm-commits mailing list