Skip to content

Commit 395999a

Browse files
authored
[CIR] Change record type alias prefix from !ty_ to !rec_ (#1580)
This changes the alias prefix for record types to make it less general.
1 parent c7b27ec commit 395999a

File tree

128 files changed

+1374
-1374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+1374
-1374
lines changed

clang/include/clang/CIR/Dialect/IR/CIRAttrs.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,9 +608,9 @@ def DataMemberAttr : CIR_Attr<"DataMember", "data_member",
608608

609609
Example:
610610
```
611-
#ptr = #cir.data_member<1> : !cir.data_member<!s32i in !ty_22Point22>
611+
#ptr = #cir.data_member<1> : !cir.data_member<!s32i in !rec_22Point22>
612612

613-
#null = #cir.data_member<null> : !cir.data_member<!s32i in !ty_22Point22>
613+
#null = #cir.data_member<null> : !cir.data_member<!s32i in !rec_22Point22>
614614
```
615615
}];
616616

clang/include/clang/CIR/Dialect/IR/CIROps.td

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2640,7 +2640,7 @@ def VTTAddrPointOp : CIR_Op<"vtt.address_point",
26402640
```mlir
26412641
cir.global linkonce_odr @_ZTV1B = ...
26422642
...
2643-
%3 = cir.base_class_addr(%1 : !cir.ptr<!ty_D> nonnull) [0] -> !cir.ptr<!ty_B>
2643+
%3 = cir.base_class_addr(%1 : !cir.ptr<!rec_D> nonnull) [0] -> !cir.ptr<!rec_B>
26442644
%4 = cir.vtt.address_point @_ZTT1D, offset = 1 -> !cir.ptr<!cir.ptr<!void>>
26452645
cir.call @_ZN1BC2Ev(%3, %4)
26462646
```
@@ -3369,7 +3369,7 @@ def BaseClassAddrOp : CIR_Op<"base_class_addr"> {
33693369
```
33703370
will generate
33713371
```mlir
3372-
%3 = cir.base_class_addr (%1 : !cir.ptr<!ty_Derived> nonnull) [0] -> !cir.ptr<!ty_Base>
3372+
%3 = cir.base_class_addr (%1 : !cir.ptr<!rec_Derived> nonnull) [0] -> !cir.ptr<!rec_Base>
33733373
```
33743374
}];
33753375

@@ -3420,9 +3420,9 @@ def DerivedClassAddrOp : CIR_Op<"derived_class_addr"> {
34203420

34213421
leads to
34223422
```mlir
3423-
%2 = cir.load %0 : !cir.ptr<!cir.ptr<!ty_B>>, !cir.ptr<!ty_B>
3424-
%3 = cir.derived_class_addr(%2 : !cir.ptr<!ty_B> nonnull) [4] -> !cir.ptr<!ty_X>
3425-
%4 = cir.base_class_addr(%3 : !cir.ptr<!ty_X>) [0] -> !cir.ptr<!ty_A>
3423+
%2 = cir.load %0 : !cir.ptr<!cir.ptr<!rec_B>>, !cir.ptr<!rec_B>
3424+
%3 = cir.derived_class_addr(%2 : !cir.ptr<!rec_B> nonnull) [4] -> !cir.ptr<!rec_X>
3425+
%4 = cir.base_class_addr(%3 : !cir.ptr<!rec_X>) [0] -> !cir.ptr<!rec_A>
34263426
cir.return %4
34273427
```
34283428
}];
@@ -3519,7 +3519,7 @@ def BaseMethodOp : CIR_Op<"base_method", [Pure]> {
35193519
Example:
35203520

35213521
```mlir
3522-
%1 = cir.base_method(%0 : !cir.method<!cir.func<(!s32i)> in !ty_Derived>) [16] -> !cir.method<!cir.func<(!s32i)> in !ty_Base>
3522+
%1 = cir.base_method(%0 : !cir.method<!cir.func<(!s32i)> in !rec_Derived>) [16] -> !cir.method<!cir.func<(!s32i)> in !rec_Base>
35233523
```
35243524
}];
35253525

@@ -3551,7 +3551,7 @@ def DerivedMethodOp : CIR_Op<"derived_method", [Pure]> {
35513551
Example:
35523552

35533553
```mlir
3554-
%1 = cir.derived_method(%0 : !cir.method<!cir.func<(!s32i)> in !ty_Base>) [16] -> !cir.method<!cir.func<(!s32i)> in !ty_Derived>
3554+
%1 = cir.derived_method(%0 : !cir.method<!cir.func<(!s32i)> in !rec_Base>) [16] -> !cir.method<!cir.func<(!s32i)> in !rec_Derived>
35553555
```
35563556
}];
35573557

@@ -5190,8 +5190,8 @@ def CIR_InlineAsmOp : CIR_Op<"asm", [RecursiveMemoryEffects]> {
51905190
```
51915191

51925192
```mlir
5193-
!ty_22anon2E022 = !cir.record<struct "anon.0" {!cir.int<s, 32>, !cir.int<s, 32>}>
5194-
!ty_22anon2E122 = !cir.record<struct "anon.1" {!cir.int<s, 32>, !cir.int<s, 32>}>
5193+
!rec_22anon2E022 = !cir.record<struct "anon.0" {!cir.int<s, 32>, !cir.int<s, 32>}>
5194+
!rec_22anon2E122 = !cir.record<struct "anon.1" {!cir.int<s, 32>, !cir.int<s, 32>}>
51955195
...
51965196
%0 = cir.alloca !s32i, !cir.ptr<!s32i>, ["x", init]
51975197
%1 = cir.alloca !s32i, !cir.ptr<!s32i>, ["y", init]
@@ -5209,13 +5209,13 @@ def CIR_InlineAsmOp : CIR_Op<"asm", [RecursiveMemoryEffects]> {
52095209
out = [],
52105210
in = [],
52115211
in_out = [%2 : !s32i],
5212-
{"bar $$42 $0" "=r,=&r,1,~{dirflag},~{fpsr},~{flags}"}) -> !ty_22anon2E022
5212+
{"bar $$42 $0" "=r,=&r,1,~{dirflag},~{fpsr},~{flags}"}) -> !rec_22anon2E022
52135213

52145214
cir.asm(x86_att,
52155215
out = [],
52165216
in = [%3 : !s32i],
52175217
in_out = [%2 : !s32i],
5218-
{"baz $$42 $0" "=r,=&r,0,1,~{dirflag},~{fpsr},~{flags}"}) -> !ty_22anon2E122
5218+
{"baz $$42 $0" "=r,=&r,0,1,~{dirflag},~{fpsr},~{flags}"}) -> !rec_22anon2E122
52195219
```
52205220
}];
52215221

clang/include/clang/CIR/Dialect/IR/CIRTBAAAttrs.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def CIR_TBAAMemberAttr : CIR_Attr<"TBAAMember", "tbaa_member", []> {
8686

8787
Example:
8888
```mlir
89-
!ty_StructS = !cir.record<struct "StructS" {!u16i, !u32i} #cir.record.decl.ast>
89+
!rec_StructS = !cir.record<struct "StructS" {!u16i, !u32i} #cir.record.decl.ast>
9090
#tbaa_scalar = #cir.tbaa_scalar<id = "int", type = !s32i>
9191
#tbaa_scalar1 = #cir.tbaa_scalar<id = "short", type = !s16i>
9292
#tbaa_struct = #cir.tbaa_struct<id = "_ZTS7StructS", members = {<#tbaa_scalar1, 0>, <#tbaa_scalar, 4>}>
@@ -135,7 +135,7 @@ def CIR_TBAAStructAttr : CIR_Attr<"TBAAStruct",
135135

136136
Example:
137137
```mlir
138-
!ty_StructS = !cir.record<struct "StructS" {!u16i, !u32i} #cir.record.decl.ast>
138+
!rec_StructS = !cir.record<struct "StructS" {!u16i, !u32i} #cir.record.decl.ast>
139139
#tbaa_scalar = #cir.tbaa_scalar<id = "int", type = !s32i>
140140
#tbaa_scalar1 = #cir.tbaa_scalar<id = "short", type = !s16i>
141141
// CIR_TBAAStructAttr

clang/lib/CIR/Dialect/IR/CIRDialect.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ struct CIROpAsmDialectInterface : public OpAsmDialectInterface {
6363
if (auto recordType = dyn_cast<cir::RecordType>(type)) {
6464
StringAttr nameAttr = recordType.getName();
6565
if (!nameAttr)
66-
os << "ty_anon_" << recordType.getKindAsStr();
66+
os << "rec_anon_" << recordType.getKindAsStr();
6767
else
68-
os << "ty_" << nameAttr.getValue();
68+
os << "rec_" << nameAttr.getValue();
6969
return AliasResult::OverridableAlias;
7070
}
7171
if (auto intType = dyn_cast<cir::IntType>(type)) {

0 commit comments

Comments
 (0)