If FastISel is run and it has known DebugLoc then use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69253 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index d7d0efc..7343b83 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -824,6 +824,7 @@
               R = FuncInfo->CreateRegForValue(BI);
           }
 
+          SDL->setCurDebugLoc(FastIS->getCurDebugLoc());
           SelectBasicBlock(LLVMBB, BI, next(BI));
           // If the instruction was codegen'd with multiple blocks,
           // inform the FastISel object where to resume inserting.
@@ -850,8 +851,12 @@
     // Run SelectionDAG instruction selection on the remainder of the block
     // not handled by FastISel. If FastISel is not run, this is the entire
     // block.
-    if (BI != End)
+    if (BI != End) {
+      // If FastISel is run and it has known DebugLoc then use it.
+      if (FastIS && !FastIS->getCurDebugLoc().isUnknown())
+        SDL->setCurDebugLoc(FastIS->getCurDebugLoc());
       SelectBasicBlock(LLVMBB, BI, End);
+    }
 
     FinishBasicBlock();
   }