It is pointless to turn a UINT_TO_FP into an
[oota-llvm.git] / lib / CodeGen / CollectorMetadata.cpp
index 57349390b01b8215a32c64717a5b56b762184807..5b8c7c7999616363a70888e9d782cf2aa07dad13 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by Gordon Henriksen and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -30,7 +30,7 @@ namespace {
     std::ostream &OS;
     
   public:
-    Printer(std::ostream &OS = *cerr);
+    explicit Printer(std::ostream &OS = *cerr);
     
     const char *getPassName() const;
     void getAnalysisUsage(AnalysisUsage &AU) const;
@@ -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;