- Cleaned up the interface to AnalysisUsage to take analysis class names

instead of ::ID's.
 - Pass::getAnalysis<> now no longer takes an optional argument

llvm-svn: 3265
This commit is contained in:
Chris Lattner 2002-08-08 19:01:30 +00:00
parent 40eb9dafed
commit f0ed55d1ee
15 changed files with 29 additions and 29 deletions

View File

@ -444,7 +444,7 @@ public:
// getAnalysisUsage - This obviously provides a data structure graph.
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
AU.addRequired(LocalDataStructures::ID);
AU.addRequired<LocalDataStructures>();
}
private:
DSGraph &calculateGraph(Function &F);
@ -481,7 +481,7 @@ public:
// getAnalysisUsage - This obviously provides a data structure graph.
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
AU.addRequired(BUDataStructures::ID);
AU.addRequired<BUDataStructures>();
}
private:
DSGraph &calculateGraph(Function &F);

View File

@ -183,7 +183,7 @@ struct ImmediateDominators : public ImmediateDominatorsBase {
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
AU.addRequired(DominatorSet::ID);
AU.addRequired<DominatorSet>();
}
};
@ -207,7 +207,7 @@ struct ImmediatePostDominators : public ImmediateDominatorsBase {
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
AU.addRequired(PostDominatorSet::ID);
AU.addRequired<PostDominatorSet>();
}
};
@ -287,7 +287,7 @@ struct DominatorTree : public DominatorTreeBase {
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
AU.addRequired(DominatorSet::ID);
AU.addRequired<DominatorSet>();
}
private:
void calculate(const DominatorSet &DS);
@ -313,7 +313,7 @@ struct PostDominatorTree : public DominatorTreeBase {
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
AU.addRequired(PostDominatorSet::ID);
AU.addRequired<PostDominatorSet>();
}
private:
void calculate(const PostDominatorSet &DS);
@ -365,7 +365,7 @@ struct DominanceFrontier : public DominanceFrontierBase {
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
AU.addRequired(DominatorTree::ID);
AU.addRequired<DominatorTree>();
}
private:
const DomSetType &calculate(const DominatorTree &DT,
@ -393,7 +393,7 @@ struct PostDominanceFrontier : public DominanceFrontierBase {
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
AU.addRequired(PostDominatorTree::ID);
AU.addRequired<PostDominatorTree>();
}
private:
const DomSetType &calculate(const PostDominatorTree &DT,

View File

@ -1502,7 +1502,7 @@ namespace {
// getAnalysisUsage - We use LiveVarInfo...
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired(FunctionLiveVarInfo::ID);
AU.addRequired<FunctionLiveVarInfo>();
}
bool runOnFunction(Function &F);

View File

@ -27,7 +27,7 @@ namespace {
// getAnalysisUsage - This function needs FindUsedTypes to do its job...
//
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired(FindUsedTypes::ID);
AU.addRequired<FindUsedTypes>();
}
};
RegisterOpt<DTE> X("deadtypeelim", "Dead Type Elimination");

View File

@ -83,7 +83,7 @@ namespace {
// module.
//
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired(CallGraph::ID);
AU.addRequired<CallGraph>();
}
};
RegisterOpt<GlobalDCE> X("globaldce", "Dead Global Elimination");

View File

@ -246,7 +246,7 @@ namespace {
// to be able to see what is pool allocatable.
//
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired(DataStructure::ID);
AU.addRequired<DataStructure>();
}
public:

View File

@ -29,8 +29,8 @@ namespace {
// FindUsedTypes and FindUnsafePointerTypes analysis passes...
//
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired(FindUsedTypes::ID);
AU.addRequired(FindUnsafePointerTypes::ID);
AU.addRequired<FindUsedTypes>();
AU.addRequired<FindUnsafePointerTypes>();
MutateStructTypes::getAnalysisUsage(AU);
}

View File

@ -55,8 +55,8 @@ public:
// getAnalysisUsage - We require post dominance frontiers (aka Control
// Dependence Graph)
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired(PostDominatorTree::ID);
AU.addRequired(PostDominanceFrontier::ID);
AU.addRequired<PostDominatorTree>();
AU.addRequired<PostDominanceFrontier>();
}

View File

@ -79,8 +79,8 @@ namespace {
// This transformation requires dominator and immediate dominator info
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.preservesCFG();
AU.addRequired(DominatorSet::ID);
AU.addRequired(ImmediateDominators::ID);
AU.addRequired<DominatorSet>();
AU.addRequired<ImmediateDominators>();
}
};

View File

@ -193,7 +193,7 @@ namespace {
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired(LoopInfo::ID);
AU.addRequired<LoopInfo>();
AU.preservesCFG();
}
};

View File

@ -39,7 +39,7 @@ namespace {
// This transformation requires natural loop information...
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.preservesCFG();
AU.addRequired(LoopInfo::ID);
AU.addRequired<LoopInfo>();
}
private:

View File

@ -44,7 +44,7 @@ namespace {
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.preservesCFG();
AU.addRequired(DominatorSet::ID);
AU.addRequired<DominatorSet>();
}
// insertPiNodeFor - Insert a Pi node for V in the successors of BB if our

View File

@ -55,7 +55,7 @@ namespace {
// getAnalysisUsage - We need dominance frontiers
//
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired(DominanceFrontier::ID);
AU.addRequired<DominanceFrontier>();
AU.preservesCFG();
}

View File

@ -53,7 +53,7 @@ namespace {
}
void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired(LoopInfo::ID);
AU.addRequired<LoopInfo>();
AU.setPreservesAll();
}
};

View File

@ -25,14 +25,14 @@ struct ModulePassPrinter : public Pass {
virtual bool run(Module &M) {
std::cout << "Printing Analysis info for Pass "
<< PassToPrint->getPassName() << ":\n";
getAnalysis<Pass>(PassToPrint).print(std::cout, &M);
getAnalysisID<Pass>(PassToPrint).print(std::cout, &M);
// Get and print pass...
return false;
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired(PassToPrint);
AU.addRequiredID(PassToPrint);
AU.setPreservesAll();
}
};
@ -44,14 +44,14 @@ struct FunctionPassPrinter : public FunctionPass {
virtual bool runOnFunction(Function &F) {
std::cout << "Printing Analysis info for function '" << F.getName()
<< "': Pass " << PassToPrint->getPassName() << ":\n";
getAnalysis<Pass>(PassToPrint).print(std::cout, F.getParent());
getAnalysisID<Pass>(PassToPrint).print(std::cout, F.getParent());
// Get and print pass...
return false;
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired(PassToPrint);
AU.addRequiredID(PassToPrint);
AU.setPreservesAll();
}
};
@ -63,14 +63,14 @@ struct BasicBlockPassPrinter : public BasicBlockPass {
virtual bool runOnBasicBlock(BasicBlock &BB) {
std::cout << "Printing Analysis info for BasicBlock '" << BB.getName()
<< "': Pass " << PassToPrint->getPassName() << ":\n";
getAnalysis<Pass>(PassToPrint).print(std::cout, BB.getParent()->getParent());
getAnalysisID<Pass>(PassToPrint).print(std::cout, BB.getParent()->getParent());
// Get and print pass...
return false;
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired(PassToPrint);
AU.addRequiredID(PassToPrint);
AU.setPreservesAll();
}
};