[PATCH] D19937: [NFC] Prealloc command line arguments map

Eugene via llvm-commits llvm-commits at lists.llvm.org
Wed May 4 14:16:09 PDT 2016


kevgs created this revision.
kevgs added reviewers: chandlerc, dblaikie.
kevgs added a subscriber: llvm-commits.

Using tcmalloc I have measured approximately 509 cl::opt objects. So I guess prealloc makes some sense.

http://reviews.llvm.org/D19937

Files:
  lib/Support/CommandLine.cpp

Index: lib/Support/CommandLine.cpp
===================================================================
--- lib/Support/CommandLine.cpp
+++ lib/Support/CommandLine.cpp
@@ -103,7 +103,8 @@
   // This collects the different option categories that have been registered.
   SmallPtrSet<OptionCategory *, 16> RegisteredOptionCategories;
 
-  CommandLineParser() : ProgramOverview(nullptr), ConsumeAfterOpt(nullptr) {}
+  CommandLineParser()
+      : ProgramOverview(nullptr), OptionsMap(512), ConsumeAfterOpt(nullptr) {}
 
   void ParseCommandLineOptions(int argc, const char *const *argv,
                                const char *Overview);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19937.56199.patch
Type: text/x-patch
Size: 639 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160504/2591571b/attachment.bin>


More information about the llvm-commits mailing list