-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into f-IterativeIDESolver
- Loading branch information
Showing
61 changed files
with
2,001 additions
and
657 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/****************************************************************************** | ||
* Copyright (c) 2024 Fabian Schiebel. | ||
* All rights reserved. This program and the accompanying materials are made | ||
* available under the terms of LICENSE.txt. | ||
* | ||
* Contributors: | ||
* Maximilian Leo Huber and others | ||
*****************************************************************************/ | ||
|
||
#ifndef PHASAR_PHASARLLVM_CONTROLFLOW_CALLGRAPHDATA_H | ||
#define PHASAR_PHASARLLVM_CONTROLFLOW_CALLGRAPHDATA_H | ||
|
||
#include "llvm/ADT/StringRef.h" | ||
#include "llvm/Support/raw_ostream.h" | ||
|
||
#include <string> | ||
#include <unordered_map> | ||
#include <vector> | ||
|
||
namespace psr { | ||
struct CallGraphData { | ||
// Mangled FunName --> [CS-IDs] | ||
std::unordered_map<std::string, std::vector<uint32_t>> FToFunctionVertexTy{}; | ||
|
||
CallGraphData() noexcept = default; | ||
void printAsJson(llvm::raw_ostream &OS); | ||
|
||
static CallGraphData deserializeJson(const llvm::Twine &Path); | ||
static CallGraphData loadJsonString(llvm::StringRef JsonAsString); | ||
}; | ||
|
||
} // namespace psr | ||
|
||
#endif // PHASAR_PHASARLLVM_CONTROLFLOW_CALLGRAPHDATA_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
include/phasar/PhasarLLVM/ControlFlow/EntryFunctionUtils.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/****************************************************************************** | ||
* Copyright (c) 2024 Fabian Schiebel. | ||
* All rights reserved. This program and the accompanying materials are made | ||
* available under the terms of LICENSE.txt. | ||
* | ||
* Contributors: | ||
* Fabian Schiebel and others | ||
*****************************************************************************/ | ||
|
||
#ifndef PHASAR_PHASARLLVM_UTILS_ENTRYFUNCTIONUTILS_H | ||
#define PHASAR_PHASARLLVM_UTILS_ENTRYFUNCTIONUTILS_H | ||
|
||
#include "llvm/ADT/ArrayRef.h" | ||
#include "llvm/IR/Function.h" | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
namespace psr { | ||
class LLVMProjectIRDB; | ||
|
||
[[nodiscard]] std::vector<const llvm::Function *> | ||
getEntryFunctions(const LLVMProjectIRDB &IRDB, | ||
llvm::ArrayRef<std::string> EntryPoints); | ||
|
||
[[nodiscard]] std::vector<llvm::Function *> | ||
getEntryFunctionsMut(LLVMProjectIRDB &IRDB, | ||
llvm::ArrayRef<std::string> EntryPoints); | ||
} // namespace psr | ||
|
||
#endif // PHASAR_PHASARLLVM_UTILS_ENTRYFUNCTIONUTILS_H |
45 changes: 45 additions & 0 deletions
45
include/phasar/PhasarLLVM/ControlFlow/GlobalCtorsDtorsModel.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/****************************************************************************** | ||
* Copyright (c) 2024 Fabian Schiebel. | ||
* All rights reserved. This program and the accompanying materials are made | ||
* available under the terms of LICENSE.txt. | ||
* | ||
* Contributors: | ||
* Fabian Schiebel and others | ||
*****************************************************************************/ | ||
|
||
#ifndef PHASAR_PHASARLLVM_CONTROLFLOW_GLOBALCTORSDTORSMODEL_H | ||
#define PHASAR_PHASARLLVM_CONTROLFLOW_GLOBALCTORSDTORSMODEL_H | ||
|
||
#include "llvm/ADT/ArrayRef.h" | ||
#include "llvm/IR/Function.h" | ||
|
||
namespace psr { | ||
class LLVMProjectIRDB; | ||
|
||
class GlobalCtorsDtorsModel { | ||
public: | ||
static constexpr llvm::StringLiteral ModelName = | ||
"__psrCRuntimeGlobalCtorsModel"; | ||
|
||
static constexpr llvm::StringLiteral DtorModelName = | ||
"__psrCRuntimeGlobalDtorsModel"; | ||
|
||
static constexpr llvm::StringLiteral DtorsCallerName = | ||
"__psrGlobalDtorsCaller"; | ||
|
||
static constexpr llvm::StringLiteral UserEntrySelectorName = | ||
"__psrCRuntimeUserEntrySelector"; | ||
|
||
static llvm::Function * | ||
buildModel(LLVMProjectIRDB &IRDB, | ||
llvm::ArrayRef<llvm::Function *> UserEntryPoints); | ||
static llvm::Function * | ||
buildModel(LLVMProjectIRDB &IRDB, | ||
llvm::ArrayRef<std::string> UserEntryPoints); | ||
|
||
/// Returns true, if a function was generated by phasar. | ||
[[nodiscard]] static bool isPhasarGenerated(const llvm::Function &F) noexcept; | ||
}; | ||
} // namespace psr | ||
|
||
#endif // PHASAR_PHASARLLVM_CONTROLFLOW_GLOBALCTORSDTORSMODEL_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
include/phasar/PhasarLLVM/ControlFlow/LLVMBasedCallGraph.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/****************************************************************************** | ||
* Copyright (c) 2024 Fabian Schiebel. | ||
* All rights reserved. This program and the accompanying materials are made | ||
* available under the terms of LICENSE.txt. | ||
* | ||
* Contributors: | ||
* Fabian Schiebel and others | ||
*****************************************************************************/ | ||
|
||
#ifndef PHASAR_PHASARLLVM_CONTROLFLOW_LLVMBASEDCALLGRAPH_H | ||
#define PHASAR_PHASARLLVM_CONTROLFLOW_LLVMBASEDCALLGRAPH_H | ||
|
||
#include "phasar/ControlFlow/CallGraph.h" | ||
|
||
namespace llvm { | ||
class Instruction; | ||
class Function; | ||
} // namespace llvm | ||
|
||
namespace psr { | ||
using LLVMBasedCallGraph = | ||
CallGraph<const llvm::Instruction *, const llvm::Function *>; | ||
} // namespace psr | ||
|
||
#endif // PHASAR_PHASARLLVM_CONTROLFLOW_LLVMBASEDCALLGRAPH_H |
49 changes: 49 additions & 0 deletions
49
include/phasar/PhasarLLVM/ControlFlow/LLVMBasedCallGraphBuilder.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/****************************************************************************** | ||
* Copyright (c) 2024 Fabian Schiebel. | ||
* All rights reserved. This program and the accompanying materials are made | ||
* available under the terms of LICENSE.txt. | ||
* | ||
* Contributors: | ||
* Fabian Schiebel and others | ||
*****************************************************************************/ | ||
|
||
#ifndef PHASAR_PHASARLLVM_CONTROLFLOW_LLVMBASEDCALLGRAPHBUILDER_H | ||
#define PHASAR_PHASARLLVM_CONTROLFLOW_LLVMBASEDCALLGRAPHBUILDER_H | ||
|
||
#include "phasar/PhasarLLVM/ControlFlow/LLVMBasedCallGraph.h" | ||
#include "phasar/PhasarLLVM/Pointer/LLVMAliasInfo.h" | ||
#include "phasar/Utils/Soundness.h" | ||
|
||
namespace psr { | ||
class LLVMProjectIRDB; | ||
enum class CallGraphAnalysisType; | ||
class LLVMTypeHierarchy; | ||
class LLVMVFTableProvider; | ||
class Resolver; | ||
|
||
[[nodiscard]] LLVMBasedCallGraph | ||
buildLLVMBasedCallGraph(LLVMProjectIRDB &IRDB, CallGraphAnalysisType CGType, | ||
llvm::ArrayRef<const llvm::Function *> EntryPoints, | ||
LLVMTypeHierarchy &TH, LLVMVFTableProvider &VTP, | ||
LLVMAliasInfoRef PT = nullptr, | ||
Soundness S = Soundness::Soundy); | ||
|
||
[[nodiscard]] LLVMBasedCallGraph | ||
buildLLVMBasedCallGraph(const LLVMProjectIRDB &IRDB, Resolver &CGResolver, | ||
llvm::ArrayRef<const llvm::Function *> EntryPoints, | ||
Soundness S = Soundness::Soundy); | ||
|
||
[[nodiscard]] LLVMBasedCallGraph | ||
buildLLVMBasedCallGraph(LLVMProjectIRDB &IRDB, CallGraphAnalysisType CGType, | ||
llvm::ArrayRef<std::string> EntryPoints, | ||
LLVMTypeHierarchy &TH, LLVMVFTableProvider &VTP, | ||
LLVMAliasInfoRef PT = nullptr, | ||
Soundness S = Soundness::Soundy); | ||
|
||
[[nodiscard]] LLVMBasedCallGraph | ||
buildLLVMBasedCallGraph(const LLVMProjectIRDB &IRDB, Resolver &CGResolver, | ||
llvm::ArrayRef<std::string> EntryPoints, | ||
Soundness S = Soundness::Soundy); | ||
} // namespace psr | ||
|
||
#endif // PHASAR_PHASARLLVM_CONTROLFLOW_LLVMBASEDCALLGRAPHBUILDER_H |
Oops, something went wrong.