Bill Schmidt f4c899f8e7 This patch addresses an ABI compatibility issue with empty aggregate
parameters.  Examples of these are:

  struct { } a;
  union { } b[256];
  int a[0];

An empty aggregate has an address, although dereferencing that address is
pointless.  When passed as a parameter, an empty aggregate does not consume
a protocol register, nor does it consume a doubleword in the parameter save
area.  Passing an empty aggregate by reference passes an address just as
for any other aggregate.  Returning an empty aggregate uses GPR3 as a hidden
address of the return value location, just as for any other aggregate.

The patch modifies PPCTargetLowering::LowerFormalArguments_64SVR4 and
PPCTargetLowering::LowerCall_64SVR4 to properly skip empty aggregate
parameters passed by value.  The handling of return values and by-reference
parameters was already correct.

Built on powerpc64-unknown-linux-gnu and tested with no new regressions.
A test case is included to test proper handling of empty aggregate
parameters on both sides of the function call protocol.

llvm-svn: 167090
2012-10-31 01:15:05 +00:00
..
2011-05-02 15:58:16 +00:00
2012-06-19 21:46:25 +00:00
2012-10-11 15:38:20 +00:00
2012-10-05 13:32:38 +00:00
2012-08-28 02:10:15 +00:00
2011-05-02 15:58:16 +00:00
2012-08-28 02:10:33 +00:00
2012-10-16 13:30:53 +00:00
2012-06-04 17:36:38 +00:00