add a helper
authorChris Lattner <sabre@nondot.org>
Mon, 23 Nov 2009 16:38:54 +0000 (16:38 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 23 Nov 2009 16:38:54 +0000 (16:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89662 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/AliasAnalysis.h

index 0b3199d234d25c7a788559f18df0455ceae00903..2d43bddf7e0ba6272c1a3dc0c5d145c6dd6ee38f 100644 (file)
@@ -94,6 +94,13 @@ public:
   virtual AliasResult alias(const Value *V1, unsigned V1Size,
                             const Value *V2, unsigned V2Size);
 
+  /// isNoAlias - A trivial helper function to check to see if the specified
+  /// pointers are no-alias.
+  bool isNoAlias(const Value *V1, unsigned V1Size,
+                 const Value *V2, unsigned V2Size) {
+    return alias(V1, V1Size, V2, V2Size) == NoAlias;
+  }
+
   /// pointsToConstantMemory - If the specified pointer is known to point into
   /// constant global memory, return true.  This allows disambiguation of store
   /// instructions from constant pointers.