Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CIR][CIRGen] Pass field index to cir.struct_element_addr #148

Merged
merged 1 commit into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion clang/include/clang/CIR/Dialect/IR/CIROps.td
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,9 @@ def StructElementAddr : CIR_Op<"struct_element_addr"> {
The `cir.struct_element_addr` operaration gets the address of a particular
named member from the input struct.

It expects a pointer to the base struct as well as the name of the member
and its field index.

Example:
```mlir
!ty_22struct2EBar22 = type !cir.struct<"struct.Bar", i32, i8>
Expand All @@ -1391,10 +1394,25 @@ def StructElementAddr : CIR_Op<"struct_element_addr"> {

let arguments = (ins
Arg<CIR_PointerType, "the address to load from", [MemRead]>:$struct_addr,
StrAttr:$member_name);
StrAttr:$member_name,
IndexAttr:$member_index);

let results = (outs Res<CIR_PointerType, "">:$result);

let builders = [
OpBuilder<(ins "Type":$type, "Value":$value, "llvm::StringRef":$name,
"unsigned":$index),
[{
mlir::APInt fieldIdx(64, index);
build($_builder, $_state, type, value, name, fieldIdx);
}]>
];

let extraClassDeclaration = [{
/// Return the index of the struct member being accessed.
uint64_t getIndex() { return getMemberIndex().getZExtValue(); }
}];

// FIXME: add verifier.
}

Expand Down
3 changes: 2 additions & 1 deletion clang/lib/CIR/CodeGen/CIRGenClass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ static void buildLValueForAnyFieldInitialization(CIRGenFunction &CGF,
if (MemberInit->isIndirectMemberInitializer()) {
llvm_unreachable("NYI");
} else {
LHS = CGF.buildLValueForFieldInitialization(LHS, Field, Field->getName());
LHS = CGF.buildLValueForFieldInitialization(LHS, Field, Field->getName(),
Field->getFieldIndex());
}
}

Expand Down
15 changes: 9 additions & 6 deletions clang/lib/CIR/CodeGen/CIRGenExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ static Address buildPreserveStructAccess(CIRGenFunction &CGF, LValue base,
/// doesn't necessarily have the right type.
static Address buildAddrOfFieldStorage(CIRGenFunction &CGF, Address Base,
const FieldDecl *field,
llvm::StringRef fieldName) {
llvm::StringRef fieldName,
unsigned fieldIndex) {
if (field->isZeroSize(CGF.getContext()))
llvm_unreachable("NYI");

Expand All @@ -63,7 +64,7 @@ static Address buildAddrOfFieldStorage(CIRGenFunction &CGF, Address Base,
// which do not currently carry the name, so it can be passed down from the
// CaptureStmt.
auto sea = CGF.getBuilder().create<mlir::cir::StructElementAddr>(
loc, fieldPtr, Base.getPointer(), fieldName);
loc, fieldPtr, Base.getPointer(), fieldName, fieldIndex);

// TODO: We could get the alignment from the CIRGenRecordLayout, but given the
// member name based lookup of the member here we probably shouldn't be. We'll
Expand Down Expand Up @@ -235,9 +236,10 @@ LValue CIRGenFunction::buildLValueForField(LValue base,
if (!IsInPreservedAIRegion &&
(!getDebugInfo() || !rec->hasAttr<BPFPreserveAccessIndexAttr>())) {
llvm::StringRef fieldName = field->getName();
unsigned fieldIndex = field->getFieldIndex();
if (CGM.LambdaFieldToName.count(field))
fieldName = CGM.LambdaFieldToName[field];
addr = buildAddrOfFieldStorage(*this, addr, field, fieldName);
addr = buildAddrOfFieldStorage(*this, addr, field, fieldName, fieldIndex);
} else
// Remember the original struct field index
addr = buildPreserveStructAccess(*this, base, addr, field);
Expand Down Expand Up @@ -281,14 +283,15 @@ LValue CIRGenFunction::buildLValueForField(LValue base,
}

LValue CIRGenFunction::buildLValueForFieldInitialization(
LValue Base, const clang::FieldDecl *Field, llvm::StringRef FieldName) {
LValue Base, const clang::FieldDecl *Field, llvm::StringRef FieldName,
unsigned FieldIndex) {
QualType FieldType = Field->getType();

if (!FieldType->isReferenceType())
return buildLValueForField(Base, Field);

Address V =
buildAddrOfFieldStorage(*this, Base.getAddress(), Field, FieldName);
Address V = buildAddrOfFieldStorage(*this, Base.getAddress(), Field,
FieldName, FieldIndex);

// Make sure that the address is pointing to the right type.
auto memTy = getTypes().convertTypeForMem(FieldType);
Expand Down
8 changes: 4 additions & 4 deletions clang/lib/CIR/CodeGen/CIRGenExprAgg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,8 @@ void AggExprEmitter::VisitLambdaExpr(LambdaExpr *E) {
}

// Emit initialization
LValue LV =
CGF.buildLValueForFieldInitialization(SlotLV, *CurField, fieldName);
LValue LV = CGF.buildLValueForFieldInitialization(
SlotLV, *CurField, fieldName, CurField->getFieldIndex());
if (CurField->hasCapturedVLAType()) {
llvm_unreachable("NYI");
}
Expand Down Expand Up @@ -701,8 +701,8 @@ void AggExprEmitter::VisitCXXParenListOrInitListExpr(
CGF.getTypes().isZeroInitializable(ExprToVisit->getType()))
break;

LValue LV =
CGF.buildLValueForFieldInitialization(DestLV, field, field->getName());
LValue LV = CGF.buildLValueForFieldInitialization(
DestLV, field, field->getName(), field->getFieldIndex());
// We never generate write-barries for initialized fields.
assert(!UnimplementedFeature::setNonGC());

Expand Down
5 changes: 3 additions & 2 deletions clang/lib/CIR/CodeGen/CIRGenFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class CallOp;
namespace {
class ScalarExprEmitter;
class AggExprEmitter;
}
} // namespace

namespace cir {

Expand Down Expand Up @@ -1448,7 +1448,8 @@ class CIRGenFunction : public CIRGenTypeCache {
/// stored in the reference.
LValue buildLValueForFieldInitialization(LValue Base,
const clang::FieldDecl *Field,
llvm::StringRef FieldName);
llvm::StringRef FieldName,
unsigned FieldIndex);

void buildInitializerForField(clang::FieldDecl *Field, LValue LHS,
clang::Expr *Init);
Expand Down
10 changes: 5 additions & 5 deletions clang/test/CIR/CodeGen/String.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ void test() {
// CHECK-NEXT: %0 = cir.alloca !cir.ptr<!ty_22class2EString22>
// CHECK-NEXT: cir.store %arg0, %0
// CHECK-NEXT: %1 = cir.load %0
// CHECK-NEXT: %2 = "cir.struct_element_addr"(%1) {member_name = "storage"}
// CHECK-NEXT: %2 = "cir.struct_element_addr"(%1) {member_index = 0 : index, member_name = "storage"}
// CHECK-NEXT: %3 = cir.const(#cir.null : !cir.ptr<!s8i>) : !cir.ptr<!s8i>
// CHECK-NEXT: cir.store %3, %2 : !cir.ptr<!s8i>, cir.ptr <!cir.ptr<!s8i>>
// CHECK-NEXT: %4 = "cir.struct_element_addr"(%1) {member_name = "size"} : (!cir.ptr<!ty_22class2EString22>) -> !cir.ptr<!s64i>
// CHECK-NEXT: %4 = "cir.struct_element_addr"(%1) {member_index = 1 : index, member_name = "size"} : (!cir.ptr<!ty_22class2EString22>) -> !cir.ptr<!s64i>
// CHECK-NEXT: %5 = cir.const(#cir.int<0> : !s32i) : !s32i
// CHECK-NEXT: %6 = cir.cast(integral, %5 : !s32i), !s64i
// CHECK-NEXT: cir.store %6, %4 : !s64i, cir.ptr <!s64i>
Expand All @@ -36,10 +36,10 @@ void test() {
// CHECK-NEXT: cir.store %arg0, %0
// CHECK-NEXT: cir.store %arg1, %1
// CHECK-NEXT: %2 = cir.load %0
// CHECK-NEXT: %3 = "cir.struct_element_addr"(%2) {member_name = "storage"}
// CHECK-NEXT: %3 = "cir.struct_element_addr"(%2) {member_index = 0 : index, member_name = "storage"}
// CHECK-NEXT: %4 = cir.const(#cir.null : !cir.ptr<!s8i>)
// CHECK-NEXT: cir.store %4, %3
// CHECK-NEXT: %5 = "cir.struct_element_addr"(%2) {member_name = "size"} : (!cir.ptr<!ty_22class2EString22>) -> !cir.ptr<!s64i>
// CHECK-NEXT: %5 = "cir.struct_element_addr"(%2) {member_index = 1 : index, member_name = "size"} : (!cir.ptr<!ty_22class2EString22>) -> !cir.ptr<!s64i>
// CHECK-NEXT: %6 = cir.load %1 : cir.ptr <!s32i>, !s32i
// CHECK-NEXT: %7 = cir.cast(integral, %6 : !s32i), !s64i
// CHECK-NEXT: cir.store %7, %5 : !s64i, cir.ptr <!s64i>
Expand All @@ -52,7 +52,7 @@ void test() {
// CHECK-NEXT: cir.store %arg0, %0 : !cir.ptr<!ty_22class2EString22>, cir.ptr <!cir.ptr<!ty_22class2EString22>>
// CHECK-NEXT: cir.store %arg1, %1 : !cir.ptr<!s8i>, cir.ptr <!cir.ptr<!s8i>>
// CHECK-NEXT: %2 = cir.load %0 : cir.ptr <!cir.ptr<!ty_22class2EString22>>, !cir.ptr<!ty_22class2EString22>
// CHECK-NEXT: %3 = "cir.struct_element_addr"(%2) {member_name = "storage"} : (!cir.ptr<!ty_22class2EString22>) -> !cir.ptr<!cir.ptr<!s8i>>
// CHECK-NEXT: %3 = "cir.struct_element_addr"(%2) {member_index = 0 : index, member_name = "storage"} : (!cir.ptr<!ty_22class2EString22>) -> !cir.ptr<!cir.ptr<!s8i>>
// CHECK-NEXT: %4 = cir.const(#cir.null : !cir.ptr<!s8i>) : !cir.ptr<!s8i>
// CHECK-NEXT: cir.store %4, %3 : !cir.ptr<!s8i>, cir.ptr <!cir.ptr<!s8i>>
// CHECK-NEXT: cir.return
Expand Down
10 changes: 5 additions & 5 deletions clang/test/CIR/CodeGen/agg-init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ void use() { yop{}; }

// CHECK: cir.func @_Z3usev() {
// CHECK: %0 = cir.alloca !ty_22struct2Eyep_22, cir.ptr <!ty_22struct2Eyep_22>, ["agg.tmp0"] {alignment = 4 : i64}
// CHECK: %1 = "cir.struct_element_addr"(%0) {member_name = "Status"} : (!cir.ptr<!ty_22struct2Eyep_22>) -> !cir.ptr<!u32i>
// CHECK: %1 = "cir.struct_element_addr"(%0) {member_index = 0 : index, member_name = "Status"} : (!cir.ptr<!ty_22struct2Eyep_22>) -> !cir.ptr<!u32i>
// CHECK: %2 = cir.const(#cir.int<0> : !u32i) : !u32i
// CHECK: cir.store %2, %1 : !u32i, cir.ptr <!u32i>
// CHECK: %3 = "cir.struct_element_addr"(%0) {member_name = "HC"} : (!cir.ptr<!ty_22struct2Eyep_22>) -> !cir.ptr<!u32i>
// CHECK: %3 = "cir.struct_element_addr"(%0) {member_index = 1 : index, member_name = "HC"} : (!cir.ptr<!ty_22struct2Eyep_22>) -> !cir.ptr<!u32i>
// CHECK: %4 = cir.const(#cir.int<0> : !u32i) : !u32i
// CHECK: cir.store %4, %3 : !u32i, cir.ptr <!u32i>
// CHECK: cir.return
Expand Down Expand Up @@ -68,12 +68,12 @@ void yo() {
// CHECK: %1 = cir.alloca !ty_22struct2EYo22, cir.ptr <!ty_22struct2EYo22>, ["ext2", init] {alignment = 8 : i64}
// CHECK: %2 = cir.const(#cir.const_struct<{#cir.int<1000070000> : !u32i,#cir.null : !cir.ptr<!void>,#cir.int<0> : !u64i}> : !ty_22struct2EYo22) : !ty_22struct2EYo22
// CHECK: cir.store %2, %0 : !ty_22struct2EYo22, cir.ptr <!ty_22struct2EYo22>
// CHECK: %3 = "cir.struct_element_addr"(%1) {member_name = "type"} : (!cir.ptr<!ty_22struct2EYo22>) -> !cir.ptr<!u32i>
// CHECK: %3 = "cir.struct_element_addr"(%1) {member_index = 0 : index, member_name = "type"} : (!cir.ptr<!ty_22struct2EYo22>) -> !cir.ptr<!u32i>
// CHECK: %4 = cir.const(#cir.int<1000066001> : !u32i) : !u32i
// CHECK: cir.store %4, %3 : !u32i, cir.ptr <!u32i>
// CHECK: %5 = "cir.struct_element_addr"(%1) {member_name = "next"} : (!cir.ptr<!ty_22struct2EYo22>) -> !cir.ptr<!cir.ptr<!void>>
// CHECK: %5 = "cir.struct_element_addr"(%1) {member_index = 1 : index, member_name = "next"} : (!cir.ptr<!ty_22struct2EYo22>) -> !cir.ptr<!cir.ptr<!void>>
// CHECK: %6 = cir.cast(bitcast, %0 : !cir.ptr<!ty_22struct2EYo22>), !cir.ptr<!void>
// CHECK: cir.store %6, %5 : !cir.ptr<!void>, cir.ptr <!cir.ptr<!void>>
// CHECK: %7 = "cir.struct_element_addr"(%1) {member_name = "createFlags"} : (!cir.ptr<!ty_22struct2EYo22>) -> !cir.ptr<!u64i>
// CHECK: %7 = "cir.struct_element_addr"(%1) {member_index = 2 : index, member_name = "createFlags"} : (!cir.ptr<!ty_22struct2EYo22>) -> !cir.ptr<!u64i>
// CHECK: %8 = cir.const(#cir.int<0> : !u64i) : !u64i
// CHECK: cir.store %8, %7 : !u64i, cir.ptr <!u64i>
8 changes: 4 additions & 4 deletions clang/test/CIR/CodeGen/assign-operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ struct String {

// Get address of `this->size`

// CHECK: %3 = "cir.struct_element_addr"(%2) {member_name = "size"}
// CHECK: %3 = "cir.struct_element_addr"(%2) {member_index = 0 : index, member_name = "size"}

// Get address of `s`

// CHECK: %4 = cir.load %1 : cir.ptr <!cir.ptr<!ty_22struct2EString22>>

// Get the address of s.size

// CHECK: %5 = "cir.struct_element_addr"(%4) {member_name = "size"}
// CHECK: %5 = "cir.struct_element_addr"(%4) {member_index = 0 : index, member_name = "size"}

// Load value from s.size and store in this->size

Expand All @@ -53,9 +53,9 @@ struct String {
// CHECK: cir.store %arg1, %1 : !cir.ptr<!ty_22struct2EStringView22>
// CHECK: %3 = cir.load deref %0 : cir.ptr <!cir.ptr<!ty_22struct2EStringView22>>
// CHECK: %4 = cir.load %1 : cir.ptr <!cir.ptr<!ty_22struct2EStringView22>>
// CHECK: %5 = "cir.struct_element_addr"(%4) {member_name = "size"}
// CHECK: %5 = "cir.struct_element_addr"(%4) {member_index = 0 : index, member_name = "size"}
// CHECK: %6 = cir.load %5 : cir.ptr <!s64i>, !s64i
// CHECK: %7 = "cir.struct_element_addr"(%3) {member_name = "size"}
// CHECK: %7 = "cir.struct_element_addr"(%3) {member_index = 0 : index, member_name = "size"}
// CHECK: cir.store %6, %7 : !s64i, cir.ptr <!s64i>
// CHECK: cir.store %3, %2 : !cir.ptr<!ty_22struct2EStringView22>
// CHECK: %8 = cir.load %2 : cir.ptr <!cir.ptr<!ty_22struct2EStringView22>>
Expand Down
4 changes: 2 additions & 2 deletions clang/test/CIR/CodeGen/ctor-member-lvalue-to-rvalue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ struct String {
// CHECK: cir.store %arg0, %0
// CHECK: cir.store %arg1, %1
// CHECK: %2 = cir.load %0
// CHECK: %3 = "cir.struct_element_addr"(%2) {member_name = "size"}
// CHECK: %3 = "cir.struct_element_addr"(%2) {member_index = 0 : index, member_name = "size"}
// CHECK: %4 = cir.load %1
// CHECK: %5 = "cir.struct_element_addr"(%4) {member_name = "size"}
// CHECK: %5 = "cir.struct_element_addr"(%4) {member_index = 0 : index, member_name = "size"}
// CHECK: %6 = cir.load %5 : cir.ptr <!s64i>, !s64i
// CHECK: cir.store %6, %3 : !s64i, cir.ptr <!s64i>
// CHECK: cir.return
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/CodeGen/derived-to-base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void C3::Layer::Initialize() {

// CHECK: cir.scope {
// CHECK: %2 = cir.base_class_addr(%1 : cir.ptr <!ty_22struct2EC33A3ALayer22>) -> cir.ptr <!ty_22class2EC23A3ALayer22>
// CHECK: %3 = "cir.struct_element_addr"(%2) {member_name = "m_C1"} : (!cir.ptr<!ty_22class2EC23A3ALayer22>) -> !cir.ptr<!cir.ptr<!ty_22class2EC222>>
// CHECK: %3 = "cir.struct_element_addr"(%2) {member_index = 0 : index, member_name = "m_C1"} : (!cir.ptr<!ty_22class2EC23A3ALayer22>) -> !cir.ptr<!cir.ptr<!ty_22class2EC222>>
// CHECK: %4 = cir.load %3 : cir.ptr <!cir.ptr<!ty_22class2EC222>>, !cir.ptr<!ty_22class2EC222>
// CHECK: %5 = cir.const(#cir.null : !cir.ptr<!ty_22class2EC222>) : !cir.ptr<!ty_22class2EC222>
// CHECK: %6 = cir.cmp(eq, %4, %5) : !cir.ptr<!ty_22class2EC222>, !cir.bool
Expand Down
8 changes: 4 additions & 4 deletions clang/test/CIR/CodeGen/lambda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ void l0() {
// CHECK: %0 = cir.alloca !cir.ptr<!ty_22class2Eanon222>, cir.ptr <!cir.ptr<!ty_22class2Eanon222>>, ["this", init] {alignment = 8 : i64}
// CHECK: cir.store %arg0, %0 : !cir.ptr<!ty_22class2Eanon222>, cir.ptr <!cir.ptr<!ty_22class2Eanon222>>
// CHECK: %1 = cir.load %0 : cir.ptr <!cir.ptr<!ty_22class2Eanon222>>, !cir.ptr<!ty_22class2Eanon222>
// CHECK: %2 = "cir.struct_element_addr"(%1) {member_name = "i"} : (!cir.ptr<!ty_22class2Eanon222>) -> !cir.ptr<!cir.ptr<!s32i>>
// CHECK: %2 = "cir.struct_element_addr"(%1) {member_index = 0 : index, member_name = "i"} : (!cir.ptr<!ty_22class2Eanon222>) -> !cir.ptr<!cir.ptr<!s32i>>
// CHECK: %3 = cir.load %2 : cir.ptr <!cir.ptr<!s32i>>, !cir.ptr<!s32i>
// CHECK: %4 = cir.load %3 : cir.ptr <!s32i>, !s32i
// CHECK: %5 = cir.const(#cir.int<1> : !s32i) : !s32i
// CHECK: %6 = cir.binop(add, %4, %5) : !s32i
// CHECK: %7 = "cir.struct_element_addr"(%1) {member_name = "i"} : (!cir.ptr<!ty_22class2Eanon222>) -> !cir.ptr<!cir.ptr<!s32i>>
// CHECK: %7 = "cir.struct_element_addr"(%1) {member_index = 0 : index, member_name = "i"} : (!cir.ptr<!ty_22class2Eanon222>) -> !cir.ptr<!cir.ptr<!s32i>>
// CHECK: %8 = cir.load %7 : cir.ptr <!cir.ptr<!s32i>>, !cir.ptr<!s32i>
// CHECK: cir.store %6, %8 : !s32i, cir.ptr <!s32i>

Expand All @@ -50,7 +50,7 @@ auto g() {
// CHECK: %1 = cir.alloca !s32i, cir.ptr <!s32i>, ["i", init] {alignment = 4 : i64}
// CHECK: %2 = cir.const(#cir.int<12> : !s32i) : !s32i
// CHECK: cir.store %2, %1 : !s32i, cir.ptr <!s32i>
// CHECK: %3 = "cir.struct_element_addr"(%0) {member_name = "i"} : (!cir.ptr<!ty_22class2Eanon223>) -> !cir.ptr<!cir.ptr<!s32i>>
// CHECK: %3 = "cir.struct_element_addr"(%0) {member_index = 0 : index, member_name = "i"} : (!cir.ptr<!ty_22class2Eanon223>) -> !cir.ptr<!cir.ptr<!s32i>>
// CHECK: cir.store %1, %3 : !cir.ptr<!s32i>, cir.ptr <!cir.ptr<!s32i>>
// CHECK: %4 = cir.load %0 : cir.ptr <!ty_22class2Eanon223>, !ty_22class2Eanon223
// CHECK: cir.return %4 : !ty_22class2Eanon223
Expand All @@ -70,7 +70,7 @@ auto g2() {
// CHECK-NEXT: %1 = cir.alloca !s32i, cir.ptr <!s32i>, ["i", init] {alignment = 4 : i64}
// CHECK-NEXT: %2 = cir.const(#cir.int<12> : !s32i) : !s32i
// CHECK-NEXT: cir.store %2, %1 : !s32i, cir.ptr <!s32i>
// CHECK-NEXT: %3 = "cir.struct_element_addr"(%0) {member_name = "i"} : (!cir.ptr<!ty_22class2Eanon224>) -> !cir.ptr<!cir.ptr<!s32i>>
// CHECK-NEXT: %3 = "cir.struct_element_addr"(%0) {member_index = 0 : index, member_name = "i"} : (!cir.ptr<!ty_22class2Eanon224>) -> !cir.ptr<!cir.ptr<!s32i>>
// CHECK-NEXT: cir.store %1, %3 : !cir.ptr<!s32i>, cir.ptr <!cir.ptr<!s32i>>
// CHECK-NEXT: %4 = cir.load %0 : cir.ptr <!ty_22class2Eanon224>, !ty_22class2Eanon224
// CHECK-NEXT: cir.return %4 : !ty_22class2Eanon224
Expand Down
6 changes: 3 additions & 3 deletions clang/test/CIR/CodeGen/rangefor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ void init(unsigned numImages) {
// CHECK: %13 = cir.alloca !ty_22struct2Etriple22, cir.ptr <!ty_22struct2Etriple22>, ["ref.tmp0"] {alignment = 8 : i64}
// CHECK: %14 = cir.const(#cir.zero : !ty_22struct2Etriple22) : !ty_22struct2Etriple22
// CHECK: cir.store %14, %13 : !ty_22struct2Etriple22, cir.ptr <!ty_22struct2Etriple22>
// CHECK: %15 = "cir.struct_element_addr"(%13) {member_name = "type"} : (!cir.ptr<!ty_22struct2Etriple22>) -> !cir.ptr<!u32i>
// CHECK: %15 = "cir.struct_element_addr"(%13) {member_index = 0 : index, member_name = "type"} : (!cir.ptr<!ty_22struct2Etriple22>) -> !cir.ptr<!u32i>
// CHECK: %16 = cir.const(#cir.int<1000024002> : !u32i) : !u32i
// CHECK: cir.store %16, %15 : !u32i, cir.ptr <!u32i>
// CHECK: %17 = "cir.struct_element_addr"(%13) {member_name = "next"} : (!cir.ptr<!ty_22struct2Etriple22>) -> !cir.ptr<!cir.ptr<!void>>
// CHECK: %18 = "cir.struct_element_addr"(%13) {member_name = "image"} : (!cir.ptr<!ty_22struct2Etriple22>) -> !cir.ptr<!u32i>
// CHECK: %17 = "cir.struct_element_addr"(%13) {member_index = 1 : index, member_name = "next"} : (!cir.ptr<!ty_22struct2Etriple22>) -> !cir.ptr<!cir.ptr<!void>>
// CHECK: %18 = "cir.struct_element_addr"(%13) {member_index = 2 : index, member_name = "image"} : (!cir.ptr<!ty_22struct2Etriple22>) -> !cir.ptr<!u32i>
// CHECK: %19 = cir.load %7 : cir.ptr <!cir.ptr<!ty_22struct2Etriple22>>, !cir.ptr<!ty_22struct2Etriple22>
// CHECK: %20 = cir.call @_ZN6tripleaSEOS_(%19, %13) : (!cir.ptr<!ty_22struct2Etriple22>, !cir.ptr<!ty_22struct2Etriple22>) -> !cir.ptr<!ty_22struct2Etriple22>
// CHECK: }
Expand Down
Loading