Provide more details for DINameSpace debug info in the IR comment annotations
Sorry for the version skew - I should've committed this before the
corresponding Clang test case.
llvm-svn: 177486
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index d1db3ab..dd7ba23 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -1033,6 +1033,8 @@
DIVariable(DbgNode).printInternal(OS);
} else if (this->isObjCProperty()) {
DIObjCProperty(DbgNode).printInternal(OS);
+ } else if (this->isNameSpace()) {
+ DINameSpace(DbgNode).printInternal(OS);
} else if (this->isScope()) {
DIScope(DbgNode).printInternal(OS);
}
@@ -1106,6 +1108,14 @@
OS << " [" << A.getNumElements() << " elements]";
}
+void DINameSpace::printInternal(raw_ostream &OS) const {
+ StringRef Name = getName();
+ if (!Name.empty())
+ OS << " [" << Name << ']';
+
+ OS << " [line " << getLineNumber() << ']';
+}
+
void DISubprogram::printInternal(raw_ostream &OS) const {
// TODO : Print context
OS << " [line " << getLineNumber() << ']';