Factor local liveness computation out into its own function.
[oota-llvm.git] / lib / CodeGen / CollectorMetadata.cpp
index 80085cd29de1e039f4755427c1cd588c0940206f..5b8c7c7999616363a70888e9d782cf2aa07dad13 100644 (file)
@@ -51,11 +51,11 @@ namespace {
     bool doFinalization(Module &M);
   };
   
-  RegisterPass<CollectorModuleMetadata>
-  X("collector-metadata", "Create Garbage Collector Module Metadata");
-  
 }
 
+static RegisterPass<CollectorModuleMetadata>
+X("collector-metadata", "Create Garbage Collector Module Metadata");
+
 // -----------------------------------------------------------------------------
 
 CollectorMetadata::CollectorMetadata(const Function &F, Collector &C)
@@ -112,10 +112,7 @@ CollectorMetadata &CollectorModuleMetadata::get(const Function &F) {
 
 void CollectorModuleMetadata::clear() {
   Map.clear();
-  
-  // TODO: StringMap should provide a clear method.
-  while (!NameMap.empty())
-    NameMap.erase(NameMap.begin());
+  NameMap.clear();
   
   for (iterator I = begin(), E = end(); I != E; ++I)
     delete *I;