Fixes for Visual Studio users. Patch by OvermindDL1 on llvm-dev!
[oota-llvm.git] / lib / Support / Annotation.cpp
index 38b0607086747bc58da049ebf1580841d57c9b8f..9764b5e829dc38f140a7c700961439310c67e53d 100644 (file)
@@ -14,6 +14,7 @@
 #include "llvm/Support/Annotation.h"
 #include "llvm/Support/ManagedStatic.h"
 #include <map>
+#include <cstring>
 using namespace llvm;
 
 Annotation::~Annotation() {}  // Designed to be subclassed
@@ -27,7 +28,16 @@ Annotable::~Annotable() {   // Virtual because it's designed to be subclassed...
   }
 }
 
-typedef std::map<const char*, unsigned> IDMapType;
+namespace {
+  class StrCmp {
+  public:
+    bool operator()(const char *a, const char *b) const {
+      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.