SLang-Codegen-LLVM

所属分类:自动编程
开发工具:C++
文件大小:28KB
下载次数:0
上传日期:2021-11-21 14:31:19
上 传 者sh-1993
说明:  SLang编程语言编译器的基于LLVM的后端(代码生成器)
(The LLVM-based backend (code generator) for the SLang programming language compiler)

文件列表:
.clang-format (3805, 2021-11-21)
.clang-tidy (6574, 2021-11-21)
.editorconfig (259, 2021-11-21)
.vscode (0, 2021-11-21)
.vscode\extensions.json (240, 2021-11-21)
.vscode\launch.json (641, 2021-11-21)
.vscode\settings.json (3994, 2021-11-21)
.vscode\templates (0, 2021-11-21)
.vscode\templates\header.h (262, 2021-11-21)
CMakeLists.txt (1936, 2021-11-21)
CMakePresets.json (1691, 2021-11-21)
CMakeSettings.json (1165, 2021-11-21)
Dockerfile (2359, 2021-11-21)
app (0, 2021-11-21)
app\CMakeLists.txt (657, 2021-11-21)
app\code_generator.cc (1599, 2021-11-21)
data (0, 2021-11-21)
data\slangir.schema.json (369, 2021-11-21)
include (0, 2021-11-21)
include\slang_codegen_llvm (0, 2021-11-21)
include\slang_codegen_llvm\command_line_args (0, 2021-11-21)
include\slang_codegen_llvm\command_line_args\command_line_args.h (1727, 2021-11-21)
include\slang_codegen_llvm\driver (0, 2021-11-21)
include\slang_codegen_llvm\driver\driver.h (1016, 2021-11-21)
src (0, 2021-11-21)
src\CMakeLists.txt (2880, 2021-11-21)
src\command_line_args (0, 2021-11-21)
src\command_line_args\CMakeLists.txt (336, 2021-11-21)
src\command_line_args\command_line_args.cc (945, 2021-11-21)
src\driver (0, 2021-11-21)
src\driver\CMakeLists.txt (303, 2021-11-21)
src\driver\driver.cc (1698, 2021-11-21)
src\ir_converter (0, 2021-11-21)
... ...

# SLang-Codegen-LLVM ## Overview This project is an implementation of the SLang programming language compiler backend using LLVM. You may find an old implementation on the [branch `v0.1.3`](https://github.com/slang-project/SLang-Codegen-LLVM/blob/master/../../tree/v0.1.3). ## How to install dependencies and build project This project is based on CMake. In order to build it, you need to install dependencies and then build the project. Also consider installation of `clang-format` and `clang-tidy` tools to conform to project's coding standard. The version used as of the writing of this manual is `13.0.0`. You can run the corresponding check using CMake targets `Format` and `Tidy`. To run all the unit tests you can use target `test`, building target `SlangCompilerLlvmCodegenUnitTests` beforehand. ### Visual Studio Code Cross-platform universal solution for development for this project is to use the [Visual Studio Code](https://github.com/slang-project/SLang-Codegen-LLVM/blob/master/https://code.visualstudio.com). Please, consider installing all recommended extensions for this workspace and take care of the dependencies based on the instructions below. If considering `vcpkg`, then you should have properly set `VCPKG_ROOT` environment variable prior opening project folder. Otherwise, feel free to ignore `vcpkg` configuration and remove all settings that require the presence of it (for example, `CMAKE_TOOLCHAIN_FILE` in `cmake.configureSettings`) ### UNIX After cloning the project, run the tool that installs the `vcpkg` and sets a global environment variable with a path to it: ```bash tools/install_vcpkg.sh ``` By default, it installs `vcpkg` in a folder near project's folder. You may customise this behaviour by providing the install path by your own. You are strongly advised to not install it in any of the project folder or subfolders. ```bash tools/install_vcpkg.sh path/to/vcpkg ``` As an alternative, you can install all the required dependencies by yourself. Use `vcpkg.json` and `Dockerfile` for hints on what you may need to install. > This method is not advised since it introduces inconsistency into project development. ### Windows You are advised to set this option before cloning this project to not make you editor go mad. ```bat git config --global core.autocrlf input ``` You will also need to have [`vcpkg`](https://github.com/slang-project/SLang-Codegen-LLVM/blob/master/https://github.com/Microsoft/vcpkg) package manager installed: ```bat REM Put vcpkg out of project scope cd .. REM If fails, remove `/m` option to setup variable just for a user SETX VCPKG_ROOT "%cd%\vcpkg" /m git clone https://github.com/microsoft/vcpkg %VCPKG_ROOT% %VCPKG_ROOT%\bootstrap-vcpkg.bat %VCPKG_ROOT%\vcpkg integrate install ``` #### Visual Studio Instead of VS Code you may want to work in [Visual Studio](https://github.com/slang-project/SLang-Codegen-LLVM/blob/master/https://visualstudio.microsoft.com/vs), which is also supported. You are advised to use 2019 edition and later with the following individual components installed: * MSVC v142 (or later) * C++ CMake tools for Windows Open this project's folder as a CMake project. Don't forget to setup command line arguments for debug: * `.vs\launch.vs.json` * `{..."configurations": [...{..."args": "path/to/in.debug.slangir"...}...]...}` * Using GUI * Right-click on top `CMakeLists.txt` * "Debug and Launch Settings" ### Docker The project is packed into reproducible build environment with Docker. You may use [Dockerfile](https://github.com/slang-project/SLang-Codegen-LLVM/blob/master/Dockerfile) provided to build your own image to work with project. We are considering publishing the resulting image with dependencies somewhere for quick start on a project. The following example may be helpful in getting started, but you still need to get [Docker](https://github.com/slang-project/SLang-Codegen-LLVM/blob/master/https://docs.docker.com/engine/install) by yourself ([Ubuntu instruction](https://github.com/slang-project/SLang-Codegen-LLVM/blob/master/https://docs.docker.com/engine/install/ubuntu)): ```bash docker build --target install-vcpkg --network "host" -t slang-project/slang-codegen-llvm-deps:0.2.1 . docker build --cache-from slang-project/slang-codegen-llvm-deps:0.2.1 --network "host" -t slang-project/slang-codegen-llvm:0.2.1 . docker run --rm slang-project/slang-codegen-llvm:0.2.1 path/to/in.json ``` ## How to run project ```bash build/app/SlangCompilerLlvmCodegenDriver path/to/in.slangir ```

近期下载者

相关文件


收藏者