]> granicus.if.org Git - clang/commitdiff
Fix regression caused by r108911.
authorDevang Patel <dpatel@apple.com>
Wed, 21 Jul 2010 18:08:50 +0000 (18:08 +0000)
committerDevang Patel <dpatel@apple.com>
Wed, 21 Jul 2010 18:08:50 +0000 (18:08 +0000)
Do not override known debug loc with unknown debug loc.
This is tested by sections.exp in gdb testsuite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109022 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGCall.cpp

index c127d9281f11fba1534cc398476064eecc910bd4..b22e349d9520ca399f836e5ac201d424d9baed85 100644 (file)
@@ -1058,7 +1058,8 @@ void CodeGenFunction::EmitFunctionEpilog(const CGFunctionInfo &FI) {
   }
 
   llvm::Instruction *Ret = RV ? Builder.CreateRet(RV) : Builder.CreateRetVoid();
-  Ret->setDebugLoc(RetDbgLoc);
+  if (!RetDbgLoc.isUnknown())
+    Ret->setDebugLoc(RetDbgLoc);
 }
 
 RValue CodeGenFunction::EmitDelegateCallArg(const VarDecl *Param) {