]> granicus.if.org Git - llvm/commit
AArch64: Prefer FP-relative debug locations in HWASANified functions.
authorPeter Collingbourne <peter@pcc.me.uk>
Sat, 22 Jun 2019 00:06:51 +0000 (00:06 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Sat, 22 Jun 2019 00:06:51 +0000 (00:06 +0000)
commit51268ecd166a075d07bf18c72ff75760cd597f36
tree0de7d49e11c4eee469498d100f7b5a11651fc42c
parentfd3d2d94f140ffb257e7fae593eedc523841c45a
AArch64: Prefer FP-relative debug locations in HWASANified functions.

To help produce better diagnostics for stack use-after-return, we'd like
to be able to determine the addresses of each HWASANified function's local
variables given a small amount of information recorded on entry to the
function. Currently we require all HWASANified functions to use frame pointers
and record (PC, FP) on function entry. This works better than recording SP
because FP cannot change during the function, unlike SP which can change
e.g. due to dynamic alloca.

However, most variables currently end up using SP-relative locations in their
debug info. This prevents us from recomputing the address of most variables
because the distance between SP and FP isn't recorded in the debug info. To
address this, make the AArch64 backend prefer FP-relative debug locations
when producing debug info for HWASANified functions.

Differential Revision: https://reviews.llvm.org/D63300

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364117 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64FrameLowering.cpp
lib/Target/AArch64/AArch64FrameLowering.h
lib/Target/AArch64/AArch64RegisterInfo.cpp
test/CodeGen/AArch64/hwasan-prefer-fp.ll [new file with mode: 0644]