Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CheriBoundAllocas: Always use the alloca's debug loc for added instru…
…ctions IRBuilder defaults to using the debug loc for the instruction after the insert point. For the instructions inserted before their uses, this is somewhat sane, but really the debug loc should be that of the declaration with the bounding just sunk to the use. For instructions inserted after the alloca (both for dynamic bounds calculation and for creating a new padded static alloca if necessary) these inherit the debug loc of whatever happens to follow it, which is likely to be either prologue code with no debug loc or something like a call to @llvm.dbg.declare (as has been seen in -O0 code). Since all this is logically part of the alloca (even when sunk), just implemented via a CGP transformation to simplify CodeGen, explicitly set the debug location to that of the alloca. Whilst here, use a saner way to point the IRBuilder at one past the alloca.
- Loading branch information