Do not eagerly record known previous location. DBG_VALUE may not cause a new label...
authorDevang Patel <dpatel@apple.com>
Thu, 1 Apr 2010 20:22:44 +0000 (20:22 +0000)
committerDevang Patel <dpatel@apple.com>
Thu, 1 Apr 2010 20:22:44 +0000 (20:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100134 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index 45c8dadfbab88f19ba6638448f1c9d43f690d9a9..52c7089bb285ebd86dcc511533c8721762427fc1 100644 (file)
@@ -2051,7 +2051,6 @@ void DwarfDebug::beginScope(const MachineInstr *MI) {
   // Check and update last known location info.
   if(DILoc.getNode() == PrevDILoc)
     return;
-  PrevDILoc = DILoc.getNode();
 
   // DBG_VALUE instruction establishes new value.
   if (MI->isDebugValue()) {
@@ -2061,6 +2060,7 @@ void DwarfDebug::beginScope(const MachineInstr *MI) {
       MCSymbol *Label = recordSourceLine(DILoc.getLineNumber(),
                                          DILoc.getColumnNumber(),
                                          DILoc.getScope().getNode());
+      PrevDILoc = DILoc.getNode();
       DI->second->setDbgValueLabel(Label);
     }
     return;
@@ -2071,6 +2071,7 @@ void DwarfDebug::beginScope(const MachineInstr *MI) {
   MCSymbol *Label = recordSourceLine(DILoc.getLineNumber(),
                                      DILoc.getColumnNumber(),
                                      DILoc.getScope().getNode());
+  PrevDILoc = DILoc.getNode();
 
   // update DbgScope if this instruction starts a new scope.
   InsnToDbgScopeMapTy::iterator I = DbgScopeBeginMap.find(MI);