]> granicus.if.org Git - clang/commit
[WinEH] Mark calls inside cleanups as noinline
authorReid Kleckner <rnk@google.com>
Wed, 28 Oct 2015 23:06:42 +0000 (23:06 +0000)
committerReid Kleckner <rnk@google.com>
Wed, 28 Oct 2015 23:06:42 +0000 (23:06 +0000)
commit8207ab01d35c6d9851af9a51f51319d85a847cee
tree1d6415adebce418eacfbead0fe52c196a95acbf2
parentf6a5ffd2cec68e89ddfb67b3c078c6c86a516a76
[WinEH] Mark calls inside cleanups as noinline

This works around PR25162. The MSVC tables make it very difficult to
correctly inline a C++ destructor that contains try / catch.  We've
attempted to address PR25162 in LLVM's backend, but it feels pretty
infeasible.  MSVC and ICC both appear to avoid inlining such complex
destructors.

Long term, we want to fix this by making the inliner smart enough to
know when it is inlining into a cleanup, so it can inline simple
destructors (~unique_ptr and ~vector) while avoiding destructors
containing try / catch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251576 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGCall.cpp
lib/CodeGen/CGCleanup.cpp
lib/CodeGen/CodeGenFunction.h
test/CodeGenCXX/microsoft-abi-eh-cleanups.cpp