[PATCH] D42794: [DeadArgumentElimination] Update pointer to the DISubprogram before calling RAUW. NFC

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 06:58:18 PST 2018


djtodoro created this revision.
djtodoro added a reviewer: aprantl.
djtodoro added a project: debug-info.
Herald added a subscriber: llvm-commits.

It is better to update pointer of the DISuprogram before we call RAUW for still live arguments of the function, because with https://reviews.llvm.org/D42541 in RAUW we compare DISubprograms rather than functions itself.


Repository:
  rL LLVM

https://reviews.llvm.org/D42794

Files:
  lib/Transforms/IPO/DeadArgumentElimination.cpp


Index: lib/Transforms/IPO/DeadArgumentElimination.cpp
===================================================================
--- lib/Transforms/IPO/DeadArgumentElimination.cpp
+++ lib/Transforms/IPO/DeadArgumentElimination.cpp
@@ -957,6 +957,9 @@
   // function empty.
   NF->getBasicBlockList().splice(NF->begin(), F->getBasicBlockList());
 
+  // Patch the pointer to LLVM function in debug info descriptor.
+  NF->setSubprogram(F->getSubprogram());
+
   // Loop over the argument list, transferring uses of the old arguments over to
   // the new arguments, also transferring over the names as well.
   i = 0;
@@ -1017,9 +1020,6 @@
         BB.getInstList().erase(RI);
       }
 
-  // Patch the pointer to LLVM function in debug info descriptor.
-  NF->setSubprogram(F->getSubprogram());
-
   // Now that the old function is dead, delete it.
   F->eraseFromParent();
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42794.132389.patch
Type: text/x-patch
Size: 870 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180201/5602207f/attachment.bin>


More information about the llvm-commits mailing list