[CodeGen] Reuse stack space from unused function results
authorSergey Dmitrouk <sdmitrouk@accesssoftek.com>
Thu, 14 May 2015 19:58:03 +0000 (19:58 +0000)
committerSergey Dmitrouk <sdmitrouk@accesssoftek.com>
Thu, 14 May 2015 19:58:03 +0000 (19:58 +0000)
commit3e96fc08dabe5bb8f9dc888cd4e52a5e6f611102
tree999a652c7c028f55a3592c206a4c85c4a2b74aba
parent38b54cb67bb0f9eeb7e9c33627f7d33c2f7ae2da
[CodeGen] Reuse stack space from unused function results

Summary:
Space on stack allocated for unused structures returned by functions was unused
even when it's lifetime didn't intersect with lifetime of any other objects that
could use the same space.

The test added also checks for named and auto objects.  It seems to make sense
to have this all in one place.

Reviewers: aadg, rsmith, rjmccall, rnk

Reviewed By: rnk

Subscribers: asl, cfe-commits

Differential Revision: http://reviews.llvm.org/D9743

llvm-svn: 237385
clang/lib/CodeGen/CGCall.cpp
clang/test/CodeGenCXX/stack-reuse.cpp [new file with mode: 0644]