-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ba1182a
Showing
23 changed files
with
11,054 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
tools/ | ||
*.txt | ||
*.sh | ||
data/ | ||
.cache/ | ||
build/ | ||
release_build/ | ||
# Created by https://www.toptal.com/developers/gitignore/api/linux,c++,cmake,git | ||
# Edit at https://www.toptal.com/developers/gitignore?templates=linux,c++,cmake,git | ||
|
||
### C++ ### | ||
# Prerequisites | ||
*.d | ||
|
||
# Compiled Object files | ||
*.slo | ||
*.lo | ||
*.o | ||
*.obj | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
# Compiled Dynamic libraries | ||
*.so | ||
*.dylib | ||
*.dll | ||
|
||
# Fortran module files | ||
*.mod | ||
*.smod | ||
|
||
# Compiled Static libraries | ||
*.lai | ||
*.la | ||
*.a | ||
*.lib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
|
||
### CMake ### | ||
CMakeLists.txt.user | ||
CMakeCache.txt | ||
CMakeFiles | ||
CMakeScripts | ||
Testing | ||
Makefile | ||
cmake_install.cmake | ||
install_manifest.txt | ||
compile_commands.json | ||
CTestTestfile.cmake | ||
_deps | ||
|
||
### CMake Patch ### | ||
# External projects | ||
*-prefix/ | ||
|
||
### Git ### | ||
# Created by git for backups. To disable backups in Git: | ||
# $ git config --global mergetool.keepBackup false | ||
*.orig | ||
|
||
# Created by git when using merge tools for conflicts | ||
*.BACKUP.* | ||
*.BASE.* | ||
*.LOCAL.* | ||
*.REMOTE.* | ||
*_BACKUP_*.txt | ||
*_BASE_*.txt | ||
*_LOCAL_*.txt | ||
*_REMOTE_*.txt | ||
|
||
### Linux ### | ||
*~ | ||
|
||
# temporary files which can be created if a process still has a handle open of a deleted file | ||
.fuse_hidden* | ||
|
||
# KDE directory preferences | ||
.directory | ||
|
||
# Linux trash folder which might appear on any partition or disk | ||
.Trash-* | ||
|
||
# .nfs files are created when an open file is removed but is still being accessed | ||
.nfs* | ||
|
||
# End of https://www.toptal.com/developers/gitignore/api/linux,c++,cmake,git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
project(bfjit) | ||
|
||
set(CMAKE_CXX_STANDARD 23) | ||
set(CMAKE_CXX_STANDARD_REQUIRED True) | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
|
||
set(CMAKE_CXX_FLAGS_DEBUG | ||
"${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic") | ||
set(CMAKE_CXX_FLAGS_RELEASE | ||
"${CMAKE_CXX_FLAGS_RELEASE} -g -march=native") | ||
|
||
add_link_options("--ld-path=/usr/local/bin/ld64.sold") | ||
|
||
add_executable(bfjit | ||
src/main.cpp | ||
src/bfjit/nodes/nodes.cpp | ||
src/bfjit/codegen/single_module_context.cpp | ||
src/bfjit/codegen/codegen.cpp | ||
src/bfjit/optimizer/optimizer.cpp | ||
src/bfjit/jit/jit.cpp | ||
src/bfjit/util/cmdline.cpp) | ||
|
||
find_package(Threads REQUIRED) | ||
find_package(fmt REQUIRED) | ||
# not the most portable approach I admit | ||
find_package(LLVM REQUIRED PATHS "/opt/homebrew/opt/llvm") | ||
|
||
llvm_map_components_to_libnames(llvm_libs | ||
core | ||
analysis | ||
scalaropts | ||
instcombine | ||
transformutils | ||
passes | ||
orcjit | ||
native) | ||
message(STATUS "LLVM found at: ${LLVM_DIR}") | ||
message(STATUS "LLVM lib list: ${llvm_libs}") | ||
|
||
target_link_libraries(bfjit PRIVATE Threads::Threads fmt::fmt ${llvm_libs}) | ||
|
||
target_include_directories(bfjit PRIVATE | ||
"include" | ||
${LLVM_INCLUDE_DIRS}) | ||
|
Oops, something went wrong.