[PATCH] D54997: [DebugInfo] PR39807: Create unknown locations when hoisting to locationless blocks

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 28 04:14:09 PST 2018


nikic added inline comments.


================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:1403
+                           : DILocation::getMergedLocation(I1->getDebugLoc(),
+                                                           I2->getDebugLoc()));
 
----------------
The non-terminator case in L1330 uses `applyMergedLocation()`, which is basically what is done here, minus the attempt to use `InsertPt->getDebugLoc()` first.

I'm wondering why these two cases are handled differently. While using the debugloc of the insertion point is more correct than using the debugloc of an arbitrary (possibly dead) branch, it still does not seem correct either. Shouldn't we just always use the result of merging debug locs here?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54997/new/

https://reviews.llvm.org/D54997





More information about the llvm-commits mailing list