Support lowering of empty aggregates.
authorBill Wendling <isanbard@gmail.com>
Mon, 14 Jul 2014 06:22:36 +0000 (06:22 +0000)
committerBill Wendling <isanbard@gmail.com>
Mon, 14 Jul 2014 06:22:36 +0000 (06:22 +0000)
commit5388e6f9b38ffebd4bee08a1ed48f44088679bb9
treeebc08a801ca6d9d0aabd78083e872c40036ccff7
parent13764f7b189067c3ad5bb250d09793d68028c0b3
Support lowering of empty aggregates.

This crash was pretty common while compiling Rust for iOS (armv7). Reason -
SjLj preparation step was lowering aggregate arguments as ExtractValue +
InsertValue. ExtractValue has assertion which checks that there is some data in
value, which is not true in case of empty (no fields) structures. Rust uses
them quite extensively so this patch uses a 'select true, %val, undef'
instruction to lower the argument.

Patch by Valerii Hiora.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212922 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SjLjEHPrepare.cpp
test/CodeGen/ARM/sjljehprepare-lower-empty-struct.ll [new file with mode: 0644]