#define LLVM_ANALYSIS_ALIAS_ANALYSIS_H
#include "llvm/Support/CallSite.h"
-#include "llvm/Pass.h" // Need this for IncludeFile
+#include "llvm/System/IncludeFile.h"
+#include <vector>
namespace llvm {
class LoadInst;
class StoreInst;
+class VAArgInst;
class TargetData;
+class Pass;
+class AnalysisUsage;
class AliasAnalysis {
protected:
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
public:
+ static char ID; // Class identification, replacement for typeinfo
AliasAnalysis() : TD(0), AA(0) {}
virtual ~AliasAnalysis(); // We want to be subclassed
/// CallsThrough - Indirect calls are made through the specified function
/// pointer.
- CallsThrough,
+ CallsThrough
};
};
ModRefResult getModRefInfo(InvokeInst *I, Value *P, unsigned Size) {
return getModRefInfo(CallSite(I), P, Size);
}
+ ModRefResult getModRefInfo(VAArgInst* I, Value* P, unsigned Size) {
+ return AliasAnalysis::Mod;
+ }
ModRefResult getModRefInfo(Instruction *I, Value *P, unsigned Size) {
switch (I->getOpcode()) {
+ case Instruction::VAArg: return getModRefInfo((VAArgInst*)I, P, Size);
case Instruction::Load: return getModRefInfo((LoadInst*)I, P, Size);
case Instruction::Store: return getModRefInfo((StoreInst*)I, P, Size);
case Instruction::Call: return getModRefInfo((CallInst*)I, P, Size);
}
};
+} // End llvm namespace
+
// Because of the way .a files work, we must force the BasicAA implementation to
// be pulled in if the AliasAnalysis header is included. Otherwise we run
// the risk of AliasAnalysis being used, but the default implementation not
// being linked into the tool that uses it.
-//
-extern void BasicAAStub();
-static IncludeFile HDR_INCLUDE_BASICAA_CPP((void*)&BasicAAStub);
-
-} // End llvm namespace
+FORCE_DEFINING_FILE_TO_BE_LINKED(AliasAnalysis)
+FORCE_DEFINING_FILE_TO_BE_LINKED(BasicAliasAnalysis)
#endif