1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00

Sink DwarfUnit::applyVariableAttributes into DwarfCompileUnit

llvm-svn: 221088
This commit is contained in:
David Blaikie 2014-11-02 07:06:51 +00:00
parent abebe0162c
commit 96c3f13e27
4 changed files with 12 additions and 12 deletions

View File

@ -809,4 +809,15 @@ void DwarfCompileUnit::addLocationList(DIE &Die, dwarf::Attribute Attribute,
: dwarf::DW_FORM_data4;
Die.addValue(Attribute, Form, Value);
}
void DwarfUnit::applyVariableAttributes(const DbgVariable &Var,
DIE &VariableDie) {
StringRef Name = Var.getName();
if (!Name.empty())
addString(VariableDie, dwarf::DW_AT_name, Name);
addSourceLine(VariableDie, Var.getVariable());
addType(VariableDie, Var.getType());
if (Var.isArtificial())
addFlag(VariableDie, dwarf::DW_AT_artificial);
}
} // end llvm namespace

View File

@ -210,6 +210,7 @@ public:
/// Add a Dwarf loclistptr attribute data and value.
void addLocationList(DIE &Die, dwarf::Attribute Attribute, unsigned Index);
void applyVariableAttributes(const DbgVariable &Var, DIE &VariableDie);
};
} // end llvm namespace

View File

@ -1381,17 +1381,6 @@ void DwarfUnit::applySubprogramAttributes(DISubprogram SP, DIE &SPDie) {
addFlag(SPDie, dwarf::DW_AT_explicit);
}
void DwarfUnit::applyVariableAttributes(const DbgVariable &Var,
DIE &VariableDie) {
StringRef Name = Var.getName();
if (!Name.empty())
addString(VariableDie, dwarf::DW_AT_name, Name);
addSourceLine(VariableDie, Var.getVariable());
addType(VariableDie, Var.getType());
if (Var.isArtificial())
addFlag(VariableDie, dwarf::DW_AT_artificial);
}
/// constructSubrangeDIE - Construct subrange DIE from DISubrange.
void DwarfUnit::constructSubrangeDIE(DIE &Buffer, DISubrange SR, DIE *IndexTy) {
DIE &DW_Subrange = createAndAddDIE(dwarf::DW_TAG_subrange_type, Buffer);

View File

@ -304,7 +304,6 @@ public:
void applySubprogramAttributes(DISubprogram SP, DIE &SPDie);
void applySubprogramAttributesToDefinition(DISubprogram SP, DIE &SPDie);
void applyVariableAttributes(const DbgVariable &Var, DIE &VariableDie);
/// getOrCreateTypeDIE - Find existing DIE or create new DIE for the
/// given DIType.