mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 18:24:00 +00:00
Sink DwarfUnit::constructImportedEntityDIE into DwarfCompileUnit.
So that it has access to getOrCreateGlobalVariableDIE. If we ever support decsribing using directive in C++ classes (thus requiring support in type units), it will certainly use another mechanism anyway. Differential Revision: http://reviews.llvm.org/D5975 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220594 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -615,6 +615,34 @@ DwarfCompileUnit::constructAbstractSubprogramScopeDIE(LexicalScope *Scope) {
|
||||
return AbsDef;
|
||||
}
|
||||
|
||||
std::unique_ptr<DIE>
|
||||
DwarfCompileUnit::constructImportedEntityDIE(const DIImportedEntity &Module) {
|
||||
assert(Module.Verify() &&
|
||||
"Use one of the MDNode * overloads to handle invalid metadata");
|
||||
std::unique_ptr<DIE> IMDie = make_unique<DIE>((dwarf::Tag)Module.getTag());
|
||||
insertDIE(Module, IMDie.get());
|
||||
DIE *EntityDie;
|
||||
DIDescriptor Entity = resolve(Module.getEntity());
|
||||
if (Entity.isNameSpace())
|
||||
EntityDie = getOrCreateNameSpace(DINameSpace(Entity));
|
||||
else if (Entity.isSubprogram())
|
||||
EntityDie = getOrCreateSubprogramDIE(DISubprogram(Entity));
|
||||
else if (Entity.isType())
|
||||
EntityDie = getOrCreateTypeDIE(DIType(Entity));
|
||||
else
|
||||
EntityDie = getDIE(Entity);
|
||||
assert(EntityDie);
|
||||
addSourceLine(*IMDie, Module.getLineNumber(),
|
||||
Module.getContext().getFilename(),
|
||||
Module.getContext().getDirectory());
|
||||
addDIEEntry(*IMDie, dwarf::DW_AT_import, *EntityDie);
|
||||
StringRef Name = Module.getName();
|
||||
if (!Name.empty())
|
||||
addString(*IMDie, dwarf::DW_AT_name, Name);
|
||||
|
||||
return IMDie;
|
||||
}
|
||||
|
||||
void DwarfCompileUnit::finishSubprogramDefinition(DISubprogram SP) {
|
||||
DIE *D = getDIE(SP);
|
||||
if (DIE *AbsSPDIE = DD->getAbstractSPDies().lookup(SP)) {
|
||||
|
Reference in New Issue
Block a user