Skip to content

Commit f7d1d6c

Browse files
committed
Update Attr Constraint
1 parent f599308 commit f7d1d6c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,16 @@
1515

1616
include "mlir/IR/CommonAttrConstraints.td"
1717

18+
class CIR_IsAttrPred<code attr> : CPred<"::mlir::isa<" # attr # ">($_self)">;
19+
20+
class CIR_AttrConstraint<code attr, string summary = "">
21+
: Attr<CIR_IsAttrPred<attr>, summary>;
22+
1823
//===----------------------------------------------------------------------===//
1924
// IntAttr constraints
2025
//===----------------------------------------------------------------------===//
2126

22-
def CIR_AnyIntAttr : Attr<CPred<"mlir::isa<cir::IntAttr>($_self)">, "integer attribute">;
27+
def CIR_AnyIntAttr : CIR_AttrConstraint<"::cir::IntAttr", "integer attribute">;
2328

2429
//===----------------------------------------------------------------------===//
2530
// FPAttr constraints

0 commit comments

Comments
 (0)