From e7ecaa7c5456c8ccc55d90409aa55c075089a349 Mon Sep 17 00:00:00 2001 From: xlauko Date: Tue, 13 May 2025 14:42:09 +0200 Subject: [PATCH] [CIR] Refactor pointers to ExceptionInfoType constraints --- .../clang/CIR/Dialect/IR/CIRTypeConstraints.td | 12 ++++++++++++ clang/include/clang/CIR/Dialect/IR/CIRTypes.td | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/clang/include/clang/CIR/Dialect/IR/CIRTypeConstraints.td b/clang/include/clang/CIR/Dialect/IR/CIRTypeConstraints.td index 125df316211c..b2d660f52072 100644 --- a/clang/include/clang/CIR/Dialect/IR/CIRTypeConstraints.td +++ b/clang/include/clang/CIR/Dialect/IR/CIRTypeConstraints.td @@ -181,6 +181,13 @@ def CIR_AnyFuncType : CIR_TypeBase<"::cir::FuncType", "function type">; def CIR_AnyArrayType : CIR_TypeBase<"::cir::ArrayType", "array type">; +//===----------------------------------------------------------------------===// +// Exception Info Type predicates +//===----------------------------------------------------------------------===// + +def CIR_AnyExceptionInfoType : CIR_TypeBase< + "::cir::ExceptionInfoType", "exception info type">; + //===----------------------------------------------------------------------===// // Pointer Type predicates //===----------------------------------------------------------------------===// @@ -238,4 +245,9 @@ def CIR_PtrToFunc : CIR_PtrToType; def CIR_PtrToArray : CIR_PtrToType; +def CIR_PtrToExceptionInfoType + : CIR_PtrToType, + BuildableType<"$_builder.getType<" # cppType # ">(" + "cir::ExceptionInfoType::get($_builder.getContext())))">; + #endif // CLANG_CIR_DIALECT_IR_CIRTYPECONSTRAINTS_TD diff --git a/clang/include/clang/CIR/Dialect/IR/CIRTypes.td b/clang/include/clang/CIR/Dialect/IR/CIRTypes.td index b76f29b3c2c3..4aa48eb38730 100644 --- a/clang/include/clang/CIR/Dialect/IR/CIRTypes.td +++ b/clang/include/clang/CIR/Dialect/IR/CIRTypes.td @@ -505,18 +505,6 @@ def CIR_VoidType : CIR_Type<"Void", "void"> { // Constraints -// Pointer to exception info -def ExceptionPtr : Type< - And<[ - CPred<"::mlir::isa<::cir::PointerType>($_self)">, - CPred<"::mlir::isa<::cir::ExceptionInfoType>(" - "::mlir::cast<::cir::PointerType>($_self).getPointee())"> - ]>, "!cir.eh_info*">, - BuildableType< - "cir::PointerType::get($_builder.getContext()," - "cir::ExceptionInfoType::get($_builder.getContext()))"> { -} - // Vector of integral type def IntegerVector : Type< And<[