diff options
| -rw-r--r-- | llvm/include/llvm/DebugInfo.h | 2 | ||||
| -rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 10 | 
2 files changed, 12 insertions, 0 deletions
| diff --git a/llvm/include/llvm/DebugInfo.h b/llvm/include/llvm/DebugInfo.h index 30ea378a6fa..103a9b2842c 100644 --- a/llvm/include/llvm/DebugInfo.h +++ b/llvm/include/llvm/DebugInfo.h @@ -640,6 +640,8 @@ namespace llvm {    /// DINameSpace - A wrapper for a C++ style name space.    class DINameSpace : public DIScope { +    friend class DIDescriptor; +    void printInternal(raw_ostream &OS) const;    public:      explicit DINameSpace(const MDNode *N = 0) : DIScope(N) {}      DIScope getContext() const     { return getFieldAs<DIScope>(1);      } diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index d1db3ab53af..dd7ba23bf1a 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -1033,6 +1033,8 @@ void DIDescriptor::print(raw_ostream &OS) const {      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 @@ void DICompositeType::printInternal(raw_ostream &OS) const {    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() << ']'; | 

