[cfe-commits] r45065 - /cfe/trunk/Driver/clang.cpp

Chris Lattner sabre at nondot.org
Sat Dec 15 15:20:07 PST 2007


Author: lattner
Date: Sat Dec 15 17:20:07 2007
New Revision: 45065

URL: http://llvm.org/viewvc/llvm-project?rev=45065&view=rev
Log:
swtich to smallptrset, which is more efficient than std::set.

Modified:
    cfe/trunk/Driver/clang.cpp

Modified: cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/clang.cpp?rev=45065&r1=45064&r2=45065&view=diff

==============================================================================
--- cfe/trunk/Driver/clang.cpp (original)
+++ cfe/trunk/Driver/clang.cpp Sat Dec 15 17:20:07 2007
@@ -34,6 +34,7 @@
 #include "clang/Basic/FileManager.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Basic/TargetInfo.h"
+#include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/System/Signals.h"
@@ -648,10 +649,10 @@
 /// RemoveDuplicates - If there are duplicate directory entries in the specified
 /// search list, remove the later (dead) ones.
 static void RemoveDuplicates(std::vector<DirectoryLookup> &SearchList) {
-  std::set<const DirectoryEntry *> SeenDirs;
+  llvm::SmallPtrSet<const DirectoryEntry *, 8> SeenDirs;
   for (unsigned i = 0; i != SearchList.size(); ++i) {
     // If this isn't the first time we've seen this dir, remove it.
-    if (!SeenDirs.insert(SearchList[i].getDir()).second) {
+    if (!SeenDirs.insert(SearchList[i].getDir())) {
       if (Verbose)
         fprintf(stderr, "ignoring duplicate directory \"%s\"\n",
                 SearchList[i].getDir()->getName());
@@ -794,6 +795,7 @@
       fprintf(stderr, " %s", SearchList[i].getDir()->getName());
       if (SearchList[i].isFramework())
         fprintf(stderr, " (framework directory)");
+      // FIXME: Print (headermap)"
       fprintf(stderr, "\n");
     }
     fprintf(stderr, "End of search list.\n");





More information about the cfe-commits mailing list