]> granicus.if.org Git - clang/commit
IRGen: Move vtable load after argument evaluation.
authorPeter Collingbourne <peter@pcc.me.uk>
Mon, 5 Feb 2018 23:09:13 +0000 (23:09 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Mon, 5 Feb 2018 23:09:13 +0000 (23:09 +0000)
commit6102cb5d3132c010d2418a9109b89c65ebec6879
tree5314eb7b0f47fa2acced4ba7517686d56d5c325c
parent9018322d0ffb51099c9a6ca7827bf14a2d2805d1
IRGen: Move vtable load after argument evaluation.

This change reduces the live range of the loaded function pointer,
resulting in a slight code size decrease (~10KB in clang), and also
improves the security of CFI for virtual calls by making it less
likely that the function pointer will be spilled, and ensuring that
it is not spilled across a function call boundary.

Fixes PR35353.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324286 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGCXXABI.h
lib/CodeGen/CGCall.cpp
lib/CodeGen/CGCall.h
lib/CodeGen/CGExprCXX.cpp
lib/CodeGen/ItaniumCXXABI.cpp
lib/CodeGen/MicrosoftCXXABI.cpp
test/CodeGenCXX/cfi-vcall-check-after-args.cpp [new file with mode: 0644]
test/CodeGenCXX/cxx2a-destroying-delete.cpp
test/CodeGenCXX/microsoft-abi-multiple-nonvirtual-inheritance.cpp
test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp
test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-this-adjustment.cpp