diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-05-07 21:35:53 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-05-07 21:35:53 +0000 |
commit | 20d9e41ddb3f531267680819b5cac4cac1c6b231 (patch) | |
tree | 876162a4fa808369b673daf5be737c98476679bd /lib/IR/DIBuilder.cpp | |
parent | 8cb6b971601d42a27e40f0f1d4828671441989f5 (diff) | |
download | external_llvm-20d9e41ddb3f531267680819b5cac4cac1c6b231.zip external_llvm-20d9e41ddb3f531267680819b5cac4cac1c6b231.tar.gz external_llvm-20d9e41ddb3f531267680819b5cac4cac1c6b231.tar.bz2 |
Rename DIImportedModule to DIImportedEntity and allow imported declarations
DIBuilder::createImportedDeclaration isn't fully plumbed through (note,
lacking in AsmPrinter/DwarfDebug support) but this seemed like a
sufficiently useful division of code to make the subsequent patch(es)
easier to follow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181364 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/DIBuilder.cpp')
-rw-r--r-- | lib/IR/DIBuilder.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/IR/DIBuilder.cpp b/lib/IR/DIBuilder.cpp index 0980e80..eb220b2 100644 --- a/lib/IR/DIBuilder.cpp +++ b/lib/IR/DIBuilder.cpp @@ -128,7 +128,7 @@ void DIBuilder::createCompileUnit(unsigned Lang, StringRef Filename, NMD->addOperand(TheCU); } -DIImportedModule DIBuilder::createImportedModule(DIScope Context, +DIImportedEntity DIBuilder::createImportedModule(DIScope Context, DINameSpace NS, unsigned Line) { Value *Elts[] = { @@ -137,7 +137,22 @@ DIImportedModule DIBuilder::createImportedModule(DIScope Context, NS, ConstantInt::get(Type::getInt32Ty(VMContext), Line), }; - DIImportedModule M(MDNode::get(VMContext, Elts)); + DIImportedEntity M(MDNode::get(VMContext, Elts)); + assert(M.Verify() && "Imported module should be valid"); + AllImportedModules.push_back(M); + return M; +} + +DIImportedEntity DIBuilder::createImportedDeclaration(DIScope Context, + DIDescriptor Decl, + unsigned Line) { + Value *Elts[] = { + GetTagConstant(VMContext, dwarf::DW_TAG_imported_declaration), + Context, + Decl, + ConstantInt::get(Type::getInt32Ty(VMContext), Line), + }; + DIImportedEntity M(MDNode::get(VMContext, Elts)); assert(M.Verify() && "Imported module should be valid"); AllImportedModules.push_back(M); return M; |