diff options
| author | David Blaikie <dblaikie@gmail.com> | 2013-04-22 06:12:31 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2013-04-22 06:12:31 +0000 |
| commit | f55abeaf4c2489106ccf4defdb1ebbd9a5d8b1ef (patch) | |
| tree | 3ba5b8be3b2835961a4276454452e30224421723 /llvm/include | |
| parent | 7af39d7de02957f673a8c35f87504a7757b4746d (diff) | |
| download | bcm5719-llvm-f55abeaf4c2489106ccf4defdb1ebbd9a5d8b1ef.tar.gz bcm5719-llvm-f55abeaf4c2489106ccf4defdb1ebbd9a5d8b1ef.zip | |
Revert "Revert "PR14606: debug info imported_module support""
This reverts commit r179840 with a fix to test/DebugInfo/two-cus-from-same-file.ll
I'm not sure why that test only failed on ARM & MIPS and not X86 Linux, even
though the debug info was clearly invalid on all of them, but this ought to fix
it.
llvm-svn: 179996
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/DIBuilder.h | 11 | ||||
| -rw-r--r-- | llvm/include/llvm/DebugInfo.h | 16 |
2 files changed, 26 insertions, 1 deletions
diff --git a/llvm/include/llvm/DIBuilder.h b/llvm/include/llvm/DIBuilder.h index bcbcd847595..35a4eb0e6cd 100644 --- a/llvm/include/llvm/DIBuilder.h +++ b/llvm/include/llvm/DIBuilder.h @@ -37,11 +37,13 @@ namespace llvm { class DIType; class DIArray; class DIGlobalVariable; + class DIImportedModule; class DINameSpace; class DIVariable; class DISubrange; class DILexicalBlockFile; class DILexicalBlock; + class DIScope; class DISubprogram; class DITemplateTypeParameter; class DITemplateValueParameter; @@ -57,6 +59,7 @@ namespace llvm { MDNode *TempRetainTypes; MDNode *TempSubprograms; MDNode *TempGVs; + MDNode *TempImportedModules; Function *DeclareFn; // llvm.dbg.declare Function *ValueFn; // llvm.dbg.value @@ -65,6 +68,7 @@ namespace llvm { SmallVector<Value *, 4> AllRetainTypes; SmallVector<Value *, 4> AllSubprograms; SmallVector<Value *, 4> AllGVs; + SmallVector<Value *, 4> AllImportedModules; DIBuilder(const DIBuilder &) LLVM_DELETED_FUNCTION; void operator=(const DIBuilder &) LLVM_DELETED_FUNCTION; @@ -569,6 +573,13 @@ namespace llvm { DILexicalBlock createLexicalBlock(DIDescriptor Scope, DIFile File, unsigned Line, unsigned Col); + /// \brief Create a descriptor for an imported module. + /// @param Context The scope this module is imported into + /// @param NS The namespace being imported here + /// @param LineNumber Line number + DIImportedModule createImportedModule(DIScope Context, DINameSpace NS, + unsigned Line); + /// insertDeclare - Insert a new llvm.dbg.declare intrinsic call. /// @param Storage llvm::Value of the variable /// @param VarInfo Variable's debug info descriptor. diff --git a/llvm/include/llvm/DebugInfo.h b/llvm/include/llvm/DebugInfo.h index 9e193b70cf2..f9b58f4770a 100644 --- a/llvm/include/llvm/DebugInfo.h +++ b/llvm/include/llvm/DebugInfo.h @@ -125,6 +125,7 @@ namespace llvm { bool isTemplateTypeParameter() const; bool isTemplateValueParameter() const; bool isObjCProperty() const; + bool isImportedModule() const; /// print - print descriptor. void print(raw_ostream &OS) const; @@ -199,8 +200,9 @@ namespace llvm { DIArray getRetainedTypes() const; DIArray getSubprograms() const; DIArray getGlobalVariables() const; + DIArray getImportedModules() const; - StringRef getSplitDebugFilename() const { return getStringField(11); } + StringRef getSplitDebugFilename() const { return getStringField(12); } /// Verify - Verify that a compile unit is well formed. bool Verify() const; @@ -681,6 +683,18 @@ namespace llvm { bool Verify() const; }; + /// \brief An imported module (C++ using directive or similar). + class DIImportedModule : public DIDescriptor { + friend class DIDescriptor; + void printInternal(raw_ostream &OS) const; + public: + explicit DIImportedModule(const MDNode *N) : DIDescriptor(N) { } + DIScope getContext() const { return getFieldAs<DIScope>(1); } + DINameSpace getNameSpace() const { return getFieldAs<DINameSpace>(2); } + unsigned getLineNumber() const { return getUnsignedField(3); } + bool Verify() const; + }; + /// getDISubprogram - Find subprogram that is enclosing this scope. DISubprogram getDISubprogram(const MDNode *Scope); |

