diff options
author | Devang Patel <dpatel@apple.com> | 2011-08-15 18:40:16 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2011-08-15 18:40:16 +0000 |
commit | a098c506a24a5f1a4e7c7344b53b2e586801a415 (patch) | |
tree | 833b3cbfa5a9f74143f56316e0d9d353d8eaa106 /lib/CodeGen/AsmPrinter | |
parent | 59bc4093d5009ecda4a4f70ed04c78502e28474f (diff) | |
download | external_llvm-a098c506a24a5f1a4e7c7344b53b2e586801a415.zip external_llvm-a098c506a24a5f1a4e7c7344b53b2e586801a415.tar.gz external_llvm-a098c506a24a5f1a4e7c7344b53b2e586801a415.tar.bz2 |
Refactor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137632 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 7 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.h | 9 |
2 files changed, 11 insertions, 5 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 54c0419..1679a30 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -401,11 +401,8 @@ DIE *DwarfDebug::constructVariableDIE(DbgVariable *DV, LexicalScope *Scope) { VariableCU->addType(VariableDie, DV->getType()); } - if (Tag == dwarf::DW_TAG_formal_parameter && DV->getType().isArtificial()) - 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, + if (DV->isArtificial()) + VariableCU->addUInt(VariableDie, dwarf::DW_AT_artificial, dwarf::DW_FORM_flag, 1); if (Scope->isAbstractScope()) { diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index 05656d5..97704b9 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -143,6 +143,15 @@ public: 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 { assert(Var.Verify() && "Invalid complex DbgVariable!"); return Var.hasComplexAddress(); |