Skip to content

Commit ab55416

Browse files
committed
Upgrade to LLVM 10
The `LT_OPT_PIPELINE_REG` CMake flag and the corresponding workaround for pass auto-registration has been removed. The corresponding issue in LLVM has been fixed: llvm/llvm-project@52c1d20
1 parent 264a1f8 commit ab55416

13 files changed

+82
-107
lines changed

.github/workflows/x86-darwin-llvm-from-sources.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
export PATH=$GITHUB_WORKSPACE:$PATH
3131
git clone https://github.com/llvm/llvm-project
3232
cd llvm-project
33-
git checkout release/9.x
33+
git checkout release/10.x
3434
mkdir build && cd build
3535
cmake -G Ninja -D CMAKE_MAKE_PROGRAM=$GITHUB_WORKSPACE/ninja \
3636
-DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang" \

.github/workflows/x86-darwin.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,21 @@ jobs:
99
- uses: actions/checkout@v1
1010
- name: Install Dependencies
1111
run: |
12-
brew install llvm@9
12+
brew update
13+
brew install llvm@10
14+
brew upgrade llvm
1315
pip install lit
16+
ls /usr/local/opt/
1417
- name: Build HelloWorld
1518
run: |
1619
cd HelloWorld
1720
mkdir build && cd build
18-
cmake -DLT_LLVM_INSTALL_DIR="/usr/local/opt/llvm@9/" ../
21+
cmake -DLT_LLVM_INSTALL_DIR="/usr/local/opt/llvm/" ../
1922
make -j2
2023
- name: Build llvm-tutor + run tests
2124
run: |
2225
cd $GITHUB_WORKSPACE
2326
mkdir build && cd build
24-
cmake -DLT_LLVM_INSTALL_DIR="/usr/local/opt/llvm@9/" ../
27+
cmake -DLT_LLVM_INSTALL_DIR="/usr/local/opt/llvm/" ../
2528
make -j2
2629
lit test/

.github/workflows/x86-ubuntu-llvm-from-sources.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
export PATH=$GITHUB_WORKSPACE:$PATH
3131
git clone https://github.com/llvm/llvm-project
3232
cd llvm-project
33-
git checkout release/9.x
33+
git checkout release/10.x
3434
mkdir build && cd build
3535
ln -s /usr/bin/x86_64-linux-gnu-ld.gold ld
3636
cmake -G Ninja -D CMAKE_MAKE_PROGRAM=$GITHUB_WORKSPACE/ninja \

.github/workflows/x86-ubuntu.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ jobs:
1010
- name: Install Dependencies
1111
run: |
1212
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
13-
sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main"
13+
sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main"
1414
sudo apt-get update
15-
sudo apt-get install -y llvm-9 llvm-9-dev clang-9 llvm-9-tools
15+
sudo apt-get install -y llvm-10 llvm-10-dev clang-10 llvm-10-tools
1616
sudo pip install lit
1717
- name: Build HelloWorld
1818
run: |
1919
cd HelloWorld
2020
mkdir build && cd build
21-
cmake -DLT_LLVM_INSTALL_DIR="/usr/lib/llvm-9/" ../
21+
cmake -DLT_LLVM_INSTALL_DIR="/usr/lib/llvm-10/" ../
2222
make -j2
2323
- name: Build llvm-tutor + run tests
2424
run: |
2525
cd $GITHUB_WORKSPACE
2626
mkdir build && cd build
27-
cmake -DLT_LLVM_INSTALL_DIR="/usr/lib/llvm-9/" ../
27+
cmake -DLT_LLVM_INSTALL_DIR="/usr/lib/llvm-10/" ../
2828
make -j2
2929
lit test/

.travis.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ addons:
66
apt:
77
update: true
88
sources:
9-
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
9+
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main'
1010
key_url: 'http://apt.llvm.org/llvm-snapshot.gpg.key'
1111
packages:
12-
- llvm-9
13-
- llvm-9-dev
14-
- llvm-9-tools
15-
- clang-9
12+
- llvm-10
13+
- llvm-10-dev
14+
- llvm-10-tools
15+
- clang-10
1616

1717
env:
1818
- CONFIGURATION=Debug
@@ -31,12 +31,12 @@ script:
3131
# Build HelloWorld as a standalone project
3232
- cd HelloWorld
3333
- mkdir build && cd build
34-
- cmake -DLT_LLVM_INSTALL_DIR=/usr/lib/llvm-9/ -DCMAKE_BUILD_TYPE=$CONFIGURATION ../
34+
- cmake -DLT_LLVM_INSTALL_DIR=/usr/lib/llvm-10/ -DCMAKE_BUILD_TYPE=$CONFIGURATION ../
3535
- make -j4
3636
# Build the top project and run tests
3737
- cd ../../
3838
- mkdir build
3939
- cd build
40-
- cmake -DLT_LLVM_INSTALL_DIR=/usr/lib/llvm-9/ -DCMAKE_BUILD_TYPE=$CONFIGURATION ../
40+
- cmake -DLT_LLVM_INSTALL_DIR=/usr/lib/llvm-10/ -DCMAKE_BUILD_TYPE=$CONFIGURATION ../
4141
- make -j4
4242
- lit test/

CMakeLists.txt

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ endif()
2828
# find_package can locate it)
2929
list(APPEND CMAKE_PREFIX_PATH "${LT_LLVM_INSTALL_DIR}/lib/cmake/llvm/")
3030

31-
find_package(LLVM 9.0.0 REQUIRED CONFIG)
31+
find_package(LLVM 10.0.0 REQUIRED CONFIG)
3232
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
3333
message(STATUS "Using LLVMConfig.cmake in: ${LT_LLVM_INSTALL_DIR}")
3434

@@ -74,23 +74,6 @@ if (${SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG} EQUAL "1")
7474
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden")
7575
endif()
7676

77-
# WARNING: Keep this turned off unless building LLVM from sources. When using
78-
# LLVM installed with HomeBrew (MacOS) or apt-get (Ubuntu), auto-registration
79-
# leads to a seg-fault. This is a known issue:
80-
# * https://github.com/sampsyo/llvm-pass-skeleton/issues/7
81-
# * https://bugs.llvm.org/show_bug.cgi?id=39321
82-
OPTION(LT_OPT_PIPELINE_REG "Auto-register OpcodeCounter with the optimisation pipelines" OFF)
83-
84-
# Canonicalise LT_OPT_PIPELINE_REG as either 1 (On) or 0 (Off). This way we can
85-
# keep the implementation in lit.cfg.py.in (which uses it) clean and
86-
# straightforward.
87-
if(${LT_OPT_PIPELINE_REG})
88-
set(LT_OPT_PIPELINE_REG 1)
89-
add_definitions(-DLT_OPT_PIPELINE_REG)
90-
else()
91-
set(LT_OPT_PIPELINE_REG 0)
92-
endif()
93-
9477
# Set the build directories
9578
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
9679
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")

HelloWorld/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set(LT_LLVM_INSTALL_DIR "" CACHE PATH "LLVM installation directory")
1111
# find_package can locate it)
1212
list(APPEND CMAKE_PREFIX_PATH "${LT_LLVM_INSTALL_DIR}/lib/cmake/llvm/")
1313

14-
find_package(LLVM 9.0.0 REQUIRED CONFIG)
14+
find_package(LLVM 10.0.0 REQUIRED CONFIG)
1515

1616
# HelloWorld includes headers from LLVM - update the include paths accordingly
1717
include_directories(${LLVM_INCLUDE_DIRS})

0 commit comments

Comments
 (0)