Tweak to work with new AA implementation
[oota-llvm.git] / include / llvm / Analysis / BasicAliasAnalysis.h
index fc323dd972588cc8a609310cc95a7f79206f8c49..5b6637aa2bade550f26acf19c87910b06739ec8e 100644 (file)
 #include "llvm/Analysis/AliasAnalysis.h"
 #include "llvm/Pass.h"
 
+class GetElementPtrInst;
+
 struct BasicAliasAnalysis : public ImmutablePass, public AliasAnalysis {
 
+  virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+    AliasAnalysis::getAnalysisUsage(AU);
+  }
+
+  virtual void initializePass();
+
   // alias - This is the only method here that does anything interesting...
   //
-  Result alias(const Value *V1, const Value *V2);
-    
-  /// canCallModify - We are not interprocedural, so we do nothing exciting.
-  ///
-  Result canCallModify(const CallInst &CI, const Value *Ptr) {
-    return MayAlias;
-  }
-    
-  /// canInvokeModify - We are not interprocedural, so we do nothing exciting.
-  ///
-  Result canInvokeModify(const InvokeInst &I, const Value *Ptr) {
-    return MayAlias;  // We are not interprocedural
-  }
+  AliasResult alias(const Value *V1, unsigned V1Size,
+                    const Value *V2, unsigned V2Size);
+private:
+  // CheckGEPInstructions - Check two GEP instructions of compatible types and
+  // equal number of arguments.  This checks to see if the index expressions
+  // preclude the pointers from aliasing...
+  AliasResult CheckGEPInstructions(GetElementPtrInst *GEP1, unsigned G1Size,
+                                   GetElementPtrInst *GEP2, unsigned G2Size);
 };
 
 #endif