Skip to content

Upgrade LLVM to v15 #791

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 2 commits into from
May 5, 2025
Merged
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 .github/scripts/ubuntu-22.04/setup_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Install required packages for CodeCompass build
sudo apt install git cmake make g++ libboost-all-dev \
llvm-11-dev clang-11 libclang-11-dev \
llvm-15-dev clang-15 libclang-15-dev \
gcc-11-plugin-dev thrift-compiler libthrift-dev \
default-jdk libssl-dev libgraphviz-dev libmagic-dev libgit2-dev exuberant-ctags doxygen \
libldap2-dev libgtest-dev
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ jobs:
-DCMAKE_INSTALL_PREFIX=$HOME/${{ matrix.os }}/${{ matrix.db }}/cc-install
-DDATABASE=$DB_TYPE
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
-DLLVM_DIR=/usr/lib/llvm-11/cmake
-DClang_DIR=/usr/lib/cmake/clang-11
-DLLVM_DIR=/usr/lib/llvm-15/cmake
-DClang_DIR=/usr/lib/cmake/clang-15
-DTEST_DB=$DB_CONNSTRING

- name: Build
Expand Down
8 changes: 4 additions & 4 deletions .gitlab/build-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ export PATH=$DEPS_INSTALL_RUNTIME_DIR/python-install/bin:$PATH

if [ ! -f $DEPS_INSTALL_RUNTIME_DIR/llvm-install/bin/clang ]; then
cd $PACKAGES_DIR
wget --no-verbose --no-clobber https://github.com/llvm/llvm-project/archive/llvmorg-11.1.0.tar.gz
tar -xf llvmorg-11.1.0.tar.gz
mv llvm-project-llvmorg-11.1.0 llvm-project
wget --no-verbose --no-clobber https://github.com/llvm/llvm-project/archive/llvmorg-15.0.7.tar.gz
tar -xf llvmorg-15.0.7.tar.gz
mv llvm-project-llvmorg-15.0.7 llvm-project
mkdir llvm-project/build
cd llvm-project/build

Expand All @@ -264,7 +264,7 @@ if [ ! -f $DEPS_INSTALL_RUNTIME_DIR/llvm-install/bin/clang ]; then
-DLLVM_ENABLE_RTTI=ON

make install --quiet --jobs $(nproc)
rm -f $PACKAGES_DIR/llvmorg-11.1.0.tar.gz
rm -f $PACKAGES_DIR/llvmorg-15.0.7.tar.gz
else
echo "Found LLVM/Clang in cache."
fi
Expand Down
8 changes: 4 additions & 4 deletions doc/deps.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ be installed from the official repository of the given Linux distribution.
is required. (Alternatively, you can compile with Clang.)
- **`gcc-X`, `gcc-X-plugin-dev`**: For building ODB.
- **`libboost-all-dev`**: Boost can be used during the development.
- **`llvm-11-dev`**, **`clang-11`**, **`libclang-11-dev`**: C++ parser uses
- **`llvm-15-dev`**, **`clang-15`**, **`libclang-15-dev`**: C++ parser uses
LLVM/Clang for parsing the source code.
- **`odb`**, **`libodb-dev`**: For persistence ODB can be used which is an
Object Relation Mapping (ORM) system.
Expand Down Expand Up @@ -55,7 +55,7 @@ known issues.

```bash
sudo apt install git cmake make g++ libboost-all-dev \
llvm-11-dev clang-11 libclang-11-dev \
llvm-15-dev clang-15 libclang-15-dev \
gcc-11-plugin-dev thrift-compiler libthrift-dev \
default-jdk libssl-dev libgraphviz-dev libmagic-dev libgit2-dev exuberant-ctags doxygen \
libldap2-dev libgtest-dev
Expand Down Expand Up @@ -210,8 +210,8 @@ cmake .. \
-DCMAKE_INSTALL_PREFIX=<CodeCompass_install_dir> \
-DDATABASE=<database_type> \
-DCMAKE_BUILD_TYPE=<build_type> \
-DLLVM_DIR=/usr/lib/llvm-11/cmake \
-DClang_DIR=/usr/lib/cmake/clang-11
-DLLVM_DIR=/usr/lib/llvm-15/cmake \
-DClang_DIR=/usr/lib/cmake/clang-15

# To specify linker for building CodeCompass use
# -DCODECOMPASS_LINKER=<path_to_linker>
Expand Down
6 changes: 3 additions & 3 deletions docker/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ RUN set -x && apt-get update -qq \
libmagic-dev \
libsqlite3-dev \
libssl-dev \
llvm-11 clang-11 llvm-11-dev libclang-11-dev \
llvm-15 clang-15 llvm-15-dev libclang-15-dev \
thrift-compiler libthrift-dev \
postgresql-server-dev-14 \
postgresql-14 && \
Expand Down Expand Up @@ -70,8 +70,8 @@ ENV DATABASE=sqlite \
TEST_WORKSPACE=/CodeCompass/test_workspace \
TEST_DB="sqlite:database=$TEST_WORKSPACE/cc_test.sqlite" \
WITH_AUTH="plain;ldap" \
LLVM_DIR=/usr/lib/llvm-11/cmake \
Clang_DIR=/usr/lib/cmake/clang-11 \
LLVM_DIR=/usr/lib/llvm-15/cmake \
Clang_DIR=/usr/lib/cmake/clang-15 \
CMAKE_PREFIX_PATH=/opt/odb

ENV PATH="$INSTALL_DIR/bin:/opt/odb/bin:$PATH"
2 changes: 1 addition & 1 deletion docker/runtime/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ RUN set -x && apt-get update -qq && \
apt-get install -qq --yes --no-install-recommends \
curl ca-certificates gnupg \
wget \
llvm-11 \
llvm-15 \
libboost-filesystem-dev libboost-log-dev libboost-program-options-dev \
default-jre \
libgit2-dev \
Expand Down
2 changes: 1 addition & 1 deletion docker/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ARG DEBIAN_FRONTEND=noninteractive

RUN set -x && apt-get update -qq \
&& apt-get install -qqy --no-install-recommends \
llvm-11 \
llvm-15 \
libboost-filesystem-dev libboost-log-dev libboost-program-options-dev \
libsqlite3-dev \
postgresql-server-dev-14 \
Expand Down
2 changes: 1 addition & 1 deletion plugins/cpp/parser/src/clangastvisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,7 @@ class ClangASTVisitor : public clang::RecursiveASTVisitor<ClangASTVisitor>
clang::DynTypedNodeList parents
= _astContext.getParents(*expr_);

const clang::ast_type_traits::DynTypedNode& parent = parents[0];
const clang::DynTypedNode& parent = parents[0];

if (const clang::BinaryOperator* op = parent.get<clang::BinaryOperator>())
{
Expand Down
2 changes: 1 addition & 1 deletion plugins/cpp/parser/src/ppincludecallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void PPIncludeCallback::InclusionDirective(
clang::StringRef fileName_,
bool,
clang::CharSourceRange filenameRange_,
const clang::FileEntry*,
clang::Optional<clang::FileEntryRef>,
clang::StringRef searchPath_,
clang::StringRef,
const clang::Module*,
Expand Down
2 changes: 1 addition & 1 deletion plugins/cpp/parser/src/ppincludecallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class PPIncludeCallback : public clang::PPCallbacks
clang::StringRef FileName,
bool IsAngled,
clang::CharSourceRange FilenameRange,
const clang::FileEntry *File,
clang::Optional<clang::FileEntryRef> File,
clang::StringRef SearchPath,
clang::StringRef RelativePath,
const clang::Module *Imported,
Expand Down