parent
35da726b00
commit
6de56f107b
@ -1,5 +1,69 @@
|
||||
# 忽略构建产物与中间文件:
|
||||
# - build/ 等构建目录
|
||||
# - ANTLR 自动生成文件(若产生在源码树中应忽略)
|
||||
# - test/test_result/ 等测试输出目录
|
||||
# =========================
|
||||
# Build / CMake
|
||||
# =========================
|
||||
build/
|
||||
cmake-build-*/
|
||||
out/
|
||||
dist/
|
||||
|
||||
CMakeFiles/
|
||||
CMakeCache.txt
|
||||
cmake_install.cmake
|
||||
install_manifest.txt
|
||||
Makefile
|
||||
compile_commands.json
|
||||
.ninja_deps
|
||||
.ninja_log
|
||||
|
||||
# =========================
|
||||
# Generated / intermediate
|
||||
# =========================
|
||||
*.o
|
||||
*.obj
|
||||
*.a
|
||||
*.lib
|
||||
*.so
|
||||
*.dylib
|
||||
*.dll
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
*.pdb
|
||||
*.ilk
|
||||
*.dSYM/
|
||||
|
||||
*.log
|
||||
*.tmp
|
||||
*.swp
|
||||
*.swo
|
||||
*.bak
|
||||
|
||||
# ANTLR 生成物(通常在 build/,这里额外兜底)
|
||||
**/generated/antlr4/
|
||||
**/antlr4-generated/
|
||||
*.tokens
|
||||
*.interp
|
||||
|
||||
# =========================
|
||||
# IDE / Editor
|
||||
# =========================
|
||||
.vscode/
|
||||
.idea/
|
||||
.fleet/
|
||||
.vs/
|
||||
*.code-workspace
|
||||
|
||||
# CLion
|
||||
cmake-build-debug/
|
||||
cmake-build-release/
|
||||
|
||||
# =========================
|
||||
# OS / misc
|
||||
# =========================
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# =========================
|
||||
# Project outputs
|
||||
# =========================
|
||||
test/test_result/
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
add_library(ast STATIC
|
||||
AstNodes.cpp
|
||||
AstPrinter.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(ast PUBLIC
|
||||
build_options
|
||||
)
|
||||
@ -0,0 +1,26 @@
|
||||
add_library(ir_core STATIC
|
||||
Context.cpp
|
||||
Module.cpp
|
||||
Function.cpp
|
||||
BasicBlock.cpp
|
||||
Type.cpp
|
||||
Value.cpp
|
||||
Instruction.cpp
|
||||
IRBuilder.cpp
|
||||
IRPrinter.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(ir_core PUBLIC
|
||||
build_options
|
||||
)
|
||||
|
||||
add_subdirectory(analysis)
|
||||
add_subdirectory(passes)
|
||||
|
||||
# 统一对外的 IR 依赖入口
|
||||
add_library(ir INTERFACE)
|
||||
target_link_libraries(ir INTERFACE
|
||||
ir_core
|
||||
ir_analysis
|
||||
ir_passes
|
||||
)
|
||||
@ -0,0 +1,9 @@
|
||||
add_library(ir_analysis STATIC
|
||||
DominatorTree.cpp
|
||||
LoopInfo.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(ir_analysis PUBLIC
|
||||
build_options
|
||||
ir_core
|
||||
)
|
||||
@ -0,0 +1,13 @@
|
||||
add_library(ir_passes STATIC
|
||||
PassManager.cpp
|
||||
Mem2Reg.cpp
|
||||
ConstFold.cpp
|
||||
DCE.cpp
|
||||
CFGSimplify.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(ir_passes PUBLIC
|
||||
build_options
|
||||
ir_core
|
||||
ir_analysis
|
||||
)
|
||||
@ -0,0 +1,24 @@
|
||||
add_library(mir_core STATIC
|
||||
MIRContext.cpp
|
||||
MIRFunction.cpp
|
||||
MIRBasicBlock.cpp
|
||||
MIRInstr.cpp
|
||||
Register.cpp
|
||||
Lowering.cpp
|
||||
RegAlloc.cpp
|
||||
FrameLowering.cpp
|
||||
AsmPrinter.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(mir_core PUBLIC
|
||||
build_options
|
||||
ir
|
||||
)
|
||||
|
||||
add_subdirectory(passes)
|
||||
|
||||
add_library(mir INTERFACE)
|
||||
target_link_libraries(mir INTERFACE
|
||||
mir_core
|
||||
mir_passes
|
||||
)
|
||||
@ -0,0 +1,9 @@
|
||||
add_library(mir_passes STATIC
|
||||
PassManager.cpp
|
||||
Peephole.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(mir_passes PUBLIC
|
||||
build_options
|
||||
mir_core
|
||||
)
|
||||
@ -0,0 +1,10 @@
|
||||
add_library(sem STATIC
|
||||
Sema.cpp
|
||||
SymbolTable.cpp
|
||||
ConstEval.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(sem PUBLIC
|
||||
build_options
|
||||
ast
|
||||
)
|
||||
@ -0,0 +1,8 @@
|
||||
add_library(utils STATIC
|
||||
Log.cpp
|
||||
CLI.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(utils PUBLIC
|
||||
build_options
|
||||
)
|
||||
Loading…
Reference in new issue