Skip to content

Commit d9922da

Browse files
author
Martin Mory
committed
add LLVM 13 support
1 parent 9e486e0 commit d9922da

9 files changed

Lines changed: 30 additions & 17 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: true
1414
matrix:
15-
compiler: [ [clang++-12, clang-12] ]
15+
compiler: [ [clang++-13, clang-13] ]
1616
build: [ Debug, Release ]
1717

1818
continue-on-error: false
@@ -42,16 +42,16 @@ jobs:
4242
shell: bash
4343
run: |
4444
sudo apt-key adv --fetch-keys https://apt.llvm.org/llvm-snapshot.gpg.key
45-
sudo add-apt-repository -y 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-12 main'
45+
sudo add-apt-repository -y 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main'
4646
sudo apt-get update
4747
sudo apt-get -y install --no-install-recommends \
4848
${{ matrix.compiler[1] }} \
49-
llvm-12-dev \
50-
libllvm12 \
51-
libclang-common-12-dev \
52-
libclang-12-dev \
53-
libclang-cpp12-dev \
54-
clang-tidy-12
49+
llvm-13-dev \
50+
libllvm13 \
51+
libclang-common-13-dev \
52+
libclang-13-dev \
53+
libclang-cpp13-dev \
54+
clang-tidy-13
5555
5656
- name: Building Phasar in ${{ matrix.build }} with ${{ matrix.compiler[0] }}
5757
env:

.github/workflows/reviewdog-clang-format.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515
- tool: clang-format
1616
install: |
1717
sudo apt-key adv --fetch-keys https://apt.llvm.org/llvm-snapshot.gpg.key
18-
sudo add-apt-repository -y 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-12 main'
18+
sudo add-apt-repository -y 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main'
1919
sudo apt-get update
20-
sudo apt-get -y install --no-install-recommends clang-format-12
20+
sudo apt-get -y install --no-install-recommends clang-format-13
2121
regex: \.(h|c|hpp|cpp)$
22-
command: clang-format-12 --style=file -i
22+
command: clang-format-13 --style=file -i
2323

2424
continue-on-error: false
2525
steps:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ repos:
1010
- id: check-added-large-files
1111
- id: requirements-txt-fixer
1212
- repo: https://github.com/pre-commit/mirrors-clang-format
13-
rev: 'v12.0.1'
13+
rev: 'v13.0.0'
1414
hooks:
1515
- id: clang-format

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ include_directories(${SQLITE3_INCLUDE_DIR})
171171
# LLVM
172172
if (NOT PHASAR_IN_TREE)
173173
# Only search for LLVM if we build out of tree
174-
find_package(LLVM 12 REQUIRED CONFIG)
174+
find_package(LLVM 13 REQUIRED CONFIG)
175175
include_directories(${LLVM_INCLUDE_DIRS})
176176
link_directories(${LLVM_LIB_PATH} ${LLVM_LIBRARY_DIRS})
177177
endif()

Config.cmake.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ foreach(component ${phasar_FIND_COMPONENTS})
99
endforeach()
1010

1111
function(phasar_config executable)
12-
find_package(LLVM 12 REQUIRED CONFIG)
12+
find_package(LLVM 13 REQUIRED CONFIG)
1313
include_directories(${LLVM_INCLUDE_DIRS})
1414
link_directories(${LLVM_LIB_PATH} ${LLVM_LIBRARY_DIRS})
1515
find_library(LLVM_LIBRARY NAMES LLVM HINTS ${LLVM_LIBRARY_DIRS})

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Phasar requires C++-17.
2626

2727
Currently supported version of LLVM
2828
-----------------------------------
29-
Phasar is currently set up to support LLVM-12.0.
29+
Phasar is currently set up to support LLVM-13.0.
3030

3131
What is Phasar?
3232
---------------

bootstrap.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ source ./utils/safeCommandsSet.sh
55

66
readonly PHASAR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
77
readonly PHASAR_INSTALL_DIR="/usr/local/phasar"
8-
readonly LLVM_INSTALL_DIR="/usr/local/llvm-12"
8+
readonly LLVM_INSTALL_DIR="/usr/local/llvm-13"
99

1010
NUM_THREADS=$(nproc)
11-
LLVM_RELEASE=llvmorg-12.0.0
11+
LLVM_RELEASE=llvmorg-13.0.0
1212
DO_UNIT_TEST=true
1313

1414

include/phasar/Utils/BitVectorSet.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,11 @@ template <typename T> class BitVectorSet {
269269
[[nodiscard]] size_t size() const noexcept { return Bits.count(); }
270270

271271
friend bool operator==(const BitVectorSet &Lhs, const BitVectorSet &Rhs) {
272+
bool LeftEmpty = Lhs.empty();
273+
bool RightEmpty = Rhs.empty();
274+
if (LeftEmpty || RightEmpty) {
275+
return LeftEmpty == RightEmpty;
276+
}
272277
// Check, whether Lhs and Rhs actually have the same bits set and not
273278
// whether their internal representation is exactly identitcal
274279
auto LhsWords = Lhs.Bits.getData();

lib/PhasarLLVM/DataFlowSolver/IfdsIde/IFDSFieldSensTaintAnalysis/Utils/DataFlowUtils.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,10 @@ normalizeGlobalGEPs(const std::vector<const llvm::Value *> &MemLocationSeq) {
272272
GepInst->idx_end());
273273

274274
auto *SplittedGEPInst = llvm::GetElementPtrInst::CreateInBounds(
275+
NormalizedMemLocationSeq.back()
276+
->getType()
277+
->getScalarType()
278+
->getPointerElementType(),
275279
const_cast<llvm::Value *>(NormalizedMemLocationSeq.back()),
276280
{Indices[0], Indices[1]}, "gepsplit0");
277281
NormalizedMemLocationSeq.push_back(SplittedGEPInst);
@@ -286,6 +290,10 @@ normalizeGlobalGEPs(const std::vector<const llvm::Value *> &MemLocationSeq) {
286290
NameStream << "gepsplit" << (I - 1);
287291

288292
SplittedGEPInst = llvm::GetElementPtrInst::CreateInBounds(
293+
NormalizedMemLocationSeq.back()
294+
->getType()
295+
->getScalarType()
296+
->getPointerElementType(),
289297
const_cast<llvm::Value *>(NormalizedMemLocationSeq.back()),
290298
{ConstantZero, Index}, NameStream.str());
291299
NormalizedMemLocationSeq.push_back(SplittedGEPInst);

0 commit comments

Comments
 (0)