mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 21:32:39 +00:00
Reverting 100048; it broke two Frontend debug info tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100058 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bbd51cd0a1
commit
f8df814869
@ -780,26 +780,12 @@ void DwarfDebug::addToContextOwner(DIE *Die, DIDescriptor Context) {
|
|||||||
} else if (Context.isNameSpace()) {
|
} else if (Context.isNameSpace()) {
|
||||||
DIE *ContextDIE = getOrCreateNameSpace(DINameSpace(Context.getNode()));
|
DIE *ContextDIE = getOrCreateNameSpace(DINameSpace(Context.getNode()));
|
||||||
ContextDIE->addChild(Die);
|
ContextDIE->addChild(Die);
|
||||||
} else if (Context.isSubprogram()) {
|
|
||||||
DIE *ContextDIE = createSubprogramDIE(DISubprogram(Context.getNode()),
|
|
||||||
/*MakeDecl=*/false);
|
|
||||||
ContextDIE->addChild(Die);
|
|
||||||
} else if (DIE *ContextDIE = ModuleCU->getDIE(Context.getNode()))
|
} else if (DIE *ContextDIE = ModuleCU->getDIE(Context.getNode()))
|
||||||
ContextDIE->addChild(Die);
|
ContextDIE->addChild(Die);
|
||||||
else
|
else
|
||||||
ModuleCU->addDie(Die);
|
ModuleCU->addDie(Die);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// isFunctionContext - True if given Context is nested within a function.
|
|
||||||
bool DwarfDebug::isFunctionContext(DIE *context) {
|
|
||||||
if (context == (DIE *)0)
|
|
||||||
return false;
|
|
||||||
if (context->getTag() == dwarf::DW_TAG_subprogram)
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return isFunctionContext(context->getParent());
|
|
||||||
}
|
|
||||||
|
|
||||||
/// getOrCreateTypeDIE - Find existing DIE or create new DIE for the
|
/// getOrCreateTypeDIE - Find existing DIE or create new DIE for the
|
||||||
/// given DIType.
|
/// given DIType.
|
||||||
DIE *DwarfDebug::getOrCreateTypeDIE(DIType Ty) {
|
DIE *DwarfDebug::getOrCreateTypeDIE(DIType Ty) {
|
||||||
@ -981,10 +967,6 @@ void DwarfDebug::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {
|
|||||||
if (DIDescriptor(ContainingType.getNode()).isCompositeType())
|
if (DIDescriptor(ContainingType.getNode()).isCompositeType())
|
||||||
addDIEEntry(&Buffer, dwarf::DW_AT_containing_type, dwarf::DW_FORM_ref4,
|
addDIEEntry(&Buffer, dwarf::DW_AT_containing_type, dwarf::DW_FORM_ref4,
|
||||||
getOrCreateTypeDIE(DIType(ContainingType.getNode())));
|
getOrCreateTypeDIE(DIType(ContainingType.getNode())));
|
||||||
else {
|
|
||||||
DIDescriptor Context = CTy.getContext();
|
|
||||||
addToContextOwner(&Buffer, Context);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@ -1343,7 +1325,8 @@ DIE *DwarfDebug::updateSubprogramScopeDIE(MDNode *SPNode) {
|
|||||||
// function then gdb prefers the definition at top level and but does not
|
// function then gdb prefers the definition at top level and but does not
|
||||||
// expect specification DIE in parent function. So avoid creating
|
// expect specification DIE in parent function. So avoid creating
|
||||||
// specification DIE for a function defined inside a function.
|
// specification DIE for a function defined inside a function.
|
||||||
if (SP.isDefinition() && !isFunctionContext(SPDie->getParent())) {
|
if (SP.isDefinition() && !SP.getContext().isCompileUnit() &&
|
||||||
|
!SP.getContext().isFile() && !SP.getContext().isSubprogram()) {
|
||||||
addUInt(SPDie, dwarf::DW_AT_declaration, dwarf::DW_FORM_flag, 1);
|
addUInt(SPDie, dwarf::DW_AT_declaration, dwarf::DW_FORM_flag, 1);
|
||||||
|
|
||||||
// Add arguments.
|
// Add arguments.
|
||||||
@ -1771,15 +1754,19 @@ void DwarfDebug::constructGlobalVariableDIE(MDNode *N) {
|
|||||||
void DwarfDebug::constructSubprogramDIE(MDNode *N) {
|
void DwarfDebug::constructSubprogramDIE(MDNode *N) {
|
||||||
DISubprogram SP(N);
|
DISubprogram SP(N);
|
||||||
|
|
||||||
|
// Check for pre-existence.
|
||||||
|
if (ModuleCU->getDIE(N))
|
||||||
|
return;
|
||||||
|
|
||||||
if (!SP.isDefinition())
|
if (!SP.isDefinition())
|
||||||
// This is a method declaration which will be handled while constructing
|
// This is a method declaration which will be handled while constructing
|
||||||
// class type.
|
// class type.
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Check for pre-existence.
|
DIE *SubprogramDie = createSubprogramDIE(SP);
|
||||||
DIE *SubprogramDie = ModuleCU->getDIE(N);
|
|
||||||
if (!SubprogramDie)
|
// Add to map.
|
||||||
SubprogramDie = createSubprogramDIE(SP);
|
ModuleCU->insertDIE(N, SubprogramDie);
|
||||||
|
|
||||||
// Add to context owner.
|
// Add to context owner.
|
||||||
addToContextOwner(SubprogramDie, SP.getContext());
|
addToContextOwner(SubprogramDie, SP.getContext());
|
||||||
|
@ -315,9 +315,6 @@ class DwarfDebug : public DwarfPrinter {
|
|||||||
/// addToContextOwner - Add Die into the list of its context owner's children.
|
/// addToContextOwner - Add Die into the list of its context owner's children.
|
||||||
void addToContextOwner(DIE *Die, DIDescriptor Context);
|
void addToContextOwner(DIE *Die, DIDescriptor Context);
|
||||||
|
|
||||||
/// isFunctionContext - True if given Context is nested within a function.
|
|
||||||
bool isFunctionContext(DIE *context);
|
|
||||||
|
|
||||||
/// addType - Add a new type attribute to the specified entity.
|
/// addType - Add a new type attribute to the specified entity.
|
||||||
void addType(DIE *Entity, DIType Ty);
|
void addType(DIE *Entity, DIType Ty);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user