]> granicus.if.org Git - clang/commitdiff
Use getDebugLoc and setDebugLoc instead of getDbgMetadata and setDbgMetadata,
authorDan Gohman <gohman@apple.com>
Tue, 20 Jul 2010 20:13:52 +0000 (20:13 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 20 Jul 2010 20:13:52 +0000 (20:13 +0000)
avoiding MDNode overhead.

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

lib/CodeGen/CGCall.cpp

index 3d1e143dca2b23beede574f50c924bb4e45f0a70..c127d9281f11fba1534cc398476064eecc910bd4 100644 (file)
@@ -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) {