summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorStrahinja Petrovic <strahinja.petrovic@rt-rk.com>2016-06-24 12:12:41 +0000
committerStrahinja Petrovic <strahinja.petrovic@rt-rk.com>2016-06-24 12:12:41 +0000
commit515a1eb44cda8600a3ef900c00831c3c393ca94b (patch)
tree31e3acf517f5adf14d3b3fb4c53a1874b7a383d5 /clang/lib/CodeGen
parent034d2c92e8406e057d8884c00b617485875b70ea (diff)
downloadbcm5719-llvm-515a1eb44cda8600a3ef900c00831c3c393ca94b.tar.gz
bcm5719-llvm-515a1eb44cda8600a3ef900c00831c3c393ca94b.zip
This patch fixes problem with passing structures and unions
smaller than register as argument in variadic functions on big endian architectures. Differential Revision: http://reviews.llvm.org/D21611 llvm-svn: 273665
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index 75283a1942c..52bc6bb34d6 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -272,7 +272,8 @@ static Address emitVoidPtrDirectVAArg(CodeGenFunction &CGF,
// If the argument is smaller than a slot, and this is a big-endian
// target, the argument will be right-adjusted in its slot.
- if (DirectSize < SlotSize && CGF.CGM.getDataLayout().isBigEndian()) {
+ if (DirectSize < SlotSize && CGF.CGM.getDataLayout().isBigEndian() &&
+ !DirectTy->isStructTy()) {
Addr = CGF.Builder.CreateConstInBoundsByteGEP(Addr, SlotSize - DirectSize);
}
OpenPOWER on IntegriCloud