From 967be9e750221ab2ab783f95df79bb26d290a45e Mon Sep 17 00:00:00 2001 From: Martial Simon Date: Mon, 15 Sep 2025 01:07:58 +0200 Subject: add: added projects --- .../src/llvmtranslate/libllvmtranslate.hh | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tiger-compiler/src/llvmtranslate/libllvmtranslate.hh (limited to 'tiger-compiler/src/llvmtranslate/libllvmtranslate.hh') diff --git a/tiger-compiler/src/llvmtranslate/libllvmtranslate.hh b/tiger-compiler/src/llvmtranslate/libllvmtranslate.hh new file mode 100644 index 0000000..cf431e9 --- /dev/null +++ b/tiger-compiler/src/llvmtranslate/libllvmtranslate.hh @@ -0,0 +1,31 @@ +/** + ** \file llvmtranslate/libllvmtranslate.hh + ** \brief Public llvmtranslate module interface declaration. + */ + +#pragma once + +#include +#include + +#include + +#include +#include + +/// Translation from ast::Ast to llvm::Value. +namespace llvmtranslate +{ + /// Translate the file into a llvm::Module. + std::pair, std::unique_ptr> + translate(const ast::Ast& the_program); + + /// Load the runtime as a llvm::Module. + std::unique_ptr runtime_get(llvm::LLVMContext& ctx); + + /// The LLVM runtime as a string, loaded from the generated file. + /// This function is implemented in $(build_dir)/src/llvmtranslate/runtime.cc + /// For more information take a look at `local.am`. + const char* runtime_string(); + +} // namespace llvmtranslate -- cgit v1.2.3