From 2869b5afe3cc962cfe33f17d44b0615deeeb7a38 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Sat, 3 Dec 2011 03:08:40 +0000 Subject: Add a utility to get a RValue for a given LValue for an aggregate; switch a few places over to it. llvm-svn: 145747 --- clang/lib/CodeGen/CGCall.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'clang/lib/CodeGen/CGCall.cpp') diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 4f2210f10e4..93bc1753ce8 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -1463,8 +1463,7 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E, cast(E)->getCastKind() == CK_LValueToRValue) { LValue L = EmitLValue(cast(E)->getSubExpr()); assert(L.isSimple()); - args.add(RValue::getAggregate(L.getAddress(), L.isVolatileQualified()), - type, /*NeedsCopy*/true); + args.add(L.asAggregateRValue(), type, /*NeedsCopy*/true); return; } @@ -1518,7 +1517,7 @@ void CodeGenFunction::ExpandTypeToArgs(QualType Ty, RValue RV, // FIXME: Volatile? EltRV = RValue::getComplex(LoadComplexFromAddr(LV.getAddress(), false)); else if (CodeGenFunction::hasAggregateLLVMType(EltTy)) - EltRV = RValue::getAggregate(LV.getAddress()); + EltRV = LV.asAggregateRValue(); else EltRV = EmitLoadOfLValue(LV); ExpandTypeToArgs(EltTy, EltRV, Args, IRFuncTy); @@ -1539,7 +1538,7 @@ void CodeGenFunction::ExpandTypeToArgs(QualType Ty, RValue RV, // FIXME: Volatile? FldRV = RValue::getComplex(LoadComplexFromAddr(LV.getAddress(), false)); else if (CodeGenFunction::hasAggregateLLVMType(FT)) - FldRV = RValue::getAggregate(LV.getAddress()); + FldRV = LV.asAggregateRValue(); else FldRV = EmitLoadOfLValue(LV); ExpandTypeToArgs(FT, FldRV, Args, IRFuncTy); -- cgit v1.2.3