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
This commit is contained in:
Eric Christopher 2013-07-17 23:25:22 +00:00
parent b479870e89
commit 36ee010b9d
2 changed files with 8 additions and 1 deletions

View 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;
}

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