[llvm-commits] [llvm] r60174 - /llvm/trunk/lib/Support/Annotation.cpp

Nuno Lopes nunoplopes at sapo.pt
Thu Nov 27 08:37:03 PST 2008


Author: nlopes
Date: Thu Nov 27 10:37:02 2008
New Revision: 60174

URL: http://llvm.org/viewvc/llvm-project?rev=60174&view=rev
Log:
fix my previous commit r60064: compare strings instead of pointers

Modified:
    llvm/trunk/lib/Support/Annotation.cpp

Modified: llvm/trunk/lib/Support/Annotation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Annotation.cpp?rev=60174&r1=60173&r2=60174&view=diff

==============================================================================
--- llvm/trunk/lib/Support/Annotation.cpp (original)
+++ llvm/trunk/lib/Support/Annotation.cpp Thu Nov 27 10:37:02 2008
@@ -27,7 +27,16 @@
   }
 }
 
-typedef std::map<const char*, unsigned> IDMapType;
+namespace {
+  class StrCmp {
+  public:
+    bool operator()(const char *a, const char *b) {
+      return strcmp(a, b) < 0;
+    }
+  };
+}
+
+typedef std::map<const char*, unsigned, StrCmp> IDMapType;
 static unsigned IDCounter = 0;  // Unique ID counter
 
 // Static member to ensure initialiation on demand.





More information about the llvm-commits mailing list