diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-05-07 20:12:26 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-05-07 20:12:26 +0000 |
commit | 6f0877744517fa1daf3ac9d2e5c63c9acfcfa562 (patch) | |
tree | 659764f11ceffee15a6d10c7b24edd1983efeaec /lib/CodeGen | |
parent | 373197b9ca6975ecc9241ec06ec9856afbfcc9e7 (diff) |
Revert r130717, which caused a regression (<rdar://problem/9402621>).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131057 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGCall.cpp | 13 | ||||
-rw-r--r-- | lib/CodeGen/CGCall.h | 9 |
2 files changed, 4 insertions, 18 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 8e3856131a..a765f0f343 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -1166,15 +1166,6 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E, return args.add(EmitReferenceBindingToExpr(E, /*InitializedDecl=*/0), type); - if (hasAggregateLLVMType(type) && isa<ImplicitCastExpr>(E) && - cast<CastExpr>(E)->getCastKind() == CK_LValueToRValue) { - LValue L = EmitLValue(cast<CastExpr>(E)->getSubExpr()); - assert(L.isSimple()); - args.add(RValue::getAggregate(L.getAddress(), L.isVolatileQualified()), - type, /*NeedsCopy*/true); - return; - } - args.add(EmitAnyExprToTemp(E), type); } @@ -1240,10 +1231,6 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, Alignment, I->Ty); else StoreComplexToAddr(RV.getComplexVal(), Args.back(), false); - } else if (I->NeedsCopy && !ArgInfo.getIndirectByVal()) { - Args.push_back(CreateMemTemp(I->Ty)); - EmitAggregateCopy(Args.back(), RV.getAggregateAddr(), I->Ty, - RV.isVolatileQualified()); } else { Args.push_back(RV.getAggregateAddr()); } diff --git a/lib/CodeGen/CGCall.h b/lib/CodeGen/CGCall.h index 160a62eab3..3f600c04e5 100644 --- a/lib/CodeGen/CGCall.h +++ b/lib/CodeGen/CGCall.h @@ -47,9 +47,8 @@ namespace CodeGen { struct CallArg { RValue RV; QualType Ty; - bool NeedsCopy; - CallArg(RValue rv, QualType ty, bool needscopy) - : RV(rv), Ty(ty), NeedsCopy(needscopy) + CallArg(RValue rv, QualType ty) + : RV(rv), Ty(ty) { } }; @@ -58,8 +57,8 @@ namespace CodeGen { class CallArgList : public llvm::SmallVector<CallArg, 16> { public: - void add(RValue rvalue, QualType type, bool needscopy = false) { - push_back(CallArg(rvalue, type, needscopy)); + void add(RValue rvalue, QualType type) { + push_back(CallArg(rvalue, type)); } }; |