[llvm-dev] [RFC] Setting the current debug loc when the insertion point changes

Tobias Edler von Koch via llvm-dev llvm-dev at lists.llvm.org
Wed Nov 8 09:29:10 PST 2017


There's also the opposite problem of the IRBuilder sometimes not being 
able to find a debug location at the insertion point when it is required 
to add one (e.g. when inserting a CallInst into a function that has 
debug info)... another argument for making it explicit!

On 11/06/2017 05:32 PM, Vedant Kumar via llvm-dev wrote:
> Wdyt of adopting parts of both solutions? I.e, we'd have the following 
> methods:
>
> // Transition API
> - SetInsertPointAndDebugLoc(BasicBlock *)
> - SetInsertPointAndDebugLoc(Instruction *)
> - SetInsertPointAndDebugLoc(BasicBlock *, BasicBlock::iterator)
>
> // Future API
> - SetInsertPoint(BasicBlock *, const DebugLoc &)
> - SetInsertPoint(Instruction *, const DebugLoc &)
> - SetInsertPoint(BasicBlock *, BasicBlock::iterator, const DebugLoc &)

+1 to this solution. We shouldn't silently change the behavior of the 
existing SetInsertPoint API.

Thanks,
Tobias

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.



More information about the llvm-dev mailing list