Refactor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137632 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2011-08-15 18:40:16 +00:00
parent 59bc4093d5
commit a098c506a2
2 changed files with 11 additions and 5 deletions

View File

@ -401,11 +401,8 @@ DIE *DwarfDebug::constructVariableDIE(DbgVariable *DV, LexicalScope *Scope) {
VariableCU->addType(VariableDie, DV->getType()); VariableCU->addType(VariableDie, DV->getType());
} }
if (Tag == dwarf::DW_TAG_formal_parameter && DV->getType().isArtificial()) if (DV->isArtificial())
VariableCU->addUInt(VariableDie, dwarf::DW_AT_artificial, VariableCU->addUInt(VariableDie, dwarf::DW_AT_artificial,
dwarf::DW_FORM_flag, 1);
else if (DIVariable(DV->getVariable()).isArtificial())
VariableCU->addUInt(VariableDie, dwarf::DW_AT_artificial,
dwarf::DW_FORM_flag, 1); dwarf::DW_FORM_flag, 1);
if (Scope->isAbstractScope()) { if (Scope->isAbstractScope()) {

View File

@ -143,6 +143,15 @@ public:
return dwarf::DW_TAG_variable; return dwarf::DW_TAG_variable;
} }
/// isArtificial - Return true if DbgVariable is artificial.
bool isArtificial() const {
if (Var.isArtificial())
return true;
if (Var.getTag() == dwarf::DW_TAG_arg_variable
&& getType().isArtificial())
return true;
return false;
}
bool variableHasComplexAddress() const { bool variableHasComplexAddress() const {
assert(Var.Verify() && "Invalid complex DbgVariable!"); assert(Var.Verify() && "Invalid complex DbgVariable!");
return Var.hasComplexAddress(); return Var.hasComplexAddress();