[PATCH] D29833: Improve the API of DILocation::getMergedLocation()
    David Blaikie via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Feb 10 10:17:37 PST 2017
    
    
  
dblaikie added a comment.
Also we should have a function for the non-merging case (hoisting/sinking) so we can do similar things there (& presumably refactor the common infrastructure between these two operations).
================
Comment at: lib/IR/Instruction.cpp:664-668
+  if (Loc && isa<CallInst>(this)) {
+    DbgLoc = DILocation::get(Loc->getContext(), 0, 0, Loc->getScope(),
+                             Loc->getInlinedAt());
+    return;
+  }
----------------
I'm not sure we can get the scope right, though - since we're potentially moving this location across scopes. It's going to be jumpy/create a difficult range in the scope no matter what, really... 
Any ideas? Take the scope from a nearby location at the destination, if possible? (doesn't really reflect reality, but nothing will - this would at least mean a chance of not punching holes in/making islands in scopes that would necessitate a DW_AT_ranges/more verbose description/etc)
Repository:
  rL LLVM
https://reviews.llvm.org/D29833
    
    
More information about the llvm-commits
mailing list