]> granicus.if.org Git - clang/commit
Don't try to spill static allocas when emitting expr cleanups with branches
authorReid Kleckner <rnk@google.com>
Wed, 31 May 2017 19:59:41 +0000 (19:59 +0000)
committerReid Kleckner <rnk@google.com>
Wed, 31 May 2017 19:59:41 +0000 (19:59 +0000)
commit11cf8fe613b460240852aedd4d134ad2cf598ff9
tree4a7c808f422345e577b754773a0234b6745f8bf3
parent31598e1c84304f0ce0c17fd897035955cbaec8f1
Don't try to spill static allocas when emitting expr cleanups with branches

Credit goes to Gor Nishanov for putting together the fix in
https://reviews.llvm.org/D33733!

This patch is essentially me patching it locally and writing some test
cases to convince myself that it was necessary for GNU statement
expressions with branches as well as coroutines. I'll ask Gor to land
his patch with just the coroutines test.

During LValue expression evaluation, references can be bound to
anything, really: call results, aggregate temporaries, local variables,
global variables, or indirect arguments. We really only want to spill
instructions that were emitted as part of expression evaluation, and
static allocas are not that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304335 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGCleanup.cpp
test/CodeGenCXX/stmtexpr.cpp