Do not drop a variable's complex address if it is not based on frame base.
authorDevang Patel <dpatel@apple.com>
Mon, 25 Apr 2011 22:52:55 +0000 (22:52 +0000)
committerDevang Patel <dpatel@apple.com>
Mon, 25 Apr 2011 22:52:55 +0000 (22:52 +0000)
Observed this while reading code, so I do not have a test case handy here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130167 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index ffcd2bccb9498c199a7fdf74e7f0749471c76f4b..325c3d34a55388c85a24ab24bcc2e07b9c709f65 100644 (file)
@@ -709,7 +709,11 @@ DIE *DwarfDebug::constructVariableDIE(DbgVariable *DV, DbgScope *Scope) {
     } else {
       MachineLocation Location = Asm->getDebugValueLocation(DVInsn);
       if (Location.getReg()) {
-        TheCU->addAddress(VariableDie, dwarf::DW_AT_location, Location);
+        if (DV->getVariable().hasComplexAddress())
+          TheCU->addComplexAddress(DV, VariableDie, dwarf::DW_AT_location, 
+                                   Location);
+        else
+          TheCU->addAddress(VariableDie, dwarf::DW_AT_location, Location);
         updated = true;
       }
     }