]> granicus.if.org Git - llvm/commitdiff
[ModRefInfo] Use ModRefInfo wrappers in FunctionModRefBehavior
authorAlina Sbirlea <asbirlea@google.com>
Wed, 6 Dec 2017 23:12:43 +0000 (23:12 +0000)
committerAlina Sbirlea <asbirlea@google.com>
Wed, 6 Dec 2017 23:12:43 +0000 (23:12 +0000)
when testing for info found only in ModRefInfo [NFC].

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319985 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/AliasAnalysis.h

index f7a2a6ba3fcb007e60811c9d7a3e31c255ae9716..d6bd9a9129f74c7c2ab32459d300fe645b73b0f1 100644 (file)
@@ -404,13 +404,13 @@ public:
   /// Checks if functions with the specified behavior are known to only read
   /// from non-volatile memory (or not access memory at all).
   static bool onlyReadsMemory(FunctionModRefBehavior MRB) {
-    return !(MRB & MRI_Mod);
+    return !isModSet(createModRefInfo(MRB));
   }
 
   /// Checks if functions with the specified behavior are known to only write
   /// memory (or not access memory at all).
   static bool doesNotReadMemory(FunctionModRefBehavior MRB) {
-    return !(MRB & MRI_Ref);
+    return !isRefSet(createModRefInfo(MRB));
   }
 
   /// Checks if functions with the specified behavior are known to read and
@@ -424,7 +424,8 @@ public:
   /// read or write from objects pointed to be their pointer-typed arguments
   /// (with arbitrary offsets).
   static bool doesAccessArgPointees(FunctionModRefBehavior MRB) {
-    return (MRB & MRI_ModRef) && (MRB & FMRL_ArgumentPointees);
+    return isModOrRefSet(createModRefInfo(MRB)) &&
+           (MRB & FMRL_ArgumentPointees);
   }
 
   /// Checks if functions with the specified behavior are known to read and
@@ -436,7 +437,7 @@ public:
   /// Checks if functions with the specified behavior are known to potentially
   /// read or write from memory that is inaccessible from LLVM IR.
   static bool doesAccessInaccessibleMem(FunctionModRefBehavior MRB) {
-    return (MRB & MRI_ModRef) && (MRB & FMRL_InaccessibleMem);
+    return isModOrRefSet(createModRefInfo(MRB)) && (MRB & FMRL_InaccessibleMem);
   }
 
   /// Checks if functions with the specified behavior are known to read and