summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-06-15 18:26:32 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-06-15 18:26:32 +0000
commit7e68c88bf7c4007ee3ef7c4884af1d45456c2e7a (patch)
treee49689eeacd3fa3e29276da8e6a58f854cbd4e4e /clang/lib/CodeGen/CGCall.cpp
parent967d584a3a118fb24be9acee2cb1176279a976c7 (diff)
downloadbcm5719-llvm-7e68c88bf7c4007ee3ef7c4884af1d45456c2e7a.tar.gz
bcm5719-llvm-7e68c88bf7c4007ee3ef7c4884af1d45456c2e7a.zip
Fix a regression from r132957 involving complex integers. (Fixes failures on gcc-testsuite bot.)
llvm-svn: 133069
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 5e9ecd574b6..b80787bb180 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -1189,7 +1189,8 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E,
return args.add(EmitReferenceBindingToExpr(E, /*InitializedDecl=*/0),
type);
- if (hasAggregateLLVMType(type) && isa<ImplicitCastExpr>(E) &&
+ if (hasAggregateLLVMType(type) && !E->getType()->isAnyComplexType() &&
+ isa<ImplicitCastExpr>(E) &&
cast<CastExpr>(E)->getCastKind() == CK_LValueToRValue) {
LValue L = EmitLValue(cast<CastExpr>(E)->getSubExpr());
assert(L.isSimple());
@@ -1257,7 +1258,10 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
case ABIArgInfo::Indirect: {
if (RV.isScalar() || RV.isComplex()) {
// Make a temporary alloca to pass the argument.
- Args.push_back(CreateMemTemp(I->Ty));
+ llvm::AllocaInst *AI = CreateMemTemp(I->Ty);
+ if (ArgInfo.getIndirectAlign() > AI->getAlignment())
+ AI->setAlignment(ArgInfo.getIndirectAlign());
+ Args.push_back(AI);
if (RV.isScalar())
EmitStoreOfScalar(RV.getScalarVal(), Args.back(), false,
Alignment, I->Ty);
OpenPOWER on IntegriCloud