Set default location for a function if it is not set.
authorDevang Patel <dpatel@apple.com>
Mon, 12 Oct 2009 23:10:55 +0000 (23:10 +0000)
committerDevang Patel <dpatel@apple.com>
Mon, 12 Oct 2009 23:10:55 +0000 (23:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83921 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

index a232d82acd1664140fcf75046149cf69bd7f44cf..ae98da5ef8b81aa24f1400da36234282b5bb6d26 100644 (file)
@@ -385,6 +385,8 @@ void SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB,
         DILocation DILoc(Dbg);
         DebugLoc Loc = ExtractDebugLocation(DILoc, MF->getDebugLocInfo());
         SDL->setCurDebugLoc(Loc);
+        if (MF->getDefaultDebugLoc().isUnknown())
+          MF->setDefaultDebugLoc(Loc);
       }
     }
     if (!isa<TerminatorInst>(I))