Fix a tiny bug in the -no-aa pass, in which it did not ever get a target data.

This is a regression from 1.2, though noone uses -no-aa anyway


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14245 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-06-19 08:05:58 +00:00
parent 63168d2244
commit 689835a2d9

View File

@ -42,6 +42,14 @@ namespace {
/// such it doesn't follow many of the rules that other alias analyses must.
///
struct NoAA : public ImmutablePass, public AliasAnalysis {
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<TargetData>();
}
virtual void initializePass() {
TD = &getAnalysis<TargetData>();
}
virtual AliasResult alias(const Value *V1, unsigned V1Size,
const Value *V2, unsigned V2Size) {
return MayAlias;
@ -61,7 +69,6 @@ namespace {
virtual void deleteValue(Value *V) {}
virtual void copyValue(Value *From, Value *To) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {}
};
// Register this pass...
@ -78,14 +85,6 @@ namespace {
/// Because it doesn't chain to a previous alias analysis (like -no-aa), it
/// derives from the NoAA class.
struct BasicAliasAnalysis : public NoAA {
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<TargetData>();
}
virtual void initializePass() {
TD = &getAnalysis<TargetData>();
}
AliasResult alias(const Value *V1, unsigned V1Size,
const Value *V2, unsigned V2Size);