Add a addRequiredTransitiveID member function, which is to

addRequiredTransitive as addRequiredID is to addRequired.

llvm-svn: 37031
This commit is contained in:
Dan Gohman 2007-05-14 14:21:46 +00:00
parent 97beb5147f
commit 619bfa47e3
1 changed files with 8 additions and 6 deletions

View File

@ -44,24 +44,26 @@ public:
// for a pass.
//
AnalysisUsage &addRequiredID(AnalysisID ID) {
assert(ID && "Pass class not registered!");
Required.push_back(ID);
return *this;
}
template<class PassClass>
AnalysisUsage &addRequired() {
assert(Pass::getClassPassInfo<PassClass>() && "Pass class not registered!");
Required.push_back(Pass::getClassPassInfo<PassClass>());
return *this;
return addRequiredID(Pass::getClassPassInfo<PassClass>());
}
template<class PassClass>
AnalysisUsage &addRequiredTransitive() {
AnalysisID ID = Pass::getClassPassInfo<PassClass>();
AnalysisUsage &addRequiredTransitiveID(AnalysisID ID) {
assert(ID && "Pass class not registered!");
Required.push_back(ID);
RequiredTransitive.push_back(ID);
return *this;
}
template<class PassClass>
AnalysisUsage &addRequiredTransitive() {
AnalysisID ID = Pass::getClassPassInfo<PassClass>();
return addRequiredTransitiveID(ID);
}
// addPreserved - Add the specified ID to the set of analyses preserved by
// this pass