[PATCH] D45923: Fix debug info in absense of DIFinder

Aditya Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 21 06:43:39 PDT 2018


hiraditya created this revision.
hiraditya added reviewers: slarin, tobiasvk, aprantl.
Herald added a subscriber: JDevlieghere.

w.r.t discussion, the correct fix for debug info in absense of DIFinder

http://lists.llvm.org/pipermail/llvm-dev/2017-June/114390.html


https://reviews.llvm.org/D45923

Files:
  lib/Transforms/Utils/CloneFunction.cpp


Index: lib/Transforms/Utils/CloneFunction.cpp
===================================================================
--- lib/Transforms/Utils/CloneFunction.cpp
+++ lib/Transforms/Utils/CloneFunction.cpp
@@ -52,6 +52,8 @@
   for (BasicBlock::const_iterator II = BB->begin(), IE = BB->end();
        II != IE; ++II) {
 
+    if (!DIFinder && II->getDebugLoc())
+      VMap.MD()[II->getDebugLoc()].reset(II->getDebugLoc());
     if (DIFinder && TheModule) {
       if (auto *DDI = dyn_cast<DbgDeclareInst>(II))
         DIFinder->processDeclare(*TheModule, DDI);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45923.143444.patch
Type: text/x-patch
Size: 557 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180421/3a1bbfb6/attachment.bin>


More information about the llvm-commits mailing list