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));