[llvm] r186544 - Add comparison operators for DIDescriptors to fix c++98 fallout

Eric Christopher echristo at gmail.com
Wed Jul 17 16:25:22 PDT 2013


Author: echristo
Date: Wed Jul 17 18:25:22 2013
New Revision: 186544

URL: http://llvm.org/viewvc/llvm-project?rev=186544&view=rev
Log:
Add comparison operators for DIDescriptors to fix c++98 fallout
of operator bool change.

Also convert a variable in DebugIR.

Modified:
    llvm/trunk/include/llvm/DebugInfo.h
    llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp

Modified: llvm/trunk/include/llvm/DebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo.h?rev=186544&r1=186543&r2=186544&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/DebugInfo.h Wed Jul 17 18:25:22 2013
@@ -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;
     }

Modified: llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp?rev=186544&r1=186543&r2=186544&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp Wed Jul 17 18:25:22 2013
@@ -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));





More information about the llvm-commits mailing list