[PATCH] D16157: [OperandBundles] Copy DebugLoc with calls/invokes

Joseph Tremoulet via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 13 14:42:19 PST 2016


JosephTremoulet created this revision.
JosephTremoulet added a reviewer: sanjoy.
JosephTremoulet added a subscriber: llvm-commits.

The overloads of CallInst::Create and InvokeInst::Create that are used to
adjust operand bundles purport to create a new instruction "identical in
every way except [for] the operand bundles", so copy the DebugLoc along
with everything else.


http://reviews.llvm.org/D16157

Files:
  lib/IR/Instructions.cpp
  lib/Transforms/Utils/InlineFunction.cpp

Index: lib/Transforms/Utils/InlineFunction.cpp
===================================================================
--- lib/Transforms/Utils/InlineFunction.cpp
+++ lib/Transforms/Utils/InlineFunction.cpp
@@ -1449,7 +1449,6 @@
           NewInst = CallInst::Create(cast<CallInst>(I), OpBundles, I);
         else
           NewInst = InvokeInst::Create(cast<InvokeInst>(I), OpBundles, I);
-        NewInst->setDebugLoc(I->getDebugLoc());
         NewInst->takeName(I);
         I->replaceAllUsesWith(NewInst);
         I->eraseFromParent();
Index: lib/IR/Instructions.cpp
===================================================================
--- lib/IR/Instructions.cpp
+++ lib/IR/Instructions.cpp
@@ -309,6 +309,7 @@
   NewCI->setCallingConv(CI->getCallingConv());
   NewCI->SubclassOptionalData = CI->SubclassOptionalData;
   NewCI->setAttributes(CI->getAttributes());
+  NewCI->setDebugLoc(CI->getDebugLoc());
   return NewCI;
 }
 
@@ -596,6 +597,7 @@
   NewII->setCallingConv(II->getCallingConv());
   NewII->SubclassOptionalData = II->SubclassOptionalData;
   NewII->setAttributes(II->getAttributes());
+  NewII->setDebugLoc(II->getDebugLoc());
   return NewII;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16157.44796.patch
Type: text/x-patch
Size: 1168 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160113/991d1ff1/attachment.bin>


More information about the llvm-commits mailing list