-GCModuleInfo::GCModuleInfo()
- : ImmutablePass(&ID) {}
-
-GCModuleInfo::~GCModuleInfo() {
- clear();
-}
-
-GCStrategy *GCModuleInfo::getOrCreateStrategy(const Module *M,
- const std::string &Name) {
- strategy_map_type::iterator NMI = StrategyMap.find(Name);
- if (NMI != StrategyMap.end())
- return NMI->getValue();
-
- for (GCRegistry::iterator I = GCRegistry::begin(),
- E = GCRegistry::end(); I != E; ++I) {
- if (Name == I->getName()) {
- GCStrategy *S = I->instantiate();
- S->M = M;
- S->Name = Name;
- StrategyMap.GetOrCreateValue(Name).setValue(S);
- StrategyList.push_back(S);
- return S;
- }
- }
-
- dbgs() << "unsupported GC: " << Name << "\n";
- llvm_unreachable(0);
+GCModuleInfo::GCModuleInfo() : ImmutablePass(ID) {
+ initializeGCModuleInfoPass(*PassRegistry::getPassRegistry());