Add comparison operators for DIDescriptors to fix c++98 fallout
authorEric Christopher <echristo@gmail.com>
Wed, 17 Jul 2013 23:25:22 +0000 (23:25 +0000)
committerEric Christopher <echristo@gmail.com>
Wed, 17 Jul 2013 23:25:22 +0000 (23:25 +0000)
of operator bool change.

Also convert a variable in DebugIR.

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

include/llvm/DebugInfo.h
lib/Transforms/Instrumentation/DebugIR.cpp

index 1d7384c11703a4e00183f7497f4a7e7fc0b0d746..02335eeadd36373bc5f930fb1f739b30e122bc8a 100644 (file)
@@ -109,6 +109,13 @@ namespace llvm {
     // implicitly convertable to pointer.
     LLVM_EXPLICIT operator bool() const { return DbgNode != 0; }
 
+    bool operator==(DIDescriptor Other) const {
+      return DbgNode != Other.DbgNode;
+    }
+    bool operator!=(DIDescriptor Other) const {
+      return !operator==(Other);
+    }
+
     unsigned getTag() const {
       return getUnsignedField(0) & ~LLVMDebugVersionMask;
     }
index b5bdc7560b6b0a1fc5185d572ddd6f5ee97251aa..cea19e6510d88de65c6e3121bf23c9c15d111b9e 100644 (file)
@@ -220,7 +220,7 @@ public:
         DICompileUnit(CUNode), F.getName(), MangledName, DIFile(FileNode), Line,
         Sig, Local, IsDefinition, ScopeLine, FuncFlags, IsOptimized, &F);
     assert(Sub.isSubprogram());
-    DEBUG(dbgs() << "create subprogram mdnode " << Sub << ": "
+    DEBUG(dbgs() << "create subprogram mdnode " << *Sub << ": "
                  << "\n");
 
     SubprogramDescriptors.insert(std::make_pair(&F, Sub));