Skip to content

Commit bdfa942

Browse files
committedOct 14, 2024
[CIR][CodeGen][NFC] Add TBAAAccessInfo stubbed out and many usages of it (#859)

9 files changed

+283
-197
lines changed
 

‎clang/lib/CIR/CodeGen/CIRGenAtomic.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@
1717
#include "CIRGenOpenMPRuntime.h"
1818
#include "TargetInfo.h"
1919
#include "clang/AST/ASTContext.h"
20-
#include "clang/AST/StmtVisitor.h"
2120
#include "clang/CIR/Dialect/IR/CIRAttrs.h"
2221
#include "clang/CIR/Dialect/IR/CIRDataLayout.h"
2322
#include "clang/CIR/Dialect/IR/CIRDialect.h"
2423
#include "clang/CIR/Dialect/IR/CIROpsEnums.h"
2524
#include "clang/CIR/Dialect/IR/CIRTypes.h"
2625
#include "clang/CIR/MissingFeatures.h"
27-
#include "clang/CodeGen/CGFunctionInfo.h"
2826
#include "clang/Frontend/FrontendDiagnostic.h"
2927
#include "llvm/Support/ErrorHandling.h"
3028
#include <cstdint>
@@ -179,7 +177,7 @@ class AtomicInfo {
179177
llvm_unreachable("NYI");
180178

181179
return LValue::makeAddr(addr, getValueType(), CGF.getContext(),
182-
LVal.getBaseInfo());
180+
LVal.getBaseInfo(), LVal.getTBAAInfo());
183181
}
184182

185183
/// Emits atomic load.

‎clang/lib/CIR/CodeGen/CIRGenExpr.cpp

+136-123
Large diffs are not rendered by default.

‎clang/lib/CIR/CodeGen/CIRGenExprCXX.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ CIRGenFunction::buildCXXMemberPointerCallExpr(const CXXMemberCallExpr *E,
119119
// Emit the 'this' pointer.
120120
Address This = Address::invalid();
121121
if (BO->getOpcode() == BO_PtrMemI)
122-
This = buildPointerWithAlignment(BaseExpr, nullptr, KnownNonNull);
122+
This = buildPointerWithAlignment(BaseExpr, nullptr, nullptr, KnownNonNull);
123123
else
124124
This = buildLValue(BaseExpr).getAddress();
125125

‎clang/lib/CIR/CodeGen/CIRGenFunction.cpp

+14-10
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "clang/CIR/Dialect/IR/FPEnv.h"
2626
#include "clang/Frontend/FrontendDiagnostic.h"
2727

28+
#include "CIRGenTBAA.h"
2829
#include "mlir/Dialect/Func/IR/FuncOps.h"
2930
#include "mlir/Support/LogicalResult.h"
3031

@@ -890,22 +891,25 @@ void CIRGenFunction::buildConstructorBody(FunctionArgList &Args) {
890891

891892
/// Given a value of type T* that may not be to a complete object, construct
892893
/// an l-vlaue withi the natural pointee alignment of T.
893-
LValue CIRGenFunction::MakeNaturalAlignPointeeAddrLValue(mlir::Value V,
894-
QualType T) {
894+
LValue CIRGenFunction::MakeNaturalAlignPointeeAddrLValue(mlir::Value val,
895+
QualType ty) {
895896
// FIXME(cir): is it safe to assume Op->getResult(0) is valid? Perhaps
896897
// assert on the result type first.
897-
LValueBaseInfo BaseInfo;
898-
CharUnits Align = CGM.getNaturalTypeAlignment(T, &BaseInfo,
898+
LValueBaseInfo baseInfo;
899+
TBAAAccessInfo tbaaInfo;
900+
CharUnits align = CGM.getNaturalTypeAlignment(ty, &baseInfo, &tbaaInfo,
899901
/* for PointeeType= */ true);
900-
return makeAddrLValue(Address(V, Align), T, BaseInfo);
902+
return makeAddrLValue(Address(val, align), ty, baseInfo);
901903
}
902904

903-
LValue CIRGenFunction::MakeNaturalAlignAddrLValue(mlir::Value V, QualType T) {
904-
LValueBaseInfo BaseInfo;
905+
LValue CIRGenFunction::MakeNaturalAlignAddrLValue(mlir::Value val,
906+
QualType ty) {
907+
LValueBaseInfo baseInfo;
908+
TBAAAccessInfo tbaaInfo;
905909
assert(!MissingFeatures::tbaa());
906-
CharUnits Alignment = CGM.getNaturalTypeAlignment(T, &BaseInfo);
907-
Address Addr(V, getTypes().convertTypeForMem(T), Alignment);
908-
return LValue::makeAddr(Addr, T, getContext(), BaseInfo);
910+
CharUnits alignment = CGM.getNaturalTypeAlignment(ty, &baseInfo, &tbaaInfo);
911+
Address addr(val, getTypes().convertTypeForMem(ty), alignment);
912+
return LValue::makeAddr(addr, ty, getContext(), baseInfo, tbaaInfo);
909913
}
910914

911915
// Map the LangOption for exception behavior into the corresponding enum in

‎clang/lib/CIR/CodeGen/CIRGenFunction.h

+49-31
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "CIRGenBuilder.h"
1717
#include "CIRGenCall.h"
1818
#include "CIRGenModule.h"
19+
#include "CIRGenTBAA.h"
1920
#include "CIRGenTypeCache.h"
2021
#include "CIRGenValue.h"
2122
#include "EHScopeStack.h"
@@ -816,12 +817,15 @@ class CIRGenFunction : public CIRGenTypeCache {
816817
/// the address of the lvalue, then loads the result as an rvalue,
817818
/// returning the rvalue.
818819
RValue buildLoadOfLValue(LValue LV, SourceLocation Loc);
819-
mlir::Value buildLoadOfScalar(Address Addr, bool Volatile, clang::QualType Ty,
820-
clang::SourceLocation Loc,
821-
LValueBaseInfo BaseInfo,
820+
mlir::Value buildLoadOfScalar(Address addr, bool isVolatile,
821+
clang::QualType ty, clang::SourceLocation loc,
822+
LValueBaseInfo baseInfo,
823+
TBAAAccessInfo tbaaInfo,
822824
bool isNontemporal = false);
823-
mlir::Value buildLoadOfScalar(Address Addr, bool Volatile, clang::QualType Ty,
824-
mlir::Location Loc, LValueBaseInfo BaseInfo,
825+
mlir::Value buildLoadOfScalar(Address addr, bool isVolatile,
826+
clang::QualType ty, mlir::Location loc,
827+
LValueBaseInfo baseInfo,
828+
TBAAAccessInfo tbaaInfo,
825829
bool isNontemporal = false);
826830

827831
int64_t getAccessedFieldNo(unsigned idx, const mlir::ArrayAttr elts);
@@ -834,12 +838,12 @@ class CIRGenFunction : public CIRGenTypeCache {
834838

835839
/// Load a scalar value from an address, taking care to appropriately convert
836840
/// from the memory representation to CIR value representation.
837-
mlir::Value buildLoadOfScalar(Address Addr, bool Volatile, clang::QualType Ty,
838-
clang::SourceLocation Loc,
839-
AlignmentSource Source = AlignmentSource::Type,
841+
mlir::Value buildLoadOfScalar(Address addr, bool isVolatile,
842+
clang::QualType ty, clang::SourceLocation loc,
843+
AlignmentSource source = AlignmentSource::Type,
840844
bool isNontemporal = false) {
841-
return buildLoadOfScalar(Addr, Volatile, Ty, Loc, LValueBaseInfo(Source),
842-
isNontemporal);
845+
return buildLoadOfScalar(addr, isVolatile, ty, loc, LValueBaseInfo(source),
846+
CGM.getTBAAAccessInfo(ty), isNontemporal);
843847
}
844848

845849
/// Load a scalar value from an address, taking care to appropriately convert
@@ -851,8 +855,9 @@ class CIRGenFunction : public CIRGenTypeCache {
851855
/// Load a complex number from the specified l-value.
852856
mlir::Value buildLoadOfComplex(LValue src, SourceLocation loc);
853857

854-
Address buildLoadOfReference(LValue RefLVal, mlir::Location Loc,
855-
LValueBaseInfo *PointeeBaseInfo = nullptr);
858+
Address buildLoadOfReference(LValue refLVal, mlir::Location loc,
859+
LValueBaseInfo *pointeeBaseInfo = nullptr,
860+
TBAAAccessInfo *pointeeTBAAInfo = nullptr);
856861
LValue buildLoadOfReferenceLValue(LValue RefLVal, mlir::Location Loc);
857862
LValue
858863
buildLoadOfReferenceLValue(Address RefAddr, mlir::Location Loc,
@@ -1275,9 +1280,17 @@ class CIRGenFunction : public CIRGenTypeCache {
12751280
clang::QualType::DestructionKind dtorKind);
12761281

12771282
void buildStoreOfScalar(mlir::Value value, LValue lvalue);
1278-
void buildStoreOfScalar(mlir::Value Value, Address Addr, bool Volatile,
1279-
clang::QualType Ty, LValueBaseInfo BaseInfo,
1280-
bool isInit = false, bool isNontemporal = false);
1283+
void buildStoreOfScalar(mlir::Value value, Address addr, bool isVolatile,
1284+
clang::QualType ty, LValueBaseInfo baseInfo,
1285+
TBAAAccessInfo tbaaInfo, bool isInit = false,
1286+
bool isNontemporal = false);
1287+
void buildStoreOfScalar(mlir::Value value, Address addr, bool isVolatile,
1288+
QualType ty,
1289+
AlignmentSource source = AlignmentSource::Type,
1290+
bool isInit = false, bool isNontemporal = false) {
1291+
buildStoreOfScalar(value, addr, isVolatile, ty, LValueBaseInfo(source),
1292+
CGM.getTBAAAccessInfo(ty), isInit, isNontemporal);
1293+
}
12811294
void buildStoreOfScalar(mlir::Value value, LValue lvalue, bool isInit);
12821295

12831296
mlir::Value buildToMemory(mlir::Value Value, clang::QualType Ty);
@@ -1352,9 +1365,10 @@ class CIRGenFunction : public CIRGenTypeCache {
13521365
/// reasonable to just ignore the returned alignment when it isn't from an
13531366
/// explicit source.
13541367
Address
1355-
buildPointerWithAlignment(const clang::Expr *E,
1356-
LValueBaseInfo *BaseInfo = nullptr,
1357-
KnownNonNull_t IsKnownNonNull = NotKnownNonNull);
1368+
buildPointerWithAlignment(const clang::Expr *expr,
1369+
LValueBaseInfo *baseInfo = nullptr,
1370+
TBAAAccessInfo *tbaaInfo = nullptr,
1371+
KnownNonNull_t isKnownNonNull = NotKnownNonNull);
13581372

13591373
LValue
13601374
buildConditionalOperatorLValue(const AbstractConditionalOperator *expr);
@@ -1534,19 +1548,21 @@ class CIRGenFunction : public CIRGenTypeCache {
15341548
};
15351549

15361550
LValue MakeNaturalAlignPointeeAddrLValue(mlir::Value V, clang::QualType T);
1537-
LValue MakeNaturalAlignAddrLValue(mlir::Value V, QualType T);
1551+
LValue MakeNaturalAlignAddrLValue(mlir::Value val, QualType ty);
15381552

15391553
/// Construct an address with the natural alignment of T. If a pointer to T
15401554
/// is expected to be signed, the pointer passed to this function must have
15411555
/// been signed, and the returned Address will have the pointer authentication
15421556
/// information needed to authenticate the signed pointer.
15431557
Address makeNaturalAddressForPointer(
1544-
mlir::Value Ptr, QualType T, CharUnits Alignment = CharUnits::Zero(),
1545-
bool ForPointeeType = false, LValueBaseInfo *BaseInfo = nullptr,
1546-
KnownNonNull_t IsKnownNonNull = NotKnownNonNull) {
1547-
if (Alignment.isZero())
1548-
Alignment = CGM.getNaturalTypeAlignment(T, BaseInfo, ForPointeeType);
1549-
return Address(Ptr, convertTypeForMem(T), Alignment, IsKnownNonNull);
1558+
mlir::Value ptr, QualType t, CharUnits alignment = CharUnits::Zero(),
1559+
bool forPointeeType = false, LValueBaseInfo *baseInfo = nullptr,
1560+
TBAAAccessInfo *tbaaInfo = nullptr,
1561+
KnownNonNull_t isKnownNonNull = NotKnownNonNull) {
1562+
if (alignment.isZero())
1563+
alignment =
1564+
CGM.getNaturalTypeAlignment(t, baseInfo, tbaaInfo, forPointeeType);
1565+
return Address(ptr, convertTypeForMem(t), alignment, isKnownNonNull);
15501566
}
15511567

15521568
/// Load the value for 'this'. This function is only valid while generating
@@ -1590,14 +1606,16 @@ class CIRGenFunction : public CIRGenTypeCache {
15901606
QualType DstTy,
15911607
SourceLocation Loc);
15921608

1593-
LValue makeAddrLValue(Address Addr, clang::QualType T,
1594-
LValueBaseInfo BaseInfo) {
1595-
return LValue::makeAddr(Addr, T, getContext(), BaseInfo);
1609+
LValue makeAddrLValue(Address addr, clang::QualType ty,
1610+
LValueBaseInfo baseInfo) {
1611+
return LValue::makeAddr(addr, ty, getContext(), baseInfo,
1612+
CGM.getTBAAAccessInfo(ty));
15961613
}
15971614

1598-
LValue makeAddrLValue(Address Addr, clang::QualType T,
1599-
AlignmentSource Source = AlignmentSource::Type) {
1600-
return LValue::makeAddr(Addr, T, getContext(), LValueBaseInfo(Source));
1615+
LValue makeAddrLValue(Address addr, clang::QualType ty,
1616+
AlignmentSource source = AlignmentSource::Type) {
1617+
return LValue::makeAddr(addr, ty, getContext(), LValueBaseInfo(source),
1618+
CGM.getTBAAAccessInfo(ty));
16011619
}
16021620

16031621
void initializeVTablePointers(mlir::Location loc,

‎clang/lib/CIR/CodeGen/CIRGenModule.cpp

+11-5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "CIRGenCstEmitter.h"
1717
#include "CIRGenFunction.h"
1818
#include "CIRGenOpenMPRuntime.h"
19+
#include "CIRGenTBAA.h"
1920
#include "CIRGenTypes.h"
2021
#include "CIRGenValue.h"
2122
#include "TargetInfo.h"
@@ -244,11 +245,9 @@ CharUnits CIRGenModule::getClassPointerAlignment(const CXXRecordDecl *RD) {
244245

245246
/// FIXME: this could likely be a common helper and not necessarily related
246247
/// with codegen.
247-
/// TODO: Add TBAAAccessInfo
248-
CharUnits
249-
CIRGenModule::getNaturalPointeeTypeAlignment(QualType T,
250-
LValueBaseInfo *BaseInfo) {
251-
return getNaturalTypeAlignment(T->getPointeeType(), BaseInfo,
248+
CharUnits CIRGenModule::getNaturalPointeeTypeAlignment(
249+
QualType ty, LValueBaseInfo *baseInfo, TBAAAccessInfo *tbaaInfo) {
250+
return getNaturalTypeAlignment(ty->getPointeeType(), baseInfo, tbaaInfo,
252251
/* forPointeeType= */ true);
253252
}
254253

@@ -257,6 +256,7 @@ CIRGenModule::getNaturalPointeeTypeAlignment(QualType T,
257256
/// TODO: Add TBAAAccessInfo
258257
CharUnits CIRGenModule::getNaturalTypeAlignment(QualType T,
259258
LValueBaseInfo *BaseInfo,
259+
TBAAAccessInfo *tbaaInfo,
260260
bool forPointeeType) {
261261
// FIXME: This duplicates logic in ASTContext::getTypeAlignIfKnown. But
262262
// that doesn't return the information we need to compute BaseInfo.
@@ -3378,3 +3378,9 @@ void CIRGenModule::buildGlobalAnnotations() {
33783378
}
33793379
deferredAnnotations.clear();
33803380
}
3381+
3382+
TBAAAccessInfo CIRGenModule::getTBAAAccessInfo(QualType accessType) {
3383+
if (!tbaa)
3384+
return TBAAAccessInfo();
3385+
llvm_unreachable("NYI");
3386+
}

‎clang/lib/CIR/CodeGen/CIRGenModule.h

+12-4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "CIRGenBuilder.h"
1818
#include "CIRGenCall.h"
1919
#include "CIRGenOpenCLRuntime.h"
20+
#include "CIRGenTBAA.h"
2021
#include "CIRGenTypeCache.h"
2122
#include "CIRGenTypes.h"
2223
#include "CIRGenVTables.h"
@@ -95,6 +96,8 @@ class CIRGenModule : public CIRGenTypeCache {
9596

9697
std::unique_ptr<CIRGenCXXABI> ABI;
9798

99+
std::unique_ptr<CIRGenTBAA> tbaa;
100+
98101
/// Used for `UniqueInternalLinkageNames` option
99102
std::string ModuleNameHash = "";
100103

@@ -442,15 +445,16 @@ class CIRGenModule : public CIRGenTypeCache {
442445

443446
/// FIXME: this could likely be a common helper and not necessarily related
444447
/// with codegen.
445-
/// TODO: Add TBAAAccessInfo
446-
clang::CharUnits getNaturalPointeeTypeAlignment(clang::QualType T,
447-
LValueBaseInfo *BaseInfo);
448+
clang::CharUnits
449+
getNaturalPointeeTypeAlignment(clang::QualType ty,
450+
LValueBaseInfo *baseInfo = nullptr,
451+
TBAAAccessInfo *tbaaInfo = nullptr);
448452

449453
/// FIXME: this could likely be a common helper and not necessarily related
450454
/// with codegen.
451-
/// TODO: Add TBAAAccessInfo
452455
clang::CharUnits getNaturalTypeAlignment(clang::QualType T,
453456
LValueBaseInfo *BaseInfo = nullptr,
457+
TBAAAccessInfo *tbaaInfo = nullptr,
454458
bool forPointeeType = false);
455459

456460
/// TODO: Add TBAAAccessInfo
@@ -482,6 +486,10 @@ class CIRGenModule : public CIRGenTypeCache {
482486
return VTables.getItaniumVTableContext();
483487
}
484488

489+
/// getTBAAAccessInfo - Gte TBAA information that describes an access to an
490+
/// object of the given type.
491+
TBAAAccessInfo getTBAAAccessInfo(QualType accessType);
492+
485493
/// This contains all the decls which have definitions but which are deferred
486494
/// for emission and therefore should only be output if they are actually
487495
/// used. If a decl is in this, then it is known to have not been referenced

‎clang/lib/CIR/CodeGen/CIRGenTBAA.h

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//===--- CIRGenTBAA.h - TBAA information for LLVM CIRGen --------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
//
9+
// This is the code that manages TBAA information and defines the TBAA policy
10+
// for the optimizer to use.
11+
//
12+
//===----------------------------------------------------------------------===//
13+
14+
#ifndef LLVM_CLANG_LIB_CIR_CODEGEN_CIRGENTBAA_H
15+
#define LLVM_CLANG_LIB_CIR_CODEGEN_CIRGENTBAA_H
16+
17+
namespace cir {
18+
19+
// TBAAAccessInfo - Describes a memory access in terms of TBAA.
20+
struct TBAAAccessInfo {};
21+
22+
/// CIRGenTBAA - This class organizes the cross-module state that is used while
23+
/// lowering AST types to LLVM types.
24+
class CIRGenTBAA {};
25+
26+
} // namespace cir
27+
28+
#endif

‎clang/lib/CIR/CodeGen/CIRGenValue.h

+31-20
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include "Address.h"
1818
#include "CIRGenRecordLayout.h"
19+
#include "CIRGenTBAA.h"
1920

2021
#include "clang/AST/ASTContext.h"
2122
#include "clang/AST/CharUnits.h"
@@ -175,9 +176,12 @@ class LValue {
175176
// this lvalue.
176177
bool Nontemporal : 1;
177178

179+
TBAAAccessInfo tbaaInfo;
180+
178181
private:
179182
void Initialize(clang::QualType Type, clang::Qualifiers Quals,
180-
clang::CharUnits Alignment, LValueBaseInfo BaseInfo) {
183+
clang::CharUnits Alignment, LValueBaseInfo BaseInfo,
184+
TBAAAccessInfo tbaaInfo) {
181185
assert((!Alignment.isZero() || Type->isIncompleteType()) &&
182186
"initializing l-value with zero alignment!");
183187
if (isGlobalReg())
@@ -194,6 +198,7 @@ class LValue {
194198
assert(this->Alignment == Alignment.getQuantity() &&
195199
"Alignment exceeds allowed max!");
196200
this->BaseInfo = BaseInfo;
201+
this->tbaaInfo = tbaaInfo;
197202

198203
// TODO: ObjC flags
199204
// Initialize Objective-C flags.
@@ -270,7 +275,7 @@ class LValue {
270275
R.V = address.getPointer();
271276
R.ElementType = address.getElementType();
272277
R.Initialize(T, T.getQualifiers(), address.getAlignment(),
273-
LValueBaseInfo(Source));
278+
LValueBaseInfo(Source), TBAAAccessInfo());
274279
return R;
275280
}
276281

@@ -281,25 +286,28 @@ class LValue {
281286
R.LVType = Simple;
282287
R.V = address.getPointer();
283288
R.ElementType = address.getElementType();
284-
R.Initialize(T, T.getQualifiers(), address.getAlignment(), LBI);
289+
R.Initialize(T, T.getQualifiers(), address.getAlignment(), LBI,
290+
TBAAAccessInfo());
285291
return R;
286292
}
287293

288294
static LValue makeAddr(Address address, clang::QualType type,
289-
clang::ASTContext &Context, LValueBaseInfo BaseInfo) {
295+
clang::ASTContext &context, LValueBaseInfo baseInfo,
296+
TBAAAccessInfo tbaaInfo) {
290297
clang::Qualifiers qs = type.getQualifiers();
291-
qs.setObjCGCAttr(Context.getObjCGCAttrKind(type));
298+
qs.setObjCGCAttr(context.getObjCGCAttrKind(type));
292299

293300
LValue R;
294301
R.LVType = Simple;
295302
assert(mlir::cast<mlir::cir::PointerType>(address.getPointer().getType()));
296303
R.V = address.getPointer();
297304
R.ElementType = address.getElementType();
298-
R.Initialize(type, qs, address.getAlignment(),
299-
BaseInfo); // TODO: TBAAInfo);
305+
R.Initialize(type, qs, address.getAlignment(), baseInfo, tbaaInfo);
300306
return R;
301307
}
302308

309+
TBAAAccessInfo getTBAAInfo() const { return tbaaInfo; }
310+
303311
const clang::Qualifiers &getQuals() const { return Quals; }
304312
clang::Qualifiers &getQuals() { return Quals; }
305313

@@ -330,28 +338,29 @@ class LValue {
330338
return mlir::cast<mlir::ArrayAttr>(VectorElts);
331339
}
332340

333-
static LValue MakeVectorElt(Address vecAddress, mlir::Value Index,
334-
clang::QualType type, LValueBaseInfo BaseInfo) {
341+
static LValue MakeVectorElt(Address vecAddress, mlir::Value index,
342+
clang::QualType type, LValueBaseInfo baseInfo,
343+
TBAAAccessInfo tbaaInfo) {
335344
LValue R;
336345
R.LVType = VectorElt;
337346
R.V = vecAddress.getPointer();
338347
R.ElementType = vecAddress.getElementType();
339-
R.VectorIdx = Index;
348+
R.VectorIdx = index;
340349
R.Initialize(type, type.getQualifiers(), vecAddress.getAlignment(),
341-
BaseInfo);
350+
baseInfo, tbaaInfo);
342351
return R;
343352
}
344353

345354
static LValue MakeExtVectorElt(Address vecAddress, mlir::ArrayAttr elts,
346-
clang::QualType type,
347-
LValueBaseInfo baseInfo) {
355+
clang::QualType type, LValueBaseInfo baseInfo,
356+
TBAAAccessInfo tbaaInfo) {
348357
LValue R;
349358
R.LVType = ExtVectorElt;
350359
R.V = vecAddress.getPointer();
351360
R.ElementType = vecAddress.getElementType();
352361
R.VectorElts = elts;
353362
R.Initialize(type, type.getQualifiers(), vecAddress.getAlignment(),
354-
baseInfo);
363+
baseInfo, tbaaInfo);
355364
return R;
356365
}
357366

@@ -376,14 +385,16 @@ class LValue {
376385
/// bit-field refers to.
377386
/// \param Info - The information describing how to perform the bit-field
378387
/// access.
379-
static LValue MakeBitfield(Address Addr, const CIRGenBitFieldInfo &Info,
380-
clang::QualType type, LValueBaseInfo BaseInfo) {
388+
static LValue MakeBitfield(Address addr, const CIRGenBitFieldInfo &info,
389+
clang::QualType type, LValueBaseInfo baseInfo,
390+
TBAAAccessInfo tbaaInfo) {
381391
LValue R;
382392
R.LVType = BitField;
383-
R.V = Addr.getPointer();
384-
R.ElementType = Addr.getElementType();
385-
R.BitFieldInfo = &Info;
386-
R.Initialize(type, type.getQualifiers(), Addr.getAlignment(), BaseInfo);
393+
R.V = addr.getPointer();
394+
R.ElementType = addr.getElementType();
395+
R.BitFieldInfo = &info;
396+
R.Initialize(type, type.getQualifiers(), addr.getAlignment(), baseInfo,
397+
tbaaInfo);
387398
return R;
388399
}
389400
};

0 commit comments

Comments
 (0)
Please sign in to comment.