Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
c28f4ac
Build with LLVM 7.0 and add dependeefinder
TorunR Nov 15, 2018
491601d
Merge branch 'development' into slicing
TorunR Oct 15, 2019
9c9e86c
Merge branch 'development' into slicing
TorunR Nov 7, 2019
185b8e0
current state
TorunR Dec 5, 2019
55d07be
Merge branch 'development' into slicing
TorunR Dec 5, 2019
5c98000
Merge branch 'development' into slicing
TorunR Jun 12, 2020
26197f5
Current State
TorunR Jul 27, 2020
cfed252
Current state
TorunR Nov 3, 2020
b77e952
Before merge
TorunR Nov 5, 2020
0e0ce40
Merge branch 'development' into slicing
TorunR Nov 6, 2020
50a8245
Current state
TorunR Dec 4, 2020
a5ced92
State
TorunR Dec 13, 2020
3fd00d9
Move to SSA
TorunR Dec 14, 2020
12d09fd
Ignore Buildfolders
TorunR Dec 17, 2020
f87f19b
Refactor a bit
TorunR Dec 17, 2020
f55d183
Add targets
TorunR Dec 17, 2020
6ed6e68
Fix for GEP
TorunR Jan 18, 2021
d384d83
Fix some switch statements
TorunR Feb 19, 2021
63a2d50
Use clang to find correct Switch statements
TorunR Apr 1, 2021
9b8a2ea
Add targets
TorunR Jul 13, 2021
1b75afa
Add result comparator
TorunR Aug 27, 2021
ac2db1c
Add outpath for modules
TorunR Aug 27, 2021
4f79c9c
Update build for Ubuntu 21.10
jorickert Oct 29, 2021
d6dda79
Update llvm to llvm-10.0.1
jorickert Oct 29, 2021
6f84446
add tests
jorickert Nov 4, 2021
cb7cb6a
Extract clang parts to separate file
jorickert Nov 5, 2021
d3dac85
Add printer based slicing
jorickert Nov 16, 2021
889b582
Only print separators if required
jorickert Nov 17, 2021
8133dde
Add basic slicing extractor
jorickert Nov 25, 2021
bbf384b
Add Source Information based Slicer
jorickert Nov 30, 2021
acbe43e
Dont print empty lines
jorickert Dec 11, 2021
7cb4c9d
tmp
jorickert Dec 17, 2021
2da16b1
Merge Defines
jorickert Dec 17, 2021
0b4f15f
Add cuttoff for extracting new functions
jorickert Dec 17, 2021
0b2ce3f
Add functionality for extracting headers
jorickert Jan 5, 2022
27e3a99
extract includes
jorickert Jan 20, 2022
39d3fbe
cleanup includes
jorickert Jan 21, 2022
28f2737
Update the calls to iwyu to actually use the compile_commands.json
jorickert Jan 25, 2022
949189f
Revert "Update the calls to iwyu to actually use the compile_commands…
jorickert Jan 25, 2022
dde52bb
Revert "Revert "Update the calls to iwyu to actually use the compile_…
jorickert Jan 25, 2022
016fc28
Rollback accidentally comitted file
jorickert Jan 25, 2022
61bdaaf
Fix a bug with multiple variables in one line and try to finally fix …
jorickert Jan 31, 2022
4a9b281
Try to fix bug with semicolon in macros
jorickert Feb 2, 2022
e173bbb
Remove unused files
jorickert Feb 11, 2022
80366f2
Slice all slices into one file
jorickert Feb 14, 2022
44a1ac0
Cleanup unused code and add comments
jorickert Feb 15, 2022
4795ba0
Improve error message if iwyu is not found
jorickert Mar 30, 2022
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
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ CMakeCache.txt
!cmake/*.cmake
*.pc
Makefile
!targets/*/Makefile
!test/*/Makefile

# Unit test output
Expand All @@ -140,3 +141,10 @@ unittests/PhasarLLVM/ifdside/Problems/IFDSTaintAnalysisTest
unittests/PhasarLLVM/Pointer/LLVMTypeHierarchyTest
unittests/Utils/LLVMShorthandsTest
unittests/Utils/PAMMTest

cmake-build*/*

out
targets/parson/test
targets/parson/testcpp
targets/mini/test
12 changes: 8 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required (VERSION 3.0)

cmake_policy(SET CMP0060 NEW)
# Check if we build within the llvm source tree
if (DEFINED LLVM_MAIN_SRC_DIR)
set(PHASAR_IN_TREE 1)
Expand All @@ -14,6 +14,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS YES)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "ON")

set_property(GLOBAL PROPERTY TARGET_MESSAGES OFF)

Expand All @@ -22,9 +23,9 @@ if (NOT CMAKE_BUILD_TYPE)
default is 'Debug')" FORCE)
endif ()
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MP -fvisibility-inlines-hidden -fstack-protector-strong -ffunction-sections -fdata-sections -pipe -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MP -fvisibility-inlines-hidden -fstack-protector-strong -ffunction-sections -fdata-sections -fno-limit-debug-info -march=native -pipe -g")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MP -fvisibility-inlines-hidden -fstack-protector-strong -ffunction-sections -fdata-sections -pipe -march=native")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MP -fvisibility-inlines-hidden -fstack-protector-strong -ffunction-sections -fdata-sections -fno-limit-debug-info -pipe -march=native")
endif()

# Enable testing
Expand Down Expand Up @@ -135,6 +136,7 @@ if (NOT PHASAR_IN_TREE)
find_package(LLVM 10 REQUIRED CONFIG)
include_directories(${LLVM_INCLUDE_DIRS})
link_directories(${LLVM_LIB_PATH} ${LLVM_LIBRARY_DIRS})
message("Lib: ${LLVM_LIB_PATH} | ${LLVM_INCLUDE_DIRS} | ${LLVM_LIBRARY_DIRS}")
endif()

add_definitions(${LLVM_DEFINITIONS})
Expand Down Expand Up @@ -178,7 +180,8 @@ if(PHASAR_IN_TREE OR NEED_LIBCLANG_COMPONENT_LIBS)
clangASTMatchers
clangLex
clangBasic
LLVMFrontendOpenMP)
LLVMFrontendOpenMP
)
endif()
if (NOT PHASAR_IN_TREE)
# Only search for clang if we build out of tree
Expand Down Expand Up @@ -229,6 +232,7 @@ llvm_map_components_to_libnames(llvm_libs
${LLVM_LINK_COMPONENTS}
)


# phasar-based binaries
add_subdirectory(tools)

Expand Down
2 changes: 1 addition & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ readonly PHASAR_INSTALL_DIR="/usr/local/phasar"
readonly LLVM_INSTALL_DIR="/usr/local/llvm-10"

NUM_THREADS=$(nproc)
LLVM_RELEASE=llvmorg-10.0.0
LLVM_RELEASE=llvmorg-10.0.1
DO_UNIT_TEST=false


Expand Down
13 changes: 13 additions & 0 deletions include/phasar/PhasarLLVM/ControlFlow/LLVMBasedCFG.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
#ifndef PHASAR_PHASARLLVM_CONTROLFLOW_LLVMBASEDCFG_H_
#define PHASAR_PHASARLLVM_CONTROLFLOW_LLVMBASEDCFG_H_

#include <map>

#include <iostream>

#include <set>
#include <string>
#include <vector>
Expand All @@ -27,6 +30,7 @@
namespace llvm {
class Function;
class Instruction;
class BasicBlock;
} // namespace llvm

namespace psr {
Expand Down Expand Up @@ -71,6 +75,15 @@ class LLVMBasedCFG

[[nodiscard]] bool isFieldStore(const llvm::Instruction *Stmt) const override;

static std::map<const llvm::BasicBlock *, std::set<const llvm::BasicBlock *>>
getNonTerminationSensitiveControlDependence(const llvm::Function &fun);

static std::map<const llvm::BasicBlock *, std::set<const llvm::BasicBlock *>>
getNonTerminationInsensitiveControlDependence(const llvm::Function &fun);

static std::map<const llvm::BasicBlock *, std::set<const llvm::BasicBlock *>>
getDecisiveControlDependence(const llvm::Function &fun);

[[nodiscard]] bool
isFallThroughSuccessor(const llvm::Instruction *Stmt,
const llvm::Instruction *succ) const override;
Expand Down
2 changes: 1 addition & 1 deletion include/phasar/Utils/LLVMIRToSrc.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ unsigned int getColumnFromIR(const llvm::Value *V);
std::string getSrcCodeFromIR(const llvm::Value *V);

std::string getModuleIDFromIR(const llvm::Value *V);

unsigned int getFunctionHeaderLines(const llvm::Value *V);
} // namespace psr

#endif
1 change: 1 addition & 0 deletions lib/DB/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ include_directories(
${SQLITE3_INCLUDE_DIR}
)


set(PHASAR_LINK_LIBS
phasar_pointer
phasar_typehierarchy
Expand Down
4 changes: 4 additions & 0 deletions lib/DB/DBConn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,11 @@ bool DBConn::insertModule(const string &ProjectName,
string identifier(module->getModuleIdentifier());
string ir_mod_buffer;
llvm::raw_string_ostream rso(ir_mod_buffer);
#if LLVM_VERSION_MAJOR < 7
llvm::WriteBitcodeToFile(module, rso);
#else
llvm::WriteBitcodeToFile(*module, rso);
#endif
rso.flush();
istringstream ist(ir_mod_buffer);
size_t hash_value = hash<string>()(ir_mod_buffer);
Expand Down
7 changes: 3 additions & 4 deletions lib/DB/ProjectIRDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <algorithm>
#include <cassert>
#include <iostream>

#include <string>

#include "llvm/Bitcode/BitcodeReader.h"
Expand Down Expand Up @@ -39,6 +40,7 @@
#include "phasar/Utils/PAMMMacros.h"
#include "phasar/Utils/Utilities.h"


using namespace psr;
using namespace std;

Expand All @@ -61,10 +63,7 @@ ProjectIRDB::ProjectIRDB(const std::vector<std::string> &IRFiles,
: ProjectIRDB(Options | IRDBOptions::OWNS) {
for (const auto &File : IRFiles) {
// if we have a file that is already compiled to llvm ir
if ((File.find(".ll") != std::basic_string<char, std::char_traits<char>,
std::allocator<char>>::npos ||
File.find(".bc") != std::basic_string<char, std::char_traits<char>,
std::allocator<char>>::npos) &&
if ((File.find(".ll") != File.npos || File.find(".bc") != File.npos) &&
boost::filesystem::exists(File)) {
llvm::SMDiagnostic Diag;
std::unique_ptr<llvm::LLVMContext> C(new llvm::LLVMContext);
Expand Down
Loading