diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 5dd216bfaa8..71fbafe6f31 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(I)) { + // Visit the instruction. Terminators are handled below. + if (!isa(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) {