[PowerPC] Fix small argument stack slot offset for LE
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Fri, 20 Jun 2014 16:37:40 +0000 (16:37 +0000)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Fri, 20 Jun 2014 16:37:40 +0000 (16:37 +0000)
commitbebc55b13b8358625509b15608bb32638da9a5ca
treed1fb00d28db137147746f381edcd3f98c94452ba
parentf1906138b4cb4562b5489623f52f49dc6bef28e7
[PowerPC] Fix small argument stack slot offset for LE

When small arguments (structures < 8 bytes or "float") are passed in a
stack slot in the ppc64 SVR4 ABI, they must reside in the least
significant part of that slot.  On BE, this means that an offset needs
to be added to the stack address of the parameter, but on LE, the least
significant part of the slot has the same address as the slot itself.

For the most part, this is handled in the LLVM back-end, where I just
fixed the LE case in commit r211368.

However, there is one piece of the clang front-end that is also aware of
these stack-slot offsets: PPC64_SVR4_ABIInfo::EmitVAArg.  This patch
updates that routine to take endianness into account.

llvm-svn: 211370
clang/lib/CodeGen/TargetInfo.cpp
clang/test/CodeGen/ppc64le-varargs-complex.c [new file with mode: 0644]