[llvm-commits] [llvm] r82364 - /llvm/trunk/lib/Support/CommandLine.cpp
Chris Lattner
sabre at nondot.org
Sat Sep 19 22:12:14 PDT 2009
Author: lattner
Date: Sun Sep 20 00:12:14 2009
New Revision: 82364
URL: http://llvm.org/viewvc/llvm-project?rev=82364&view=rev
Log:
switch to SmallPtrSet instead of std::set, saving 1K from the
release-asserts .o file (72900->71856).
Modified:
llvm/trunk/lib/Support/CommandLine.cpp
Modified: llvm/trunk/lib/Support/CommandLine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CommandLine.cpp?rev=82364&r1=82363&r2=82364&view=diff
==============================================================================
--- llvm/trunk/lib/Support/CommandLine.cpp (original)
+++ llvm/trunk/lib/Support/CommandLine.cpp Sun Sep 20 00:12:14 2009
@@ -25,12 +25,12 @@
#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 @@
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 @@
// 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
More information about the llvm-commits
mailing list