|
@@ -2151,12 +2151,10 @@ Address CodeGenFunction::EmitLoadOfReference(Address Addr,
|
|
const ReferenceType *RefTy,
|
|
const ReferenceType *RefTy,
|
|
LValueBaseInfo *BaseInfo,
|
|
LValueBaseInfo *BaseInfo,
|
|
TBAAAccessInfo *TBAAInfo) {
|
|
TBAAAccessInfo *TBAAInfo) {
|
|
- if (TBAAInfo)
|
|
|
|
- *TBAAInfo = CGM.getTBAAAccessInfo(RefTy->getPointeeType());
|
|
|
|
-
|
|
|
|
llvm::Value *Ptr = Builder.CreateLoad(Addr);
|
|
llvm::Value *Ptr = Builder.CreateLoad(Addr);
|
|
return Address(Ptr, getNaturalTypeAlignment(RefTy->getPointeeType(),
|
|
return Address(Ptr, getNaturalTypeAlignment(RefTy->getPointeeType(),
|
|
- BaseInfo, /*forPointee*/ true));
|
|
|
|
|
|
+ BaseInfo, TBAAInfo,
|
|
|
|
+ /* forPointeeType= */ true));
|
|
}
|
|
}
|
|
|
|
|
|
LValue CodeGenFunction::EmitLoadOfReferenceLValue(Address RefAddr,
|
|
LValue CodeGenFunction::EmitLoadOfReferenceLValue(Address RefAddr,
|
|
@@ -2171,12 +2169,9 @@ Address CodeGenFunction::EmitLoadOfPointer(Address Ptr,
|
|
const PointerType *PtrTy,
|
|
const PointerType *PtrTy,
|
|
LValueBaseInfo *BaseInfo,
|
|
LValueBaseInfo *BaseInfo,
|
|
TBAAAccessInfo *TBAAInfo) {
|
|
TBAAAccessInfo *TBAAInfo) {
|
|
- if (TBAAInfo)
|
|
|
|
- *TBAAInfo = CGM.getTBAAAccessInfo(PtrTy->getPointeeType());
|
|
|
|
-
|
|
|
|
llvm::Value *Addr = Builder.CreateLoad(Ptr);
|
|
llvm::Value *Addr = Builder.CreateLoad(Ptr);
|
|
return Address(Addr, getNaturalTypeAlignment(PtrTy->getPointeeType(),
|
|
return Address(Addr, getNaturalTypeAlignment(PtrTy->getPointeeType(),
|
|
- BaseInfo,
|
|
|
|
|
|
+ BaseInfo, TBAAInfo,
|
|
/*forPointeeType=*/true));
|
|
/*forPointeeType=*/true));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2315,8 +2310,10 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) {
|
|
// FIXME: Eventually we will want to emit vector element references.
|
|
// FIXME: Eventually we will want to emit vector element references.
|
|
|
|
|
|
// Should we be using the alignment of the constant pointer we emitted?
|
|
// Should we be using the alignment of the constant pointer we emitted?
|
|
- CharUnits Alignment = getNaturalTypeAlignment(E->getType(), nullptr,
|
|
|
|
- /*pointee*/ true);
|
|
|
|
|
|
+ CharUnits Alignment = getNaturalTypeAlignment(E->getType(),
|
|
|
|
+ /* BaseInfo= */ nullptr,
|
|
|
|
+ /* TBAAInfo= */ nullptr,
|
|
|
|
+ /* forPointeeType= */ true);
|
|
return MakeAddrLValue(Address(Val, Alignment), T, AlignmentSource::Decl);
|
|
return MakeAddrLValue(Address(Val, Alignment), T, AlignmentSource::Decl);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -3729,7 +3726,8 @@ LValue CodeGenFunction::EmitLValueForField(LValue base,
|
|
type = refType->getPointeeType();
|
|
type = refType->getPointeeType();
|
|
|
|
|
|
CharUnits alignment =
|
|
CharUnits alignment =
|
|
- getNaturalTypeAlignment(type, &FieldBaseInfo, /*pointee*/ true);
|
|
|
|
|
|
+ getNaturalTypeAlignment(type, &FieldBaseInfo, /* TBAAInfo= */ nullptr,
|
|
|
|
+ /* forPointeeType= */ true);
|
|
FieldBaseInfo.setMayAlias(false);
|
|
FieldBaseInfo.setMayAlias(false);
|
|
addr = Address(load, alignment);
|
|
addr = Address(load, alignment);
|
|
|
|
|