Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
4 changes: 2 additions & 2 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
- name: Build Doxygen Docs
shell: bash
env:
CXX: clang++-15
CC: clang-15
CXX: clang++-16
CC: clang-16
run: |
cmake -S . -B build -DPHASAR_BUILD_DOC=ON
cmake --build ./build --target doc_doxygen
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ option(USE_LLVM_FAT_LIB "Link against libLLVM.so instead of the individual LLVM

# LLVM
if (NOT PHASAR_LLVM_VERSION)
set(PHASAR_LLVM_VERSION 15)
set(PHASAR_LLVM_VERSION 16)
endif()
include(add_llvm)
add_llvm()
Expand Down
4 changes: 2 additions & 2 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ source ./utils/safeCommandsSet.sh

readonly PHASAR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
PHASAR_INSTALL_DIR="/usr/local/phasar"
LLVM_INSTALL_DIR="/usr/local/llvm-15"
LLVM_INSTALL_DIR="/usr/local/llvm-16"

NUM_THREADS=$(nproc)
LLVM_RELEASE=llvmorg-15.0.7
LLVM_RELEASE=llvmorg-16.0.6
DO_UNIT_TEST=true
DO_INSTALL=false
BUILD_TYPE=Release
Expand Down
4 changes: 2 additions & 2 deletions cmake/phasar_macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function(generate_ll_file)
NAMES clang++-${PHASAR_LLVM_VERSION} clang++
HINTS ${binary_hint_paths})
find_program(opt REQUIRED
NAMES opt-${PHASAR_LLVM_VERSION}4 opt
NAMES opt-${PHASAR_LLVM_VERSION} opt
HINTS ${binary_hint_paths})

set(IS_VALID_VERSION "")
Expand Down Expand Up @@ -212,7 +212,7 @@ function(generate_ll_file)
add_custom_command(
OUTPUT ${test_code_ll_file}
COMMAND ${GEN_CMD} ${test_code_file_path} -o ${test_code_ll_file}
COMMAND ${CMAKE_CXX_COMPILER_LAUNCHER} ${opt} -mem2reg -S ${test_code_ll_file} -o ${test_code_ll_file}
COMMAND ${CMAKE_CXX_COMPILER_LAUNCHER} ${opt} -p mem2reg -S ${test_code_ll_file} -o ${test_code_ll_file}
COMMENT ${GEN_CMD_COMMENT}
DEPENDS ${GEN_LL_FILE}
VERBATIM
Expand Down
1 change: 1 addition & 0 deletions include/phasar/ControlFlow/CallGraphData.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#define PHASAR_PHASARLLVM_CONTROLFLOW_CALLGRAPHDATA_H

#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/raw_ostream.h"

#include <string>
Expand Down
2 changes: 1 addition & 1 deletion include/phasar/DataFlow/IfdsIde/EdgeFunctionUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ template <typename L, uint8_t N> struct JoinEdgeFunction {
if (const auto *Join = llvm::dyn_cast<JoinEdgeFunction>(EF)) {
return {Join->OtherEF, Join->Seed};
}
return {llvm::makeArrayRef(EF), JLattice::top()};
return {llvm::ArrayRef(EF), JLattice::top()};
};

auto [LVec, LSeed] = GetEFArrayAndSeed(LHS);
Expand Down
32 changes: 27 additions & 5 deletions include/phasar/PhasarLLVM/DB/LLVMProjectIRDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,17 @@ class LLVMProjectIRDB : public ProjectIRDBBase<LLVMProjectIRDB> {
/// Reads and parses the given LLVM IR file and owns the resulting IR Module.
/// If an error occurs, an error message is written to stderr and subsequent
/// calls to isValid() return false.
explicit LLVMProjectIRDB(const llvm::Twine &IRFileName);

/// Reads and parses the given LLVM IR file and owns the resulting IR Module.
/// If an error occurs, an error message is written to stderr and subsequent
/// calls to isValid() return false.
[[deprecated("When moving to the next LLVM version, opaque pointers support "
"is removed completely. Please use one of the other "
"constructors of LLVMProjectIRDB.")]]
explicit LLVMProjectIRDB(const llvm::Twine &IRFileName,
bool EnableOpaquePointers = LLVM_VERSION_MAJOR > 14);
bool EnableOpaquePointers);

/// Initializes the new ProjectIRDB with the given IR Module _without_ taking
/// ownership. The module is optionally being preprocessed.
///
Expand All @@ -68,8 +77,16 @@ class LLVMProjectIRDB : public ProjectIRDBBase<LLVMProjectIRDB> {
/// Parses the given LLVM IR file and owns the resulting IR Module.
/// If an error occurs, an error message is written to stderr and subsequent
/// calls to isValid() return false.
explicit LLVMProjectIRDB(llvm::MemoryBufferRef Buf);

/// Parses the given LLVM IR file and owns the resulting IR Module.
/// If an error occurs, an error message is written to stderr and subsequent
/// calls to isValid() return false.
[[deprecated("When moving to the next LLVM version, opaque pointers support "
"is removed completely. Please use one of the other "
"constructors of LLVMProjectIRDB.")]]
explicit LLVMProjectIRDB(llvm::MemoryBufferRef Buf,
bool EnableOpaquePointers = LLVM_VERSION_MAJOR > 14);
bool EnableOpaquePointers);

LLVMProjectIRDB(const LLVMProjectIRDB &) = delete;
LLVMProjectIRDB &operator=(const LLVMProjectIRDB &) = delete;
Expand All @@ -87,8 +104,13 @@ class LLVMProjectIRDB : public ProjectIRDBBase<LLVMProjectIRDB> {
llvm::LLVMContext &Ctx) noexcept;

[[nodiscard]] static llvm::ErrorOr<LLVMProjectIRDB>
load(const llvm::Twine &IRFileName,
bool EnableOpaquePointers = LLVM_VERSION_MAJOR > 14);
load(const llvm::Twine &IRFileName);

[[deprecated("When moving to the next LLVM version, opaque pointers support "
"is removed completely. Please use one of the other "
"constructors of LLVMProjectIRDB.")]] [[nodiscard]]
static llvm::ErrorOr<LLVMProjectIRDB> load(const llvm::Twine &IRFileName,
bool EnableOpaquePointers);

/// Also use the const overload
using ProjectIRDBBase::getFunction;
Expand Down Expand Up @@ -161,7 +183,7 @@ class LLVMProjectIRDB : public ProjectIRDBBase<LLVMProjectIRDB> {

[[nodiscard]] auto getAllInstructionsImpl() const noexcept {
return llvm::map_range(
llvm::makeArrayRef(IdToInst).drop_front(IdOffset),
llvm::ArrayRef(IdToInst).drop_front(IdOffset),
[](const llvm::Value *V) { return llvm::cast<llvm::Instruction>(V); });
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#include "phasar/Utils/TypeTraits.h"

#include "llvm/ADT/FunctionExtras.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/bit.h"

#include <cstdint>
#include <functional>
Expand All @@ -48,7 +48,7 @@ struct IDEFeatureTaintEdgeFact {
}
#endif

llvm::SmallBitVector Ret(llvm::findLastSet(Bits) + 1);
llvm::SmallBitVector Ret(llvm::bit_width(Bits));
Ret.setBitsInMask((const uint32_t *)&Bits, sizeof(Bits));
return Ret;
}
Expand All @@ -62,7 +62,7 @@ struct IDEFeatureTaintEdgeFact {
explicit IDEFeatureTaintEdgeFact() noexcept { Taints.invalid(); }

void unionWith(uintptr_t Facts) {
auto RequiredSize = llvm::findLastSet(Facts) + 1;
size_t RequiredSize = llvm::bit_width(Facts);
if (RequiredSize > Taints.size()) {
Taints.resize(RequiredSize);
}
Expand Down Expand Up @@ -247,7 +247,7 @@ class FeatureTaintGenerator {
FeatureTaintGenerator(EdgeFactGenerator &&EFGen)
: FeatureTaintGenerator(
[EFGen](InstOrGlobal IG) {
return !llvm::empty(std::invoke(EFGen, IG));
return !std::empty(std::invoke(EFGen, IG));
},
std::forward<EdgeFactGenerator>(EFGen)) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "llvm/Support/raw_os_ostream.h"
#include "llvm/Support/raw_ostream.h"

#include <cmath>
#include <variant>

namespace psr::glca {
Expand Down
2 changes: 2 additions & 0 deletions include/phasar/PhasarLLVM/HelperAnalyses.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include "phasar/PhasarLLVM/HelperAnalysisConfig.h"
#include "phasar/PhasarLLVM/Pointer/LLVMAliasSetData.h"

#include "llvm/ADT/Twine.h"

#include <memory>
#include <optional>
#include <vector>
Expand Down
1 change: 1 addition & 0 deletions include/phasar/PhasarLLVM/Pointer/LLVMAliasSetData.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#ifndef PHASAR_PHASARLLVM_TYPEHIERARCHY_LLVMALIASSETDATA_H
#define PHASAR_PHASARLLVM_TYPEHIERARCHY_LLVMALIASSETDATA_H

#include "llvm/ADT/Twine.h"
#include "llvm/Support/raw_ostream.h"

#include <string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#ifndef PHASAR_PHASARLLVM_TYPEHIERARCHY_LLVMVFTABLEDATA_H_
#define PHASAR_PHASARLLVM_TYPEHIERARCHY_LLVMVFTABLEDATA_H_

#include "llvm/ADT/Twine.h"
#include "llvm/Support/raw_ostream.h"

#include <string>
Expand Down
Loading
Loading