forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 2
Created infrastructure for compiler course #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
1e18b62
ci
Kuznetsov-Artyom 47e8294
example ClangAST
Kuznetsov-Artyom 9dae910
change test
Kuznetsov-Artyom 9954db9
example LLVM-IR
Kuznetsov-Artyom f532d02
change CMakeLists.txt
Kuznetsov-Artyom 66ec2c4
update ci
Kuznetsov-Artyom 412da49
update ci
Kuznetsov-Artyom 84f99c1
add mold linker for Linux / MacOS
Kuznetsov-Artyom e07485b
add upload artifacts and add scenario llvm_enable_assertions=off
Kuznetsov-Artyom 6941e24
try artifacts
Kuznetsov-Artyom ac697e2
try enable artifacts
Kuznetsov-Artyom d66a4a2
add clang-tidy
Kuznetsov-Artyom 197063f
update ci
Kuznetsov-Artyom 37eca29
check ci
Kuznetsov-Artyom dbb72ce
upd ci
Kuznetsov-Artyom 14dc3b2
upd
Kuznetsov-Artyom 07d0ceb
change target build for macOS
Kuznetsov-Artyom fcea7a5
upd ci build
Kuznetsov-Artyom 3ff08d1
upd ci
Kuznetsov-Artyom dced4fb
change check tests
Kuznetsov-Artyom ef3d405
fix yml build
Kuznetsov-Artyom 8c7f1d7
check ci
Kuznetsov-Artyom 1d87a8a
check ci
Kuznetsov-Artyom 290f5fa
change version python
Kuznetsov-Artyom edc949a
remove unused cmake flags
Kuznetsov-Artyom 85a7bea
upd
Kuznetsov-Artyom 96aae3e
upd
Kuznetsov-Artyom 81d70b9
fix parallel build
Kuznetsov-Artyom 3164020
fix windows
Kuznetsov-Artyom 85573d2
success fix
Kuznetsov-Artyom 351889d
Update example.cpp for ClangAST lab
Kuznetsov-Artyom e5a237a
add lab mlir
Kuznetsov-Artyom 619ebf3
add mangling for targets
Kuznetsov-Artyom f534549
add mlir build in CI
Kuznetsov-Artyom 04d8f64
style
Kuznetsov-Artyom 3fc3be9
add backend lab
Kuznetsov-Artyom c89846c
disable windows
Kuznetsov-Artyom bf6a7f9
change README.md
Kuznetsov-Artyom bc56c66
update CI
Kuznetsov-Artyom d2ded1e
fix CI
Kuznetsov-Artyom 32f7994
test migrate backend lab from X86 directory
Kuznetsov-Artyom aff3174
remove backend lab from x86 dir
Kuznetsov-Artyom 5764c1c
pre-review
Kuznetsov-Artyom d532380
add instruction for implementation labs
Kuznetsov-Artyom b53c76a
add links
Kuznetsov-Artyom 01702fe
add labeler bot
Kuznetsov-Artyom 0c1b956
delete unnecessary target
Kuznetsov-Artyom 866697b
update
Kuznetsov-Artyom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,16 @@ | ||
'lab:clang': | ||
- "clang/compiler-course/**" | ||
'lab:llvm ir': | ||
- "llvm/compiler-course/llvm-ir/**" | ||
'lab:backend': | ||
- "llvm/compiler-course/backend/**" | ||
'lab:mlir': | ||
- "mlir/compiler-course/**" | ||
|
||
tests: | ||
- "clang/test/compiler-course/**" | ||
- "llvm/test/compiler-course/**" | ||
- "mlir/test/compiler-course/**" | ||
|
||
ci: | ||
- ".github/**" |
This file contains hidden or 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,117 @@ | ||
name: Build LLVM | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
ubuntu-gcc-build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
assertions: [ON, OFF] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
- name: Setup environment | ||
run: | | ||
sudo apt-get install -y \ | ||
build-essential \ | ||
ninja-build \ | ||
- name: Setup ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
max-size: 500M | ||
key: ccache-${{ github.job }} | ||
- name: Build | ||
run: | | ||
cmake -S llvm -B build \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DLLVM_ENABLE_PROJECTS="clang;mlir" \ | ||
-DLLVM_ENABLE_ASSERTIONS=${{ matrix.assertions }} \ | ||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | ||
-DLLVM_TARGETS_TO_BUILD="X86;AArch64" \ | ||
-G Ninja | ||
cmake --build build --config Release -j $(nproc) | ||
- name: Test | ||
run: | | ||
cmake --build build --config Release -t \ | ||
check-llvm-compiler-course \ | ||
check-clang-compiler-course \ | ||
check-mlir-compiler-course -j $(nproc) | ||
macos-build: | ||
runs-on: macOS-latest | ||
strategy: | ||
matrix: | ||
assertions: [ON, OFF] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
- name: Setup environment | ||
run: | | ||
brew install \ | ||
ninja | ||
- name: Setup ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
max-size: 500M | ||
key: ccache-${{ github.job }} | ||
- name: Build | ||
run: | | ||
cmake -S llvm -B build \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DLLVM_ENABLE_PROJECTS="clang;mlir" \ | ||
-DLLVM_ENABLE_ASSERTIONS=${{ matrix.assertions }} \ | ||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | ||
-DLLVM_TARGETS_TO_BUILD="X86;AArch64" \ | ||
-G Ninja | ||
cmake --build build --config Release -j $(nproc) | ||
- name: Test | ||
run: | | ||
cmake --build build --config Release -t \ | ||
check-llvm-compiler-course \ | ||
check-clang-compiler-course \ | ||
check-mlir-compiler-course -j $(nproc) | ||
windows-build: | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
assertions: [ON, OFF] | ||
steps: | ||
- name: Setup Windows | ||
uses: llvm/actions/setup-windows@main | ||
with: | ||
arch: amd64 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ inputs.python_version }} | ||
- name: Install Ninja | ||
uses: llvm/actions/install-ninja@main | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 250 | ||
- name: Setup ccache | ||
uses: hendrikmuhs/ccache-action@v1 | ||
with: | ||
max-size: 2G | ||
variant: sccache | ||
- name: Build | ||
shell: bash | ||
id: build-llvm | ||
run: | | ||
builddir="$(pwd)"/build | ||
echo "llvm-builddir=$builddir" >> "$GITHUB_OUTPUT" | ||
cmake -G Ninja \ | ||
-B "$builddir" \ | ||
-S llvm \ | ||
-DLLVM_ENABLE_PROJECTS="clang" \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DLLVM_ENABLE_ASSERTIONS=${{ matrix.assertions }} \ | ||
-DLLDB_INCLUDE_TESTS=OFF \ | ||
-DCMAKE_C_COMPILER_LAUNCHER=sccache \ | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \ | ||
-DLLVM_TARGETS_TO_BUILD="X86;AArch64" \ | ||
${{ inputs.extra_cmake_args }} | ||
ninja -C "$builddir" all |
This file contains hidden or 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,43 @@ | ||
name: Static analysis | ||
on: [pull_request] | ||
|
||
jobs: | ||
clang-format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install clang-format | ||
run: | | ||
sudo apt-get install -y clang-format | ||
- name: Run clang-format | ||
run: | | ||
git-clang-format --diff `git merge-base ${GITHUB_SHA} ${GITHUB_BASE_REF}` | ||
clang-tidy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Update submodules | ||
run: git submodule update --init --recursive | ||
- name: ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
key: ${{ github.job }} | ||
- uses: ZedThree/[email protected] | ||
id: review | ||
with: | ||
build_dir: build | ||
cmake_command: cmake -S llvm -B build | ||
-DCMAKE_BUILD_TYPE=Release | ||
-DLLVM_ENABLE_PROJECTS='clang;mlir' | ||
-DLLVM_ENABLE_ASSERTIONS=ON | ||
-DCMAKE_C_COMPILER_LAUNCHER=ccache | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache | ||
-G Ninja | ||
config_file: .clang-tidy | ||
apt_packages: build-essential,ninja-build | ||
split_workflow: true | ||
env: | ||
CC: clang-16 | ||
CXX: clang++-16 |
This file contains hidden or 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,18 @@ | ||
name: "Label bot" | ||
on: [pull_request] | ||
|
||
jobs: | ||
label-bot: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
steps: | ||
- name: Check out repository | ||
uses: actions/[email protected] | ||
- name: Add labels | ||
uses: actions/labeler@v4 | ||
with: | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
configuration-path: ".github/labeler.yml" | ||
dot: true |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,5 @@ | ||
if (CLANG_PLUGIN_SUPPORT) | ||
list_subdirs(subdirs ${CMAKE_CURRENT_SOURCE_DIR}) | ||
add_subdirs(subdirs "COMPILER COURSE (ClangAST)") | ||
set(CLANG_TEST_DEPS ${CLANG_TEST_DEPS} PARENT_SCOPE) | ||
endif() |
This file contains hidden or 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,18 @@ | ||
set(Title "ExamplePlugin") | ||
set(Student "Ivanov_Ivan") | ||
set(Group "FIIT0") | ||
set(TARGET_NAME "${Title}_${Student}_${Group}_ClangAST") | ||
|
||
file(GLOB_RECURSE SOURCES *.cpp *.h *.hpp) | ||
add_llvm_library(${TARGET_NAME} MODULE ${SOURCES} PLUGIN_TOOL clang) | ||
|
||
if(WIN32 OR CYGWIN) | ||
set(LLVM_LINK_COMPONENTS Support) | ||
clang_target_link_libraries(${TARGET_NAME} PRIVATE | ||
clangAST | ||
clangBasic | ||
clangFrontend | ||
) | ||
endif() | ||
|
||
set(CLANG_TEST_DEPS "${TARGET_NAME}" ${CLANG_TEST_DEPS} PARENT_SCOPE) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.