Skip to content

Commit 3d04a3d

Browse files
committed
[CIR] Fix ninja clang-cir-doc
1 parent 8b19471 commit 3d04a3d

File tree

2 files changed

+25
-24
lines changed

2 files changed

+25
-24
lines changed

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#ifndef CLANG_CIR_DIALECT_IR_CIRENUMATTR_TD
1414
#define CLANG_CIR_DIALECT_IR_CIRENUMATTR_TD
1515

16+
include "clang/CIR/Dialect/IR/CIRDialect.td"
1617
include "mlir/IR/EnumAttr.td"
1718

1819
class CIR_I32EnumAttr<string name, string summary, list<I32EnumAttrCase> cases>
@@ -35,4 +36,28 @@ class CIR_DefaultValuedEnumParameter<EnumAttrInfo info, string value = "">
3536
let defaultValue = value;
3637
}
3738

39+
def CIR_AddressSpace : CIR_I32EnumAttr<
40+
"AddressSpace", "address space kind", [
41+
I32EnumAttrCase<"Default", 0, "default">,
42+
I32EnumAttrCase<"OffloadPrivate", 1, "offload_private">,
43+
I32EnumAttrCase<"OffloadLocal", 2, "offload_local">,
44+
I32EnumAttrCase<"OffloadGlobal", 3, "offload_global">,
45+
I32EnumAttrCase<"OffloadConstant", 4, "offload_constant">,
46+
I32EnumAttrCase<"OffloadGeneric", 5, "offload_generic">,
47+
I32EnumAttrCase<"Target", 6, "target">
48+
]> {
49+
let description = [{
50+
The `address_space` attribute is used to represent address spaces for
51+
pointer types in CIR. It provides a unified model on top of `clang::LangAS`
52+
and simplifies the representation of address spaces.
53+
54+
The `value` parameter is an extensible enum, which encodes target address
55+
space as an offset to the last language address space. For that reason, the
56+
attribute is implemented as custom AddressSpaceAttr, which provides custom
57+
printer and parser for the `value` parameter.
58+
}];
59+
60+
let genSpecializedAttr = 0;
61+
}
62+
3863
#endif // CLANG_CIR_DIALECT_IR_CIRENUMATTR_TD

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -200,30 +200,6 @@ def CIR_ComplexType : CIR_Type<"Complex", "complex", [
200200
// PointerType
201201
//===----------------------------------------------------------------------===//
202202

203-
def CIR_AddressSpace : CIR_I32EnumAttr<
204-
"AddressSpace", "address space kind", [
205-
I32EnumAttrCase<"Default", 0, "default">,
206-
I32EnumAttrCase<"OffloadPrivate", 1, "offload_private">,
207-
I32EnumAttrCase<"OffloadLocal", 2, "offload_local">,
208-
I32EnumAttrCase<"OffloadGlobal", 3, "offload_global">,
209-
I32EnumAttrCase<"OffloadConstant", 4, "offload_constant">,
210-
I32EnumAttrCase<"OffloadGeneric", 5, "offload_generic">,
211-
I32EnumAttrCase<"Target", 6, "target">
212-
]> {
213-
let description = [{
214-
The `address_space` attribute is used to represent address spaces for
215-
pointer types in CIR. It provides a unified model on top of `clang::LangAS`
216-
and simplifies the representation of address spaces.
217-
218-
The `value` parameter is an extensible enum, which encodes target address
219-
space as an offset to the last language address space. For that reason, the
220-
attribute is implemented as custom AddressSpaceAttr, which provides custom
221-
printer and parser for the `value` parameter.
222-
}];
223-
224-
let genSpecializedAttr = 0;
225-
}
226-
227203
def CIR_PointerType : CIR_Type<"Pointer", "ptr", [
228204
DeclareTypeInterfaceMethods<DataLayoutTypeInterface>,
229205
DeclareTypeInterfaceMethods<CIR_SizedTypeInterface>

0 commit comments

Comments
 (0)