[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
Mon Feb 5 07:58:56 PST 2018


djtodoro updated this revision to Diff 132812.

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
@@ -825,6 +825,9 @@
   F->getParent()->getFunctionList().insert(F->getIterator(), NF);
   NF->takeName(F);
 
+  // Patch the pointer to LLVM function in debug info descriptor.
+  NF->setSubprogram(F->getSubprogram());
+
   // Loop over all of the callers of the function, transforming the call sites
   // to pass in a smaller number of arguments into the new function.
   std::vector<Value*> Args;
@@ -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.132812.patch
Type: text/x-patch
Size: 883 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180205/6b4a0111/attachment.bin>


More information about the llvm-commits mailing list