diff options
author | Eric Christopher <echristo@gmail.com> | 2013-07-17 23:25:22 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2013-07-17 23:25:22 +0000 |
commit | 36ee010b9d2ab6250d9c23d311510fcdcad646c3 (patch) | |
tree | 37abef431551c59af43e3c702a25b1920d9bc801 | |
parent | b479870e89da4d2810ebc9dccf704f666e2b7248 (diff) | |
download | llvm-36ee010b9d2ab6250d9c23d311510fcdcad646c3.tar.gz llvm-36ee010b9d2ab6250d9c23d311510fcdcad646c3.tar.bz2 llvm-36ee010b9d2ab6250d9c23d311510fcdcad646c3.tar.xz |
Add comparison operators for DIDescriptors to fix c++98 fallout
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
-rw-r--r-- | include/llvm/DebugInfo.h | 7 | ||||
-rw-r--r-- | lib/Transforms/Instrumentation/DebugIR.cpp | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/include/llvm/DebugInfo.h b/include/llvm/DebugInfo.h index 1d7384c117..02335eeadd 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 b5bdc7560b..cea19e6510 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)); |