diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d27958..4952715 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -234,9 +234,10 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) OPTIONAL_COMPONENTS dia) if(Doxygen_FOUND) + message(STATUS "Found Doxygen, building the docs") add_subdirectory(docs) else() - message(STATUS "Doxygen not found, not building docs") + message(STATUS "Doxygen not found, not building the docs") endif() endif() endif() diff --git a/builder b/builder index 6115d3e..f6c8f1b 100755 --- a/builder +++ b/builder @@ -135,7 +135,7 @@ function build-release() { ## Builds the project in "Release" mode function build-docs() { ## Builds the documentation of Serene clean pushed_build - cmake -G Ninja -DCMAKE_BUILD_TYPE=Docs "$ROOT_DIR" + cmake -G Ninja -DSERENE_ENABLE_DOCS=ON "$ROOT_DIR" cmake --build . popd_build } diff --git a/include/serene/diagnostics.h b/include/serene/diagnostics.h index 3a82162..b730927 100644 --- a/include/serene/diagnostics.h +++ b/include/serene/diagnostics.h @@ -84,6 +84,9 @@ protected: void writeColorByType(llvm::raw_ostream &os, llvm::StringRef str); }; +/// DiagnosticEngine is the central hub for dealing with errors in Serene. It +/// integrates with MLIR's diag engine and LLVM's error system to handle error +/// reporting for Serene's compiler class DiagnosticEngine { SereneContext &ctx; @@ -108,6 +111,10 @@ public: /// `SereneContext` std::unique_ptr makeDiagnosticEngine(SereneContext &ctx); +// ---------------------------------------------------------------------------- +// Public API +// ---------------------------------------------------------------------------- + /// Throw out an error with the given \p and terminate the execution. SERENE_EXPORT void panic(SereneContext &ctx, llvm::Twine msg); diff --git a/include/serene/exprs/expression.h b/include/serene/exprs/expression.h index 3a1ee0e..6080578 100644 --- a/include/serene/exprs/expression.h +++ b/include/serene/exprs/expression.h @@ -46,7 +46,7 @@ using MaybeNode = llvm::Expected; using Ast = std::vector; using MaybeAst = llvm::Expected; -static auto EmptyNode = nullptr; +constexpr static auto EmptyNode = nullptr; /// The base class of the expressions which provides the common interface for /// the expressions to implement. diff --git a/include/serene/serene.h b/include/serene/serene.h index bb77f17..c52806f 100644 --- a/include/serene/serene.h +++ b/include/serene/serene.h @@ -40,13 +40,12 @@ SERENE_EXPORT void registerSereneCLOptions(); /// function has to be called after `llvm::cl::ParseCommandLineOptions`. SERENE_EXPORT void applySereneCLOptions(SereneContext &ctx); -/// Reads the the given \p input as a Serene source code in the given +/// \brief Reads the the given \p input as Serene source code in the given /// \c SereneContext \p ctx and returns the possible AST tree of the input or an /// error otherwise. /// -/// In case of an error Serene will throw the error messages vis the diagnostic -/// engine as well and the error that this function returns will be the generic -/// error message. +/// If any thing goes wrong it will return an \return \c llvm::Error describing +/// the issue. /// /// Be aware than this function reads the input in the context of the current /// namespace. So for example if the input is somthing like: diff --git a/include/serene_precompiles.h b/include/serene_precompiles.h deleted file mode 100644 index 8b53735..0000000 --- a/include/serene_precompiles.h +++ /dev/null @@ -1,92 +0,0 @@ -// DO NOT EDIT THIS FILE: It is aute generated by './builder -// gen_precompile_index' -#ifndef SERENE_PRECOMPIL_H -#define SERENE_PRECOMPIL_H -#include "mlir/Dialect/StandardOps/IR/Ops.h" -#include "mlir/IR/Attributes.h" -#include "mlir/IR/Builders.h" -#include "mlir/IR/BuiltinAttributes.h" -#include "mlir/IR/BuiltinOps.h" -#include "mlir/IR/BuiltinTypes.h" -#include "mlir/IR/Dialect.h" -#include "mlir/IR/Identifier.h" -#include "mlir/IR/Location.h" -#include "mlir/IR/MLIRContext.h" -#include "mlir/IR/OpDefinition.h" -#include "mlir/IR/OpImplementation.h" -#include "mlir/IR/Value.h" -#include "mlir/Interfaces/SideEffectInterfaces.h" -#include "mlir/Support/LogicalResult.h" - -#include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/StringRef.h" -#include "llvm/Support/Casting.h" -#include "llvm/Support/Errc.h" -#include "llvm/Support/Error.h" -#include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/ErrorOr.h" -#include "llvm/Support/FormatVariadic.h" -#include "llvm/Support/MemoryBuffer.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif