aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-08-15 18:40:16 +0000
committerDevang Patel <dpatel@apple.com>2011-08-15 18:40:16 +0000
commita098c506a24a5f1a4e7c7344b53b2e586801a415 (patch)
tree833b3cbfa5a9f74143f56316e0d9d353d8eaa106
parent59bc4093d5009ecda4a4f70ed04c78502e28474f (diff)
downloadexternal_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
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp7
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.h9
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();