mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-28 22:24:28 +00:00
Do not add redundant arguments in a method definition DIE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63527 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1914,18 +1914,20 @@ private:
|
||||
// Add Return Type.
|
||||
if (!IsConstructor)
|
||||
AddType(DW_Unit, SPDie, DIType(Args.getElement(0).getGV()));
|
||||
|
||||
// Add arguments.
|
||||
if (!Args.isNull())
|
||||
for (unsigned i = 1, N = Args.getNumElements(); i < N; ++i) {
|
||||
DIE *Arg = new DIE(DW_TAG_formal_parameter);
|
||||
AddType(DW_Unit, Arg, DIType(Args.getElement(i).getGV()));
|
||||
AddUInt(Arg, DW_AT_artificial, DW_FORM_flag, 1); // ???
|
||||
SPDie->AddChild(Arg);
|
||||
}
|
||||
|
||||
if (!SP.isDefinition())
|
||||
AddUInt(SPDie, DW_AT_declaration, DW_FORM_flag, 1);
|
||||
if (!SP.isDefinition()) {
|
||||
AddUInt(SPDie, DW_AT_declaration, DW_FORM_flag, 1);
|
||||
// Add arguments.
|
||||
// Do not add arguments for subprogram definition. They will be
|
||||
// handled through RecordVariable.
|
||||
if (!Args.isNull())
|
||||
for (unsigned i = 1, N = Args.getNumElements(); i < N; ++i) {
|
||||
DIE *Arg = new DIE(DW_TAG_formal_parameter);
|
||||
AddType(DW_Unit, Arg, DIType(Args.getElement(i).getGV()));
|
||||
AddUInt(Arg, DW_AT_artificial, DW_FORM_flag, 1); // ???
|
||||
SPDie->AddChild(Arg);
|
||||
}
|
||||
}
|
||||
|
||||
if (!SP.isLocalToUnit())
|
||||
AddUInt(SPDie, DW_AT_external, DW_FORM_flag, 1);
|
||||
@ -2856,6 +2858,11 @@ private:
|
||||
DIE *&Slot = Unit->getDieMapSlotFor(SP.getGV());
|
||||
if (Slot) continue;
|
||||
|
||||
if (!SP.isDefinition())
|
||||
// This is a method declaration which will be handled while
|
||||
// constructing class type.
|
||||
continue;
|
||||
|
||||
DIE *SubprogramDie = CreateSubprogramDIE(Unit, SP);
|
||||
|
||||
//Add to map.
|
||||
|
Reference in New Issue
Block a user