Fix delegation
authorDaniel Berlin <dberlin@dberlin.org>
Mon, 26 Jan 2015 17:30:39 +0000 (17:30 +0000)
committerDaniel Berlin <dberlin@dberlin.org>
Mon, 26 Jan 2015 17:30:39 +0000 (17:30 +0000)
llvm-svn: 227098

llvm/lib/Analysis/CFLAliasAnalysis.cpp

index 9783671..321b57b 100644 (file)
@@ -227,10 +227,13 @@ public:
     // Comparisons between global variables and other constants should be
     // handled by BasicAA.
     if (isa<Constant>(LocA.Ptr) && isa<Constant>(LocB.Ptr)) {
-      return MayAlias;
+      return AliasAnalysis::alias(LocA, LocB);
     }
+    AliasResult QueryResult = query(LocA, LocB);
+    if (QueryResult == MayAlias)
+      return AliasAnalysis::alias(LocA, LocB);
 
-    return query(LocA, LocB);
+    return QueryResult;
   }
 
   void initializePass() override { InitializeAliasAnalysis(this); }