switch to SmallPtrSet instead of std::set, saving 1K from the
authorChris Lattner <sabre@nondot.org>
Sun, 20 Sep 2009 05:12:14 +0000 (05:12 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 20 Sep 2009 05:12:14 +0000 (05:12 +0000)
release-asserts .o file (72900->71856).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82364 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/CommandLine.cpp

index 2e69b11d2bd6733d5866ff085f19906357d6f8b1..f5ce5a71232b5bd6064aa97444cde14f7b79f1b6 100644 (file)
 #include "llvm/System/Host.h"
 #include "llvm/System/Path.h"
 #include "llvm/ADT/OwningPtr.h"
-#include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/Config/config.h"
-#include <set>
 #include <cerrno>
 #include <cstdlib>
 using namespace llvm;
@@ -1039,7 +1039,7 @@ public:
     StringMap<Option*> OptMap;
     GetOptionInfo(PositionalOpts, SinkOpts, OptMap);
 
-    // Copy Options into a vector so we can sort them as we like...
+    // Copy Options into a vector so we can sort them as we like.
     std::vector<Option*> Opts;
     for (StringMap<Option*>::iterator I = OptMap.begin(), E = OptMap.end();
          I != E; ++I) {
@@ -1053,7 +1053,7 @@ public:
 
     // Eliminate duplicate entries in table (from enum flags options, f.e.)
     {  // Give OptionSet a scope
-      std::set<Option*> OptionSet;
+      SmallPtrSet<Option*, 32> OptionSet;
       for (unsigned i = 0; i != Opts.size(); ++i)
         if (OptionSet.count(Opts[i]) == 0)
           OptionSet.insert(Opts[i]);   // Add new entry to set