diff --git a/CMakeLists.txt b/CMakeLists.txt index a5dd337..5e7aedb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,7 @@ option(SERENE_ENABLE_THINLTO "Enable ThisLTO." ON) option(SERENE_ENABLE_DOCS "Enable document generation" OFF) option(SERENE_ENABLE_TIDY "Enable clang tidy check" OFF) option(SERENE_DISABLE_CCACHE "Disable automatic ccache integration" OFF) +option(SERENE_ENABLE_DEVTOOLS "Enable the devtools build" OFF) # libserene option(SERENE_SHARED_LIB "Build libserene as a shared library" ON) @@ -242,6 +243,8 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) # The compiled library code is here add_subdirectory(libserene) + add_subdirectory(devtools) + if (SERENE_ENABLE_DOCS) add_subdirectory(docs) diff --git a/libserene/include/serene/slir/dialect.td b/libserene/include/serene/slir/dialect.td index 09fae45..43d03ae 100644 --- a/libserene/include/serene/slir/dialect.td +++ b/libserene/include/serene/slir/dialect.td @@ -4,6 +4,7 @@ include "mlir/IR/OpBase.td" include "mlir/IR/OpAsmInterface.td" include "mlir/IR/SymbolInterfaces.td" +include "mlir/IR/AttrTypeBase.td" include "mlir/Interfaces/SideEffectInterfaces.td" include "mlir/Interfaces/CallInterfaces.td" include "mlir/Interfaces/CastInterfaces.td" @@ -22,7 +23,12 @@ def Serene_Dialect : Dialect { This dialect tries to map the special forms of a lisp into IR level operations. }]; + + // All the types have to define a mnemonic let useDefaultTypePrinterParser = 1; + + // All the attributes have to define a mnemonic + let useDefaultAttributePrinterParser = 1; } // Base class for Serene dialect operations. This operation inherits from the base @@ -33,7 +39,7 @@ def Serene_Dialect : Dialect { class Serene_Op traits = []> : Op; - +// TODO: break up the types into their own file // All of the types will extend this class. class Serene_Type : TypeDef { } @@ -52,8 +58,6 @@ def SereneSymbol : Serene_Type<"Symbol"> { } - - def ValueOp: Serene_Op<"value"> { let summary = "This operation represent a value";