|
| 1 | +//===----------------------------------------------------------------------===// |
| 2 | +// TBAAAttr |
| 3 | +//===----------------------------------------------------------------------===// |
| 4 | + |
| 5 | +def CIR_TBAAAttr : CIR_Attr<"TBAA", "tbaa", []> { |
| 6 | + let summary = "CIR dialect TBAA base attribute"; |
| 7 | +} |
| 8 | + |
| 9 | +//===----------------------------------------------------------------------===// |
| 10 | +// TBAAOmnipotentCharAttr |
| 11 | +//===----------------------------------------------------------------------===// |
| 12 | + |
| 13 | +def CIR_TBAAOmnipotentChar |
| 14 | + : CIR_Attr<"TBAAOmnipotentChar", "tbaa_omnipotent_char", [], "TBAAAttr"> { |
| 15 | + let summary = "Describes a special scalar type, the omnipotent char type."; |
| 16 | +} |
| 17 | + |
| 18 | +//===----------------------------------------------------------------------===// |
| 19 | +// TBAAScalarAttr |
| 20 | +//===----------------------------------------------------------------------===// |
| 21 | + |
| 22 | +def CIR_TBAAScalarAttr : CIR_Attr<"TBAAScalar", "tbaa_scalar", [], "TBAAAttr"> { |
| 23 | + let summary = "Describes a scalar type in TBAA with an identifier."; |
| 24 | + |
| 25 | + let parameters = (ins StringRefParameter<> : $id, CIR_AnyType : $type); |
| 26 | + |
| 27 | + let description = [{ |
| 28 | + Define a TBAA scalar attribute. |
| 29 | + |
| 30 | + Example: |
| 31 | + ```mlir |
| 32 | + // CIR_TBAAScalarAttr |
| 33 | + #tbaa_scalar = #cir.tbaa_scalar<id = "int", type = !s32i> |
| 34 | + #tbaa_scalar1 = #cir.tbaa_scalar<id = "long long", type = !s64i> |
| 35 | + ``` |
| 36 | + |
| 37 | + See the following link for more details: |
| 38 | + https://llvm.org/docs/LangRef.html#tbaa-metadata |
| 39 | + }]; |
| 40 | + |
| 41 | + let assemblyFormat = "`<` struct(params) `>`"; |
| 42 | +} |
| 43 | + |
| 44 | +def CIR_TBAATagAttr : CIR_Attr<"TBAATag", "tbaa_tag", [], "TBAAAttr"> { |
| 45 | + let parameters = (ins CIR_TBAAAttr |
| 46 | + : $base, CIR_TBAAAttr |
| 47 | + : $access, "int64_t" |
| 48 | + : $offset); |
| 49 | + |
| 50 | + let assemblyFormat = "`<` struct(params) `>`"; |
| 51 | +} |
| 52 | + |
| 53 | +def CIR_AnyTBAAAttr : AnyAttrOf<[ |
| 54 | + CIR_TBAAAttr, |
| 55 | + CIR_TBAAOmnipotentChar, |
| 56 | + CIR_TBAAScalarAttr, |
| 57 | + CIR_TBAATagAttr |
| 58 | +]>; |
0 commit comments