diff --git a/changelogs/unreleased/th__reduce_visibility.yaml b/changelogs/unreleased/th__reduce_visibility.yaml new file mode 100644 index 000000000..b84eb5864 --- /dev/null +++ b/changelogs/unreleased/th__reduce_visibility.yaml @@ -0,0 +1,2 @@ +changed: + - make custom parse/print functions private diff --git a/include/llzk/Dialect/Array/IR/Ops.td b/include/llzk/Dialect/Array/IR/Ops.td index 6e3061863..b71c65006 100644 --- a/include/llzk/Dialect/Array/IR/Ops.td +++ b/include/llzk/Dialect/Array/IR/Ops.td @@ -218,15 +218,17 @@ def LLZK_CreateArrayOp }]; let extraClassDeclaration = [{ + private: static ::mlir::ParseResult parseInferredArrayType(::mlir::OpAsmParser &parser, ::llvm::SmallVector<::mlir::Type,1> &elementsTypes, ::mlir::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> elements, ::mlir::Type resultType ); + static void printInferredArrayType(::mlir::OpAsmPrinter &printer, CreateArrayOp, ::mlir::TypeRange, ::mlir::OperandRange, ::mlir::Type ); - private: + static ::llvm::SmallVector<::mlir::Type> resultTypeToElementsTypes(::mlir::Type resultType); }]; diff --git a/include/llzk/Dialect/Constrain/IR/Ops.td b/include/llzk/Dialect/Constrain/IR/Ops.td index 5f92841e4..c0fc1a59e 100644 --- a/include/llzk/Dialect/Constrain/IR/Ops.td +++ b/include/llzk/Dialect/Constrain/IR/Ops.td @@ -48,6 +48,7 @@ def EmitEqualityOp }]; let extraClassDeclaration = [{ + private: static ::mlir::Type inferRHS(::mlir::Type lhsType); static ::mlir::ParseResult parseInferredOrParsedType(::mlir::OpAsmParser &parser, diff --git a/include/llzk/Dialect/Global/IR/Ops.td b/include/llzk/Dialect/Global/IR/Ops.td index 06e6014c7..89dd66f91 100644 --- a/include/llzk/Dialect/Global/IR/Ops.td +++ b/include/llzk/Dialect/Global/IR/Ops.td @@ -54,14 +54,16 @@ def LLZK_GlobalDefOp let hasVerifier = 1; let extraClassDeclaration = [{ + inline bool isConstant() { return getConstant(); } + + private: static ::mlir::ParseResult parseGlobalInitialValue(::mlir::OpAsmParser &parser, ::mlir::Attribute &initialValue, ::mlir::TypeAttr typeAttr ); + static void printGlobalInitialValue(::mlir::OpAsmPrinter &printer, GlobalDefOp op, ::mlir::Attribute initialValue, ::mlir::TypeAttr typeAttr ); - - inline bool isConstant() { return getConstant(); } }]; } diff --git a/include/llzk/Dialect/Include/IR/Ops.td b/include/llzk/Dialect/Include/IR/Ops.td index 2c34f59a3..343d295c3 100644 --- a/include/llzk/Dialect/Include/IR/Ops.td +++ b/include/llzk/Dialect/Include/IR/Ops.td @@ -36,8 +36,10 @@ def LLZK_IncludeOp let extraClassDeclaration = [{ static IncludeOp create(::mlir::Location, ::llvm::StringRef name, ::llvm::StringRef path); static IncludeOp create(::mlir::Location, ::mlir::StringAttr name, ::mlir::StringAttr path); + /// Opens the module this include references but doesn't insert it into the parent module. ::mlir::FailureOr> openModule(); + /// Opens the module this include references and replace this include with that module. ::mlir::FailureOr inlineAndErase(); }]; diff --git a/include/llzk/Dialect/Shared/OpsBase.td b/include/llzk/Dialect/Shared/OpsBase.td index 4ca07bf14..347ed512c 100644 --- a/include/llzk/Dialect/Shared/OpsBase.td +++ b/include/llzk/Dialect/Shared/OpsBase.td @@ -16,6 +16,7 @@ include "llzk/Dialect/Polymorphic/IR/Types.td" class NaryOpBase traits = []> : Op { let extraClassDeclaration = [{ + private: static ::mlir::ParseResult parseInferredOrParsedType( ::mlir::OpAsmParser &parser, ::mlir::Type &opType, bool isFirst ) {