Skip to content

Commit 117cd9c

Browse files
xlaukogithub-actions[bot]
authored andcommitted
Automerge: [CIR] Implement AnyScalarType constraint (#141033)
This mirrors incubator changes from llvm/clangir#1625
2 parents 08f6f40 + 586e1df commit 117cd9c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ class CIR_ConfinedType<Type type, list<Pred> preds, string summary = "">
3131
: Type<And<[type.predicate, CIR_CastedSelfsToType<type.cppType, preds>]>,
3232
summary, type.cppType>;
3333

34+
//===----------------------------------------------------------------------===//
35+
// Bool Type predicates
36+
//===----------------------------------------------------------------------===//
37+
38+
def CIR_AnyBoolType : CIR_TypeBase<"::cir::BoolType", "boolean type">;
39+
3440
//===----------------------------------------------------------------------===//
3541
// IntType predicates
3642
//===----------------------------------------------------------------------===//
@@ -193,4 +199,16 @@ def IntegerVector : Type<
193199
// Any Integer or Vector of Integer Constraints
194200
def CIR_AnyIntOrVecOfInt: AnyTypeOf<[CIR_AnyIntType, IntegerVector]>;
195201

202+
//===----------------------------------------------------------------------===//
203+
// Scalar Type predicates
204+
//===----------------------------------------------------------------------===//
205+
206+
defvar CIR_ScalarTypes = [
207+
CIR_AnyBoolType, CIR_AnyIntType, CIR_AnyFloatType, CIR_AnyPtrType
208+
];
209+
210+
def CIR_AnyScalarType : AnyTypeOf<CIR_ScalarTypes, "cir scalar type"> {
211+
let cppFunctionName = "isScalarType";
212+
}
213+
196214
#endif // CLANG_CIR_DIALECT_IR_CIRTYPECONSTRAINTS_TD

0 commit comments

Comments
 (0)