Use DenseMap instead of std::map in fixupExports
authorReid Kleckner <rnk@google.com>
Fri, 10 Nov 2017 19:12:01 +0000 (19:12 +0000)
committerReid Kleckner <rnk@google.com>
Fri, 10 Nov 2017 19:12:01 +0000 (19:12 +0000)
Some DLLs have many exports, and this data structure shows up in the
profile of linking content.dll.

llvm-svn: 317910

lld/COFF/DriverUtils.cpp

index c03b972..6485699 100644 (file)
@@ -594,7 +594,7 @@ void fixupExports() {
   }
 
   // Uniquefy by name.
-  std::map<StringRef, Export *> Map;
+  DenseMap<StringRef, Export *> Map(Config->Exports.size());
   std::vector<Export> V;
   for (Export &E : Config->Exports) {
     auto Pair = Map.insert(std::make_pair(E.ExportName, &E));