Convert comments to doxygen syntax.
[oota-llvm.git] / include / llvm / Analysis / AliasAnalysis.h
index 13c380e3fb18926c0205fa98126d53b471ffde71..841513b715855511913848a8a4d31227fdae2f85 100644 (file)
@@ -181,35 +181,37 @@ public:
   /// interface.  Also, functions may freely modify stack space local to their
   /// invocation without having to report it through these interfaces.
   enum ModRefBehavior {
-    // DoesNotAccessMemory - This function does not perform any non-local loads
-    // or stores to memory.
-    //
-    // This property corresponds to the GCC 'const' attribute.
-    // This property corresponds to the LLVM IR 'readnone' attribute.
-    // This property corresponds to the IntrNoMem LLVM intrinsic flag.
+    /// DoesNotAccessMemory - This function does not perform any non-local loads
+    /// or stores to memory.
+    ///
+    /// This property corresponds to the GCC 'const' attribute.
+    /// This property corresponds to the LLVM IR 'readnone' attribute.
+    /// This property corresponds to the IntrNoMem LLVM intrinsic flag.
     DoesNotAccessMemory,
 
-    // AccessesArguments - This function accesses function arguments in well
-    // known (possibly volatile) ways, but does not access any other memory.
-    //
-    // This property corresponds to the IntrReadWriteArgMem LLVM intrinsic flag.
+    /// AccessesArgumentsReadonly - This function loads through function
+    /// arguments and does not perform any non-local stores or volatile
+    /// loads.
+    ///
+    /// This property corresponds to the IntrReadArgMem LLVM intrinsic flag.
+    AccessesArgumentsReadonly,
+
+    /// AccessesArguments - This function accesses function arguments in well
+    /// known (possibly volatile) ways, but does not access any other memory.
+    ///
+    /// This property corresponds to the IntrReadWriteArgMem LLVM intrinsic flag.
     AccessesArguments,
 
-    // AccessesArgumentsAndGlobals - This function has accesses function
-    // arguments and global variables well known (possibly volatile) ways, but
-    // does not access any other memory.
-    AccessesArgumentsAndGlobals,
-
-    // OnlyReadsMemory - This function does not perform any non-local stores or
-    // volatile loads, but may read from any memory location.
-    //
-    // This property corresponds to the GCC 'pure' attribute.
-    // This property corresponds to the LLVM IR 'readonly' attribute.
-    // This property corresponds to the IntrReadMem LLVM intrinsic flag.
+    /// OnlyReadsMemory - This function does not perform any non-local stores or
+    /// volatile loads, but may read from any memory location.
+    ///
+    /// This property corresponds to the GCC 'pure' attribute.
+    /// This property corresponds to the LLVM IR 'readonly' attribute.
+    /// This property corresponds to the IntrReadMem LLVM intrinsic flag.
     OnlyReadsMemory,
 
-    // UnknownModRefBehavior - This indicates that the function could not be
-    // classified into one of the behaviors above.
+    /// UnknownModRefBehavior - This indicates that the function could not be
+    /// classified into one of the behaviors above.
     UnknownModRefBehavior
   };
 
@@ -252,8 +254,7 @@ public:
   /// This property corresponds to the GCC 'pure' attribute.
   ///
   bool onlyReadsMemory(ImmutableCallSite CS) {
-    ModRefBehavior MRB = getModRefBehavior(CS);
-    return MRB == DoesNotAccessMemory || MRB == OnlyReadsMemory;
+    return onlyReadsMemory(getModRefBehavior(CS));
   }
 
   /// onlyReadsMemory - If the specified function is known to only read from
@@ -261,8 +262,17 @@ public:
   /// when the call site is not known.
   ///
   bool onlyReadsMemory(const Function *F) {
-    ModRefBehavior MRB = getModRefBehavior(F);
-    return MRB == DoesNotAccessMemory || MRB == OnlyReadsMemory;
+    return onlyReadsMemory(getModRefBehavior(F));
+  }
+
+  /// onlyReadsMemory - If the functions with the specified behavior are known
+  /// to only read from non-volatile memory (or not access memory at all), return
+  /// true.  For use when the call site is not known.
+  ///
+  static bool onlyReadsMemory(ModRefBehavior MRB) {
+    return MRB == DoesNotAccessMemory ||
+           MRB == AccessesArgumentsReadonly ||
+           MRB == OnlyReadsMemory;
   }