@@ -1020,13 +1020,13 @@ void CodeGenFunction::ExpandTypeFromArgs(
1020
1020
1021
1021
auto Exp = getTypeExpansion (Ty, getContext ());
1022
1022
if (auto CAExp = dyn_cast<ConstantArrayExpansion>(Exp.get ())) {
1023
- forConstantArrayExpansion (* this , CAExp, LV. getAddress (),
1024
- [&](Address EltAddr) {
1025
- LValue LV = MakeAddrLValue (EltAddr, CAExp->EltTy );
1026
- ExpandTypeFromArgs (CAExp->EltTy , LV, AI);
1027
- });
1023
+ forConstantArrayExpansion (
1024
+ * this , CAExp, LV. getAddress (* this ), [&](Address EltAddr) {
1025
+ LValue LV = MakeAddrLValue (EltAddr, CAExp->EltTy );
1026
+ ExpandTypeFromArgs (CAExp->EltTy , LV, AI);
1027
+ });
1028
1028
} else if (auto RExp = dyn_cast<RecordExpansion>(Exp.get ())) {
1029
- Address This = LV.getAddress ();
1029
+ Address This = LV.getAddress (* this );
1030
1030
for (const CXXBaseSpecifier *BS : RExp->Bases ) {
1031
1031
// Perform a single step derived-to-base conversion.
1032
1032
Address Base =
@@ -1057,7 +1057,7 @@ void CodeGenFunction::ExpandTypeToArgs(
1057
1057
SmallVectorImpl<llvm::Value *> &IRCallArgs, unsigned &IRCallArgPos) {
1058
1058
auto Exp = getTypeExpansion (Ty, getContext ());
1059
1059
if (auto CAExp = dyn_cast<ConstantArrayExpansion>(Exp.get ())) {
1060
- Address Addr = Arg.hasLValue () ? Arg.getKnownLValue ().getAddress ()
1060
+ Address Addr = Arg.hasLValue () ? Arg.getKnownLValue ().getAddress (* this )
1061
1061
: Arg.getKnownRValue ().getAggregateAddress ();
1062
1062
forConstantArrayExpansion (
1063
1063
*this , CAExp, Addr, [&](Address EltAddr) {
@@ -1068,7 +1068,7 @@ void CodeGenFunction::ExpandTypeToArgs(
1068
1068
IRCallArgPos);
1069
1069
});
1070
1070
} else if (auto RExp = dyn_cast<RecordExpansion>(Exp.get ())) {
1071
- Address This = Arg.hasLValue () ? Arg.getKnownLValue ().getAddress ()
1071
+ Address This = Arg.hasLValue () ? Arg.getKnownLValue ().getAddress (* this )
1072
1072
: Arg.getKnownRValue ().getAggregateAddress ();
1073
1073
for (const CXXBaseSpecifier *BS : RExp->Bases ) {
1074
1074
// Perform a single step derived-to-base conversion.
@@ -3138,7 +3138,7 @@ static bool isProvablyNull(llvm::Value *addr) {
3138
3138
static void emitWriteback (CodeGenFunction &CGF,
3139
3139
const CallArgList::Writeback &writeback) {
3140
3140
const LValue &srcLV = writeback.Source ;
3141
- Address srcAddr = srcLV.getAddress ();
3141
+ Address srcAddr = srcLV.getAddress (CGF );
3142
3142
assert (!isProvablyNull (srcAddr.getPointer ()) &&
3143
3143
" shouldn't have writeback for provably null argument" );
3144
3144
@@ -3246,7 +3246,7 @@ static void emitWritebackArg(CodeGenFunction &CGF, CallArgList &args,
3246
3246
CRE->getSubExpr ()->getType ()->castAs <PointerType>()->getPointeeType ();
3247
3247
srcLV = CGF.MakeAddrLValue (srcAddr, srcAddrType);
3248
3248
}
3249
- Address srcAddr = srcLV.getAddress ();
3249
+ Address srcAddr = srcLV.getAddress (CGF );
3250
3250
3251
3251
// The dest and src types don't necessarily match in LLVM terms
3252
3252
// because of the crazy ObjC compatibility rules.
@@ -3560,7 +3560,7 @@ RValue CallArg::getRValue(CodeGenFunction &CGF) const {
3560
3560
CGF.EmitAggregateCopy (Copy, LV, Ty, AggValueSlot::DoesNotOverlap,
3561
3561
LV.isVolatile ());
3562
3562
IsUsed = true ;
3563
- return RValue::getAggregate (Copy.getAddress ());
3563
+ return RValue::getAggregate (Copy.getAddress (CGF ));
3564
3564
}
3565
3565
3566
3566
void CallArg::copyInto (CodeGenFunction &CGF, Address Addr) const {
@@ -3570,7 +3570,7 @@ void CallArg::copyInto(CodeGenFunction &CGF, Address Addr) const {
3570
3570
else if (!HasLV && RV.isComplex ())
3571
3571
CGF.EmitStoreOfComplex (RV.getComplexVal (), Dst, /* init=*/ true );
3572
3572
else {
3573
- auto Addr = HasLV ? LV.getAddress () : RV.getAggregateAddress ();
3573
+ auto Addr = HasLV ? LV.getAddress (CGF ) : RV.getAggregateAddress ();
3574
3574
LValue SrcLV = CGF.MakeAddrLValue (Addr, Ty);
3575
3575
// We assume that call args are never copied into subobjects.
3576
3576
CGF.EmitAggregateCopy (Dst, SrcLV, Ty, AggValueSlot::DoesNotOverlap,
@@ -3933,7 +3933,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
3933
3933
if (I->isAggregate ()) {
3934
3934
// Replace the placeholder with the appropriate argument slot GEP.
3935
3935
Address Addr = I->hasLValue ()
3936
- ? I->getKnownLValue ().getAddress ()
3936
+ ? I->getKnownLValue ().getAddress (* this )
3937
3937
: I->getKnownRValue ().getAggregateAddress ();
3938
3938
llvm::Instruction *Placeholder =
3939
3939
cast<llvm::Instruction>(Addr.getPointer ());
@@ -3978,7 +3978,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
3978
3978
// 3. If the argument is byval, but RV is not located in default
3979
3979
// or alloca address space.
3980
3980
Address Addr = I->hasLValue ()
3981
- ? I->getKnownLValue ().getAddress ()
3981
+ ? I->getKnownLValue ().getAddress (* this )
3982
3982
: I->getKnownRValue ().getAggregateAddress ();
3983
3983
llvm::Value *V = Addr.getPointer ();
3984
3984
CharUnits Align = ArgInfo.getIndirectAlign ();
@@ -4065,7 +4065,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
4065
4065
V = I->getKnownRValue ().getScalarVal ();
4066
4066
else
4067
4067
V = Builder.CreateLoad (
4068
- I->hasLValue () ? I->getKnownLValue ().getAddress ()
4068
+ I->hasLValue () ? I->getKnownLValue ().getAddress (* this )
4069
4069
: I->getKnownRValue ().getAggregateAddress ());
4070
4070
4071
4071
// Implement swifterror by copying into a new swifterror argument.
@@ -4108,7 +4108,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
4108
4108
Src = CreateMemTemp (I->Ty , " coerce" );
4109
4109
I->copyInto (*this , Src);
4110
4110
} else {
4111
- Src = I->hasLValue () ? I->getKnownLValue ().getAddress ()
4111
+ Src = I->hasLValue () ? I->getKnownLValue ().getAddress (* this )
4112
4112
: I->getKnownRValue ().getAggregateAddress ();
4113
4113
}
4114
4114
@@ -4163,7 +4163,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
4163
4163
Address addr = Address::invalid ();
4164
4164
Address AllocaAddr = Address::invalid ();
4165
4165
if (I->isAggregate ()) {
4166
- addr = I->hasLValue () ? I->getKnownLValue ().getAddress ()
4166
+ addr = I->hasLValue () ? I->getKnownLValue ().getAddress (* this )
4167
4167
: I->getKnownRValue ().getAggregateAddress ();
4168
4168
4169
4169
} else {
0 commit comments