]> granicus.if.org Git - clang/commit
Fix CoerceIntOrPtrToIntOrPtr on big-endian targets.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 5 Jun 2013 03:00:13 +0000 (03:00 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 5 Jun 2013 03:00:13 +0000 (03:00 +0000)
commit7e9f52f1faacf5505476418411127c5b16e07533
tree49544948c1031df0b6c1089a73cb2c580ecf2fad
parent90f9ec0dff7592c635e719909d288b5de04d224b
Fix CoerceIntOrPtrToIntOrPtr on big-endian targets.

Type coercion for argument passing is equivalent to storing the source
type and loading the destination type from the same pointer. On
big-endian targets, this means that the high bits of integers are
preserved.

This patch fixes the CoerceIntOrPtrToIntOrPtr() function on big-endian
targets by inserting the required shift instructions to preserve the
high bits instead of the low bits.

This is used by SparcABIInfo when passing small structs in the high bits
of registers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183291 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGCall.cpp
test/CodeGen/sparcv9-abi.c