]> granicus.if.org Git - clang/commit
[analyzer] Destroy and lifetime-extend inlined function return values properly.
authorArtem Dergachev <artem.dergachev@gmail.com>
Mon, 12 Mar 2018 23:22:35 +0000 (23:22 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Mon, 12 Mar 2018 23:22:35 +0000 (23:22 +0000)
commit9a1bd8b74c6b9ccb6ec597fcae670dec7ba6ad0d
tree2aa6f4eedec301d6bc131ad4fab56c0f1c4b9f88
parent3e76d34afa479f864427ff6eaf04aac49bd81433
[analyzer] Destroy and lifetime-extend inlined function return values properly.

This patch uses the newly added CFGCXXRecordTypedCall element at the call site
of the caller to construct the return value within the callee directly into the
caller's stack frame. This way it is also capable of populating the temporary
destructor and lifetime extension maps for the temporary, which allows
temporary destructors and lifetime extension to work correctly.

This patch does not affect temporaries that were returned from conservatively
evaluated functions.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@327345 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
test/Analysis/lifetime-extension.cpp