Get rid of hash_map in llvmc
authorAnton Korobeynikov <asl@math.spbu.ru>
Wed, 20 Feb 2008 11:28:26 +0000 (11:28 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Wed, 20 Feb 2008 11:28:26 +0000 (11:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47374 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvmc/Configuration.cpp
tools/llvmc/Configuration.h

index 8d48d4de85cca5c0e7dfb353ca0b5cef57d29697..1aa047dde0db5d4d4be0ec5e3ffdccc35ff2be91 100644 (file)
@@ -609,7 +609,6 @@ LLVMC_ConfigDataProvider::~LLVMC_ConfigDataProvider()
     ++cIt;
     delete cd;
   }
-  Configurations.clear();
 }
 
 CompilerDriver::ConfigData*
@@ -627,7 +626,7 @@ LLVMC_ConfigDataProvider::ProvideConfigData(const std::string& filetype) {
     result = ReadConfigData(filetype);
     // If we got one, cache it
     if (result != 0)
-      Configurations.insert(std::make_pair(filetype,result));
+      Configurations[filetype] = result;
   }
   return result; // Might return 0
 }
index 12d0a956beb5fa6d5baf988f0cd508c5615d1736..410e9af77e75b624c7c15a749c33c44124bea4b6 100644 (file)
@@ -15,8 +15,8 @@
 #ifndef LLVM_TOOLS_LLVMC_CONFIGDATA_H
 #define LLVM_TOOLS_LLVMC_CONFIGDATA_H
 
+#include "llvm/ADT/StringMap.h"
 #include "CompilerDriver.h"
-#include <llvm/ADT/hash_map>
 
 namespace llvm {
   /// This class provides the high level interface to the LLVM Compiler Driver.
@@ -52,7 +52,7 @@ namespace llvm {
     /// @{
     private:
       /// @brief This type is used internally to hold the configuration data.
-      typedef hash_map<std::string,CompilerDriver::ConfigData*> ConfigDataMap;
+      typedef StringMap<CompilerDriver::ConfigData*> ConfigDataMap;
       ConfigDataMap Configurations; ///< The cache of configurations
       sys::Path configDir;
     /// @}