Skip to content

Commit 27ee359

Browse files
committed
Merge branch 'development' into f-RedesignICFG
2 parents 15222ff + 7b7c8de commit 27ee359

87 files changed

Lines changed: 1233 additions & 2937 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-tidy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Checks: '-*,
1515
-readability-function-cognitive-complexity,
1616
-readability-convert-member-functions-to-static,
1717
-readability-isolate-declaration,
18-
-readability-identifier-length,
1918
cppcoreguidelines-*,
2019
-cppcoreguidelines-avoid-non-const-global-variables,
2120
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,

.docker/Dockerfile.devenv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ USER vscode
1616

1717
ENV CC "/usr/bin/clang-14"
1818
ENV CXX "/usr/bin/clang++-14"
19+
ENV PATH "/usr/local/llvm-14/bin:/home/vscode/.local/bin:$PATH"
1920
ENV CMAKE_GENERATOR "Ninja"

.github/workflows/docker.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Docker Image
2+
3+
on:
4+
push:
5+
branches: [ development ]
6+
7+
jobs:
8+
push_to_registries:
9+
name: Push Docker image to multiple registries
10+
runs-on: ubuntu-latest
11+
permissions:
12+
packages: write
13+
contents: read
14+
steps:
15+
- name: Check out the repo
16+
uses: actions/checkout@v3
17+
- name: Set up QEMU
18+
uses: docker/setup-qemu-action@v2
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v2
21+
# If we want to publish an image of PhASAR to the official docker hub we
22+
# can just use the following code and set the corresponding secrets.
23+
# - name: Log in to Docker Hub
24+
# uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
25+
# with:
26+
# username: ${{ secrets.DOCKER_USERNAME }}
27+
# password: ${{ secrets.DOCKER_TOKEN }}
28+
29+
- name: Log in to the Container registry
30+
uses: docker/login-action@v2
31+
with:
32+
registry: ghcr.io
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Extract metadata (tags, labels) for Docker
37+
id: meta
38+
uses: docker/metadata-action@v4
39+
with:
40+
images: ghcr.io/${{ github.repository }}
41+
# here we could add a second image for the official docker registry
42+
# sse/phasar
43+
- name: Build and push Docker images
44+
uses: docker/build-push-action@v3
45+
with:
46+
context: .
47+
platforms: linux/amd64,linux/arm64
48+
push: true
49+
tags: ${{ steps.meta.outputs.tags }}
50+
labels: ${{ steps.meta.outputs.labels }}

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
path = external/googletest
77
url = https://github.com/google/googletest.git
88
branch = master
9-
[submodule "external/WALi-OpenNWA"]
10-
path = external/WALi-OpenNWA
11-
url = https://github.com/pdschubert/WALi-OpenNWA.git
129
[submodule "external/json-schema-validator"]
1310
path = external/json-schema-validator
1411
url = https://github.com/pboettch/json-schema-validator.git

CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "Debug")
3131
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MP -fvisibility-inlines-hidden -fstack-protector-strong -ffunction-sections -fdata-sections -pipe -g")
3232
else()
3333
message(STATUS "Selected Release Build")
34-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MP -fvisibility-inlines-hidden -fstack-protector-strong -ffunction-sections -fdata-sections -pipe -march=native")
34+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MP -fvisibility-inlines-hidden -fstack-protector-strong -ffunction-sections -fdata-sections -pipe")
3535
endif()
3636

3737
# Enable testing
@@ -243,10 +243,6 @@ if (PHASAR_IN_TREE)
243243
)
244244
endif()
245245

246-
# WALi-OpenNWA
247-
add_subdirectory(external/WALi-OpenNWA)
248-
include_directories(external/WALi-OpenNWA/Source/wali/include)
249-
250246
# Set up clang-tidy to run during PhASAR's compilation to indicate code smells
251247
if (PHASAR_ENABLE_CLANG_TIDY_DURING_BUILD)
252248
message(STATUS "Enabled clang-tidy during build")

Dockerfile

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,61 @@
1-
FROM ubuntu:20.04
2-
ARG LLVM_INSTALL_DIR="/usr/local/llvm-12"
1+
FROM ubuntu:22.04
2+
ARG LLVM_INSTALL_DIR="/usr/local/llvm-14"
33
LABEL Name=phasar Version=1.0.0
44

55
RUN apt -y update && apt install bash sudo -y
66

7+
78
WORKDIR /usr/src/phasar
89
RUN mkdir -p /usr/src/phasar/utils
910

1011
COPY ./utils/InitializeEnvironment.sh /usr/src/phasar/utils/
1112
RUN ./utils/InitializeEnvironment.sh
1213

14+
RUN apt-get -y install --no-install-recommends \
15+
cmake \
16+
ninja-build \
17+
libstdc++6 \
18+
libboost-all-dev
19+
1320
COPY ./utils/InstallAptDependencies.sh /usr/src/phasar/utils/
1421
RUN ./utils/InstallAptDependencies.sh
1522

23+
RUN apt-get update && \
24+
apt-get install -y software-properties-common
25+
26+
RUN apt-key adv --fetch-keys https://apt.llvm.org/llvm-snapshot.gpg.key && \
27+
add-apt-repository -y 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main' && \
28+
apt-get update && \
29+
apt-get -y install --no-install-recommends \
30+
clang-14 \
31+
llvm-14-dev \
32+
libllvm14 \
33+
libclang-common-14-dev \
34+
libclang-14-dev \
35+
libclang-cpp14-dev \
36+
clang-tidy-14
37+
1638
RUN pip3 install Pygments pyyaml
1739

1840
# installing boost
1941
RUN apt install libboost-all-dev -y
2042

21-
# installing LLVM
22-
COPY utils/safeCommandsSet.sh /usr/src/phasar/utils/safeCommandsSet.sh
23-
COPY utils/install-llvm.sh /usr/src/phasar/utils/install-llvm.sh
24-
RUN ./utils/install-llvm.sh $(nproc) . ${LLVM_INSTALL_DIR} "llvmorg-12.0.0"
2543

2644
# installing wllvm
2745
RUN pip3 install wllvm
2846

29-
ENV CC=${LLVM_INSTALL_DIR}/bin/clang
30-
ENV CXX=${LLVM_INSTALL_DIR}/bin/clang++
31-
ENV LD_LIBRARY_PATH=${LLVM_INSTALL_DIR}/lib:$LD_LIBRARY_PATH
47+
ENV CC=/usr/bin/clang-14
48+
ENV CXX=/usr/bin/clang++-14
3249

3350
COPY . /usr/src/phasar
3451

3552
RUN git submodule init
3653
RUN git submodule update
37-
RUN mkdir -p build && \
38-
cd build && \
39-
cmake -DCMAKE_BUILD_TYPE=Release .. && \
40-
make -j $(nproc) && \
41-
make install && \
42-
ldconfig
54+
RUN mkdir -p build && cd build && \
55+
cmake .. \
56+
-DCMAKE_BUILD_TYPE=Release \
57+
-DCMAKE_CXX_COMPILER=$CXX \
58+
-G Ninja && \
59+
cmake --build .
4360

4461
ENTRYPOINT [ "./build/tools/phasar-llvm/phasar-llvm" ]

LICENSE.txt

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -99,36 +99,6 @@ pyyaml tests llvm/test/YAMLParser/{*.data, LICENSE.TXT}
9999
ARM contributions llvm/lib/Target/ARM/LICENSE.TXT
100100
md5 contributions llvm/lib/Support/MD5.cpp llvm/include/llvm/Support/MD5.h
101101

102-
103-
WALi-OpenNWA
104-
-------------------------------------------------------------------------------
105-
OpenNWA portions:
106-
Copyright (c) 2009-2012 Amanda Burton, Evan Driscoll, Aditya Thakur,
107-
and Thomas Reps
108-
109-
WALi portions:
110-
Copyright (c) 2010 Nicholas Kidd, Akash Lal, and Thomas Reps
111-
Copyright (c) 2007 Nicholas Kidd, Akash Lal, and Thomas Reps
112-
113-
Permission is hereby granted, free of charge, to any person obtaining a copy
114-
of this software and associated documentation files (the "Software"), to deal
115-
in the Software without restriction, including without limitation the rights
116-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
117-
copies of the Software, and to permit persons to whom the Software is
118-
furnished to do so, subject to the following conditions:
119-
120-
The above copyright notice and this permission notice shall be included in
121-
all copies or substantial portions of the Software.
122-
123-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
124-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
125-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
126-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
127-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
128-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
129-
THE SOFTWARE.
130-
131-
132102
Boost
133103
-------------------------------------------------------------------------------
134104
Boost Software License - Version 1.0 - August 17th, 2003

external/WALi-OpenNWA

Lines changed: 0 additions & 1 deletion
This file was deleted.

include/phasar/Controller/AnalysisController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ enum class AnalysisControllerEmitterOptions : uint32_t {
4949
EmitPTAAsText = (1 << 11),
5050
EmitPTAAsDot = (1 << 12),
5151
EmitPTAAsJson = (1 << 13),
52-
EmitStatisticAsJson = (1 << 14),
52+
EmitStatisticsAsJson = (1 << 14),
5353
};
5454

5555
class AnalysisController {

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/EdgeFunctions.h

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class AllTop : public EdgeFunction<L>,
120120
const L TopElement;
121121

122122
public:
123-
AllTop(const L TopElement) : TopElement(std::move(TopElement)) {}
123+
AllTop(L TopElement) : TopElement(std::move(TopElement)) {}
124124

125125
~AllTop() override = default;
126126

@@ -161,33 +161,18 @@ class AllBottom : public EdgeFunction<L>,
161161
const L BottomElement;
162162

163163
public:
164-
AllBottom(const L BottomElement) : BottomElement(std::move(BottomElement)) {}
164+
AllBottom(L BottomElement) : BottomElement(std::move(BottomElement)) {}
165165

166166
~AllBottom() override = default;
167167

168168
L computeTarget(L /*Source*/) override { return BottomElement; }
169169

170-
EdgeFunctionPtrType composeWith(EdgeFunctionPtrType SecondFunction) override {
171-
if (auto *AB = dynamic_cast<AllBottom<L> *>(SecondFunction.get())) {
172-
return this->shared_from_this();
173-
}
174-
if (auto *EI = dynamic_cast<EdgeIdentity<L> *>(SecondFunction.get())) {
175-
return this->shared_from_this();
176-
}
177-
return SecondFunction->composeWith(this->shared_from_this());
170+
EdgeFunctionPtrType
171+
composeWith(EdgeFunctionPtrType /*SecondFunction*/) override {
172+
return this->shared_from_this();
178173
}
179174

180-
EdgeFunctionPtrType joinWith(EdgeFunctionPtrType OtherFunction) override {
181-
if (OtherFunction.get() == this ||
182-
OtherFunction->equal_to(this->shared_from_this())) {
183-
return this->shared_from_this();
184-
}
185-
if (auto *Alltop = dynamic_cast<AllTop<L> *>(OtherFunction.get())) {
186-
return this->shared_from_this();
187-
}
188-
if (auto *EI = dynamic_cast<EdgeIdentity<L> *>(OtherFunction.get())) {
189-
return this->shared_from_this();
190-
}
175+
EdgeFunctionPtrType joinWith(EdgeFunctionPtrType /*OtherFunction*/) override {
191176
return this->shared_from_this();
192177
}
193178

0 commit comments

Comments
 (0)