Skip to content

Commit 5df5009

Browse files
authored
[CIR] Refactor pointers to ExceptionInfoType constraints (#1612)
1 parent 70813ef commit 5df5009

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,13 @@ def CIR_AnyFuncType : CIR_TypeBase<"::cir::FuncType", "function type">;
181181

182182
def CIR_AnyArrayType : CIR_TypeBase<"::cir::ArrayType", "array type">;
183183

184+
//===----------------------------------------------------------------------===//
185+
// Exception Info Type predicates
186+
//===----------------------------------------------------------------------===//
187+
188+
def CIR_AnyExceptionInfoType : CIR_TypeBase<
189+
"::cir::ExceptionInfoType", "exception info type">;
190+
184191
//===----------------------------------------------------------------------===//
185192
// Pointer Type predicates
186193
//===----------------------------------------------------------------------===//
@@ -238,4 +245,9 @@ def CIR_PtrToFunc : CIR_PtrToType<CIR_AnyFuncType>;
238245

239246
def CIR_PtrToArray : CIR_PtrToType<CIR_AnyArrayType>;
240247

248+
def CIR_PtrToExceptionInfoType
249+
: CIR_PtrToType<CIR_AnyExceptionInfoType>,
250+
BuildableType<"$_builder.getType<" # cppType # ">("
251+
"cir::ExceptionInfoType::get($_builder.getContext())))">;
252+
241253
#endif // CLANG_CIR_DIALECT_IR_CIRTYPECONSTRAINTS_TD

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -505,18 +505,6 @@ def CIR_VoidType : CIR_Type<"Void", "void"> {
505505

506506
// Constraints
507507

508-
// Pointer to exception info
509-
def ExceptionPtr : Type<
510-
And<[
511-
CPred<"::mlir::isa<::cir::PointerType>($_self)">,
512-
CPred<"::mlir::isa<::cir::ExceptionInfoType>("
513-
"::mlir::cast<::cir::PointerType>($_self).getPointee())">
514-
]>, "!cir.eh_info*">,
515-
BuildableType<
516-
"cir::PointerType::get($_builder.getContext(),"
517-
"cir::ExceptionInfoType::get($_builder.getContext()))"> {
518-
}
519-
520508
// Vector of integral type
521509
def IntegerVector : Type<
522510
And<[

0 commit comments

Comments
 (0)