[llvm] [BranchFolding] Remove getBranchDebugLoc() (PR #114613)

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 17 09:25:10 PST 2025


https://github.com/jmorse commented:

(end-of-year holidays and so forth knocked me out of kilter, sorry for the delay),

> I also looked at the implementation of DILocation::getMergedLocation() and realized that it will clear the line/column of merged locs, which is probably not what we want.

It's desirable in certain circumstances, if there was genuine ambiguity between line numbers at the end of a block, it's better for the debugger to say nothing (line zero) than to say something false.

Overall it seems highly unlikely that such a situation would ever occur; and if it did then the merging would make it safe, and that'd be an improvement on what BranchFolding does today. Thus this is all desirable.

I'm adding the debug-info label as this didn't get it before so that it appears on other debug-info folks' radars. If there are no additional concerns from other folks in the next week or so, then LGTM.

https://github.com/llvm/llvm-project/pull/114613


More information about the llvm-commits mailing list