[PATCH] D40579: Use llvm::StringSet instead of std::set.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 28 14:07:06 PST 2017


ruiu created this revision.
Herald added a subscriber: aheejin.

std::set is pretty slow. We generally prefer llvm::StringSet if we don't
need an sorted set.


https://reviews.llvm.org/D40579

Files:
  lld/wasm/Config.h


Index: lld/wasm/Config.h
===================================================================
--- lld/wasm/Config.h
+++ lld/wasm/Config.h
@@ -11,14 +11,13 @@
 #define LLD_WASM_CONFIG_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/StringSet.h"
 #include "llvm/BinaryFormat/Wasm.h"
 
 #include "Symbols.h"
 
 using llvm::wasm::WasmGlobal;
 
-#include <set>
-
 namespace lld {
 namespace wasm {
 
@@ -38,7 +37,7 @@
   llvm::StringRef OutputFile;
   llvm::StringRef Sysroot;
 
-  std::set<llvm::StringRef> AllowUndefinedSymbols;
+  llvm::StringSet<> AllowUndefinedSymbols;
   std::vector<llvm::StringRef> SearchPaths;
   std::vector<std::pair<Symbol *, WasmGlobal>> SyntheticGlobals;
 };


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40579.124638.patch
Type: text/x-patch
Size: 693 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171128/249f2767/attachment.bin>


More information about the llvm-commits mailing list