aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-04-14 19:30:02 +0000
committerDan Gohman <gohman@apple.com>2010-04-14 19:30:02 +0000
commit7f6b8b8891adedce162ce23f5b540f98af202b22 (patch)
treef06f78dd81306051c349d718956150361ab49954 /lib/CodeGen
parent833ec1deed4568410e4fdfa0de9021d32c1479ff (diff)
Reset the debug location even if the instruction was a terminator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101272 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 5dd216bfaa..71fbafe6f3 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -260,13 +260,11 @@ void SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB,
for (BasicBlock::iterator I = Begin; I != End && !SDB->HasTailCall; ++I) {
SetDebugLoc(I, SDB, 0, MF);
- if (!isa<TerminatorInst>(I)) {
+ // Visit the instruction. Terminators are handled below.
+ if (!isa<TerminatorInst>(I))
SDB->visit(*I);
- // Set the current debug location back to "unknown" so that it doesn't
- // spuriously apply to subsequent instructions.
- ResetDebugLoc(SDB, 0);
- }
+ ResetDebugLoc(SDB, 0);
}
if (!SDB->HasTailCall) {