From 4751a53c5e5fed4bf2271e29cae7411c93a77df7 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 20 Jul 2010 20:13:52 +0000 Subject: [PATCH] Use getDebugLoc and setDebugLoc instead of getDbgMetadata and setDbgMetadata, avoiding MDNode overhead. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108911 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGCall.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 3d1e143dca..c127d9281f 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -1000,7 +1000,7 @@ void CodeGenFunction::EmitFunctionEpilog(const CGFunctionInfo &FI) { return; } - llvm::MDNode *RetDbgInfo = 0; + llvm::DebugLoc RetDbgLoc; llvm::Value *RV = 0; QualType RetTy = FI.getReturnType(); const ABIArgInfo &RetAI = FI.getReturnInfo(); @@ -1034,7 +1034,7 @@ void CodeGenFunction::EmitFunctionEpilog(const CGFunctionInfo &FI) { RV = Builder.CreateLoad(ReturnValue); } else { // Get the stored value and nuke the now-dead store. - RetDbgInfo = SI->getDbgMetadata(); + RetDbgLoc = SI->getDebugLoc(); RV = SI->getValueOperand(); SI->eraseFromParent(); @@ -1058,8 +1058,7 @@ void CodeGenFunction::EmitFunctionEpilog(const CGFunctionInfo &FI) { } llvm::Instruction *Ret = RV ? Builder.CreateRet(RV) : Builder.CreateRetVoid(); - if (RetDbgInfo) - Ret->setDbgMetadata(RetDbgInfo); + Ret->setDebugLoc(RetDbgLoc); } RValue CodeGenFunction::EmitDelegateCallArg(const VarDecl *Param) { -- 2.40.0