summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-08-15 18:35:42 +0000
committerDevang Patel <dpatel@apple.com>2011-08-15 18:35:42 +0000
commit6e4d2c9fb7f11df6b97f0c96330efc330daf309a (patch)
tree0ddc31dad8b02ee77f42333fabab3fe7a3ad80e2 /llvm/lib/CodeGen
parent6bc11b275699051422e41db49e4db23ae4c12f41 (diff)
downloadbcm5719-llvm-6e4d2c9fb7f11df6b97f0c96330efc330daf309a.tar.gz
bcm5719-llvm-6e4d2c9fb7f11df6b97f0c96330efc330daf309a.zip
Refactor.
llvm-svn: 137631
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp16
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h8
2 files changed, 9 insertions, 15 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 5876456e16f..54c0419ab4a 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -377,20 +377,8 @@ DIE *DwarfDebug::constructVariableDIE(DbgVariable *DV, LexicalScope *Scope) {
if (Name.empty())
return NULL;
- // Translate tag to proper Dwarf tag. The result variable is dropped for
- // now.
- unsigned Tag;
- switch (DV->getTag()) {
- case dwarf::DW_TAG_return_variable:
- return NULL;
- case dwarf::DW_TAG_arg_variable:
- Tag = dwarf::DW_TAG_formal_parameter;
- break;
- case dwarf::DW_TAG_auto_variable: // fall thru
- default:
- Tag = dwarf::DW_TAG_variable;
- break;
- }
+ // Translate tag to proper Dwarf tag.
+ unsigned Tag = DV->getTag();
// Define variable debug information entry.
DIE *VariableDie = new DIE(Tag);
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
index 178c903666f..05656d531d3 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -136,7 +136,13 @@ public:
void setDotDebugLocOffset(unsigned O) { DotDebugLocOffset = O; }
unsigned getDotDebugLocOffset() const { return DotDebugLocOffset; }
StringRef getName() const { return Var.getName(); }
- unsigned getTag() const { return Var.getTag(); }
+ // Translate tag to proper Dwarf tag.
+ unsigned getTag() const {
+ if (Var.getTag() == dwarf::DW_TAG_arg_variable)
+ return dwarf::DW_TAG_formal_parameter;
+
+ return dwarf::DW_TAG_variable;
+ }
bool variableHasComplexAddress() const {
assert(Var.Verify() && "Invalid complex DbgVariable!");
return Var.hasComplexAddress();
OpenPOWER on IntegriCloud