From 8b4b95131bdcf1c944cdd10964179ec7ffc68234 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Wed, 17 Jul 2013 23:25:22 +0000 Subject: [PATCH] Add comparison operators for DIDescriptors to fix c++98 fallout of operator bool change. Also convert a variable in DebugIR. llvm-svn: 186544 --- include/llvm/DebugInfo.h | 7 +++++++ lib/Transforms/Instrumentation/DebugIR.cpp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/llvm/DebugInfo.h b/include/llvm/DebugInfo.h index 1d7384c1170..02335eeadd3 100644 --- a/include/llvm/DebugInfo.h +++ b/include/llvm/DebugInfo.h @@ -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; } diff --git a/lib/Transforms/Instrumentation/DebugIR.cpp b/lib/Transforms/Instrumentation/DebugIR.cpp index b5bdc7560b6..cea19e6510d 100644 --- a/lib/Transforms/Instrumentation/DebugIR.cpp +++ b/lib/Transforms/Instrumentation/DebugIR.cpp @@ -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));