From: Duncan P. N. Exon Smith Date: Mon, 30 Mar 2015 20:01:41 +0000 (+0000) Subject: DebugInfo: Use new LLVM API for DebugLoc X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=70584084e5d9303c8253afc77866fa041a10697a;p=clang DebugInfo: Use new LLVM API for DebugLoc Use the new API for `DebugLoc` added in r233573 before the old one disappears. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233589 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index d39776191f..b3adfe4845 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -2380,7 +2380,7 @@ void CodeGenFunction::EmitFunctionEpilog(const CGFunctionInfo &FI, Ret = Builder.CreateRetVoid(); } - if (!RetDbgLoc.isUnknown()) + if (RetDbgLoc) Ret->setDebugLoc(std::move(RetDbgLoc)); } diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 1e30cb69bb..811486cf3a 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -92,7 +92,7 @@ ApplyDebugLocation::ApplyDebugLocation(CodeGenFunction &CGF, llvm::DebugLoc Loc) : CGF(CGF) { if (CGF.getDebugInfo()) { OriginalLocation = CGF.Builder.getCurrentDebugLocation(); - if (!Loc.isUnknown()) + if (Loc) CGF.Builder.SetCurrentDebugLocation(std::move(Loc)); } } diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index ae511ae4fe..9abc885d93 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -2350,7 +2350,7 @@ static void replaceUsesOfNonProtoConstant(llvm::Constant *old, callSite->replaceAllUsesWith(newCall.getInstruction()); // Copy debug location attached to CI. - if (!callSite->getDebugLoc().isUnknown()) + if (callSite->getDebugLoc()) newCall->setDebugLoc(callSite->getDebugLoc()); callSite->eraseFromParent(); }