Skip to content

Commit 896cc91

Browse files
committed
Change to the getAttributesName function for our list of disallowed attributes
1 parent 450e9aa commit 896cc91

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

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

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -509,25 +509,6 @@ def CIR_FuncType : CIR_Type<"Func", "func"> {
509509
/// Returns a clone of this function type with the given argument
510510
/// and result types.
511511
FuncType clone(mlir::TypeRange inputs, mlir::TypeRange results) const;
512-
513-
/// A list of mlir attributes that shouldn't appear in the generic
514-
/// 'attributes' list, and instead are handled via other syntax.
515-
static constexpr llvm::StringRef disallowedFromAttrList[] = {
516-
"alias",
517-
"builtin",
518-
"comdat",
519-
"coroutine",
520-
"cxx_special_member",
521-
"dso_local",
522-
"function_type",
523-
"global_ctor_priority",
524-
"global_dtor_priority",
525-
"global_visibility",
526-
"inline_kind",
527-
"lambda",
528-
"linkage",
529-
"no_proto",
530-
"sym_visibility"};
531512
}];
532513
}
533514

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,7 +1829,7 @@ ParseResult cir::FuncOp::parse(OpAsmParser &parser, OperationState &state) {
18291829
if (parser.parseOptionalAttrDictWithKeyword(parsedAttrs))
18301830
return failure();
18311831

1832-
for (StringRef disallowed : cir::FuncType::disallowedFromAttrList) {
1832+
for (StringRef disallowed : cir::FuncOp::getAttributeNames()) {
18331833
if (parsedAttrs.get(disallowed))
18341834
return parser.emitError(loc, "attribute '")
18351835
<< disallowed
@@ -1992,7 +1992,7 @@ void cir::FuncOp::print(OpAsmPrinter &p) {
19921992
}
19931993

19941994
function_interface_impl::printFunctionAttributes(
1995-
p, *this, cir::FuncType::disallowedFromAttrList);
1995+
p, *this, cir::FuncOp::getAttributeNames());
19961996

19971997
// Print the body if this is not an external function.
19981998
Region &body = getOperation()->getRegion(0);

0 commit comments

Comments
 (0)