Skip to content
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

ci: support for llvm19 #52

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# [Choice] Debian / Ubuntu version (use Debian 11, Ubuntu 18.04/22.04 on local arm64/Apple Silicon): debian-11, debian-10, ubuntu-22.04, ubuntu-20.04, ubuntu-18.04
ARG IMAGE="ubuntu-22.04"
ARG LLVM_VERSION="18"
ARG LLVM_VERSION="19"

FROM mcr.microsoft.com/vscode/devcontainers/cpp:${IMAGE}
ARG LLVM_VERSION
Expand Down
5 changes: 3 additions & 2 deletions .devcontainer/install-llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ usage() {
exit 1;
}

CURRENT_LLVM_STABLE=18
CURRENT_LLVM_STABLE=19
BASE_URL="http://apt.llvm.org"

# Check for required tools
Expand Down Expand Up @@ -118,6 +118,7 @@ LLVM_VERSION_PATTERNS[15]="-15"
LLVM_VERSION_PATTERNS[16]="-16"
LLVM_VERSION_PATTERNS[17]="-17"
LLVM_VERSION_PATTERNS[18]="-18"
LLVM_VERSION_PATTERNS[19]="-19"

if [ ! ${LLVM_VERSION_PATTERNS[$LLVM_VERSION]+_} ]; then
echo "This script does not support LLVM version $LLVM_VERSION"
Expand Down Expand Up @@ -169,4 +170,4 @@ apt-get install -f -y $PKG
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-$LLVM_VERSION 60
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-$LLVM_VERSION 60

ln -s /usr/bin/FileCheck-$LLVM_VERSION /usr/bin/FileCheck
ln -s /usr/bin/FileCheck-$LLVM_VERSION /usr/bin/FileCheck
9 changes: 4 additions & 5 deletions .devcontainer/install-vast.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,18 @@ install_gap() {
git clone --recursive "$GAP_REPO" "$GAP_BUILD"
cd "$GAP_BUILD"
mkdir -p build && cd build
cmake -G Ninja .. -DGAP_ENABLE_MLIR=ON -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" -DMLIR_DIR="/usr/lib/llvm-18/lib/cmake/mlir"
cmake -G Ninja .. -DGAP_ENABLE_MLIR=ON -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" -DMLIR_DIR="/usr/lib/llvm-19/lib/cmake/mlir"
ninja && sudo ninja install
}

build_vast() {
echo "Cloning VAST repository..."
git clone --branch v0.0.33 --recursive "$VAST_REPO" "$BUILD_DIR"
git clone --branch v0.0.66 --recursive "$VAST_REPO" "$BUILD_DIR"

echo "Installing VAST..."
cd "$BUILD_DIR" && mkdir -p build && cd build
cmake -G Ninja .. -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" -DCMAKE_LINKER_TYPE=LLD -DMLIR_DIR="/usr/lib/llvm-18/lib/cmake/mlir"
cmake -G Ninja .. -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" -DCMAKE_LINKER_TYPE=LLD -DMLIR_DIR="/usr/lib/llvm-19/lib/cmake/mlir"
cmake --build . && sudo cmake --install .
cat CMakeCache.txt
}

clean_up() {
Expand All @@ -56,4 +55,4 @@ install_gap
build_vast
clean_up

echo "VAST has been successfully installed!"
echo "VAST has been successfully installed!"
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
build:
strategy:
matrix:
llvm-version: [18]
llvm-version: [19]
image-version: [22.04]
build-type: [Release, Debug]
sanitizers: [ON, OFF]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/devcontainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
build:
strategy:
matrix:
llvm-version: [18]
llvm-version: [19]
image-version: [22.04]
runs-on: ubuntu-22.04
timeout-minutes: 45
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ FindAndSelectClangCompiler()
#
# LLVM & MLIR & Clang
#
find_package(LLVM 18.1 REQUIRED CONFIG)
find_package(LLVM 19.1 REQUIRED CONFIG)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
Expand Down
2 changes: 1 addition & 1 deletion lib/patchestry/AST/TypeBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace patchestry::ast {
// Traverse through missing type definition for a composite type and create the complete
// definition for them
for (auto &[key, decl] : missing_type_definition) {
if (const auto *record_decl = llvm::dyn_cast< clang::RecordDecl >(decl)) {
if (llvm::isa< clang::RecordDecl >(decl)) {
auto iter = lifted_types.find(key);
// if type key does not exist in the lifted types, it could be a bug in create
// types.
Expand Down