diff --git a/clang/include/clang/CIR/Dialect/IR/CIROps.td b/clang/include/clang/CIR/Dialect/IR/CIROps.td index 59d28f65ed30..61ce3db06f5e 100644 --- a/clang/include/clang/CIR/Dialect/IR/CIROps.td +++ b/clang/include/clang/CIR/Dialect/IR/CIROps.td @@ -3095,7 +3095,7 @@ def GetMethodOp : CIR_Op<"get_method"> { }]; let arguments = (ins CIR_MethodType:$method, CIR_PtrToRecordType:$object); - let results = (outs FuncPtr:$callee, CIR_VoidPtrType:$adjusted_this); + let results = (outs CIR_PtrToFunc:$callee, CIR_VoidPtrType:$adjusted_this); let assemblyFormat = [{ $method `,` $object diff --git a/clang/include/clang/CIR/Dialect/IR/CIRTypeConstraints.td b/clang/include/clang/CIR/Dialect/IR/CIRTypeConstraints.td index fd2d75b7f746..7e146470f816 100644 --- a/clang/include/clang/CIR/Dialect/IR/CIRTypeConstraints.td +++ b/clang/include/clang/CIR/Dialect/IR/CIRTypeConstraints.td @@ -169,6 +169,12 @@ def CIR_AnyComplexType : CIR_TypeBase<"::cir::ComplexType", "complex type">; def CIR_AnyRecordType : CIR_TypeBase<"::cir::RecordType", "record type">; +//===----------------------------------------------------------------------===// +// Function Type predicates +//===----------------------------------------------------------------------===// + +def CIR_AnyFuncType : CIR_TypeBase<"::cir::FuncType", "function type">; + //===----------------------------------------------------------------------===// // Pointer Type predicates //===----------------------------------------------------------------------===// @@ -222,4 +228,6 @@ def CIR_PtrToComplexType : CIR_PtrToType; def CIR_PtrToRecordType : CIR_PtrToType; +def CIR_PtrToFunc : CIR_PtrToType; + #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 5bf4e2c432c9..bfb6254e3bc4 100644 --- a/clang/include/clang/CIR/Dialect/IR/CIRTypes.td +++ b/clang/include/clang/CIR/Dialect/IR/CIRTypes.td @@ -568,15 +568,6 @@ def ArrayPtr : Type< ]>, "!cir.ptr"> { } -// Pointer to functions -def FuncPtr : Type< - And<[ - CPred<"::mlir::isa<::cir::PointerType>($_self)">, - CPred<"::mlir::isa<::cir::FuncType>(" - "::mlir::cast<::cir::PointerType>($_self).getPointee())">, - ]>, "!cir.ptr"> { -} - //===----------------------------------------------------------------------===// // RecordType //