Set default location for the function if it is not already set.
[oota-llvm.git] / lib / CodeGen / SelectionDAG / SelectionDAGISel.cpp
index 8591da7621af6d2152e0e4a7361a8b03f518d87e..a232d82acd1664140fcf75046149cf69bd7f44cf 100644 (file)
@@ -747,6 +747,8 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn,
             DebugLoc Loc = ExtractDebugLocation(DILoc,
                                                 MF.getDebugLocInfo());
             FastIS->setCurDebugLoc(Loc);
+            if (MF.getDefaultDebugLoc().isUnknown())
+              MF.setDefaultDebugLoc(Loc);
           }
         }