summaryrefslogtreecommitdiff
path: root/lib/VMCore/Pass.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2010-07-21 17:52:45 +0000
committerOwen Anderson <resistor@mac.com>2010-07-21 17:52:45 +0000
commit9650983b9a30804d3479aeffb2a7f8bdb6b33942 (patch)
tree9dac49e911dfb4a50f29f886b66b15f8cb2a2fe8 /lib/VMCore/Pass.cpp
parent45953215210ad06a3901b026bdee1d4352294407 (diff)
downloadllvm-9650983b9a30804d3479aeffb2a7f8bdb6b33942.tar.gz
llvm-9650983b9a30804d3479aeffb2a7f8bdb6b33942.tar.bz2
llvm-9650983b9a30804d3479aeffb2a7f8bdb6b33942.tar.xz
Move the smarts of AnalysisGroup registration into PassRegistry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109019 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Pass.cpp')
-rw-r--r--lib/VMCore/Pass.cpp27
1 files changed, 3 insertions, 24 deletions
diff --git a/lib/VMCore/Pass.cpp b/lib/VMCore/Pass.cpp
index 75ee17cd5a..5a176d59f9 100644
--- a/lib/VMCore/Pass.cpp
+++ b/lib/VMCore/Pass.cpp
@@ -264,30 +264,9 @@ Pass *PassInfo::createPass() const {
//
RegisterAGBase::RegisterAGBase(const char *Name, intptr_t InterfaceID,
intptr_t PassID, bool isDefault)
- : PassInfo(Name, InterfaceID) {
-
- PassInfo *InterfaceInfo =
- const_cast<PassInfo*>(Pass::lookupPassInfo(InterfaceID));
- if (InterfaceInfo == 0) {
- // First reference to Interface, register it now.
- PassRegistry::getPassRegistry()->registerPass(*this);
- InterfaceInfo = this;
- }
- assert(isAnalysisGroup() &&
- "Trying to join an analysis group that is a normal pass!");
-
- if (PassID) {
- const PassInfo *ImplementationInfo = Pass::lookupPassInfo(PassID);
- assert(ImplementationInfo &&
- "Must register pass before adding to AnalysisGroup!");
-
- // Make sure we keep track of the fact that the implementation implements
- // the interface.
- PassInfo *IIPI = const_cast<PassInfo*>(ImplementationInfo);
- IIPI->addInterfaceImplemented(InterfaceInfo);
-
- PassRegistry::getPassRegistry()->registerAnalysisGroup(InterfaceInfo, IIPI, isDefault);
- }
+ : PassInfo(Name, InterfaceID) {
+ PassRegistry::getPassRegistry()->registerAnalysisGroup(InterfaceID, PassID,
+ *this, isDefault);
}