This is an archive of the discontinued LLVM Phabricator instance.

Move dbg.declare intrinsics when merging and replacing allocas.
ClosedPublic

Authored by eugenis on Sep 28 2015, 4:11 PM.

Details

Summary

Place new and updated dbg.declare calls immediately after the corresponding alloca.

Current code in replaceDbgDeclareForAlloca puts the new dbg.declare at the end of the basic block. LLVM codegen has problems emitting debug info in a situation when dbg.declare appears after all uses of the variable. This usually kinda works for inlining and ASan (two users of this function) but not for SafeStack. See http://reviews.llvm.org/D13178, which depends on this patch (and includes a part of it for now).

Diff Detail

Repository
rL LLVM

Event Timeline

eugenis updated this revision to Diff 35920.Sep 28 2015, 4:11 PM
eugenis retitled this revision from to Move dbg.declare intrinsics when merging and replacing allocas..
eugenis updated this object.
eugenis added reviewers: echristo, dblaikie, samsonov.
eugenis set the repository for this revision to rL LLVM.
eugenis added a subscriber: llvm-commits.
echristo accepted this revision.Sep 28 2015, 4:48 PM
echristo edited edge metadata.

This seems reasonable. Assume it passed the gdb test suite as well?

-eric

This revision is now accepted and ready to land.Sep 28 2015, 4:48 PM

Yes, this does not affect gdb test suite results (I get 5 unexpected failures with ToT clang on my machine for some reason, and 1 unexpected passing test).
Thanks!

Awesome. Thanks.

-eric

eugenis closed this revision.Sep 28 2015, 5:32 PM

r248769