forked from secure-software-engineering/phasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'mainline/development' into development
- Loading branch information
Showing
83 changed files
with
8,929 additions
and
236 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
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
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,22 @@ | ||
/****************************************************************************** | ||
* Copyright (c) 2022 Philipp Schubert. | ||
* 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_DATAFLOW_IFDSIDE_SOLVER_ESGEDGEKIND_H | ||
#define PHASAR_DATAFLOW_IFDSIDE_SOLVER_ESGEDGEKIND_H | ||
|
||
namespace psr { | ||
enum class ESGEdgeKind { Normal, Call, CallToRet, SkipUnknownFn, Ret, Summary }; | ||
|
||
constexpr bool isInterProc(ESGEdgeKind Kind) noexcept { | ||
return Kind == ESGEdgeKind::Call || Kind == ESGEdgeKind::Ret; | ||
} | ||
|
||
} // namespace psr | ||
|
||
#endif // PHASAR_DATAFLOW_IFDSIDE_SOLVER_ESGEDGEKIND_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
69 changes: 69 additions & 0 deletions
69
include/phasar/DataFlow/IfdsIde/Solver/PathAwareIDESolver.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,69 @@ | ||
/****************************************************************************** | ||
* Copyright (c) 2022 Philipp Schubert. | ||
* 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_DATAFLOW_IFDSIDE_SOLVER_PATHAWAREIDESOLVER_H | ||
#define PHASAR_DATAFLOW_IFDSIDE_SOLVER_PATHAWAREIDESOLVER_H | ||
|
||
#include "phasar/DataFlow/IfdsIde/IDETabulationProblem.h" | ||
#include "phasar/DataFlow/IfdsIde/Solver/ESGEdgeKind.h" | ||
#include "phasar/DataFlow/IfdsIde/Solver/IDESolver.h" | ||
#include "phasar/DataFlow/PathSensitivity/ExplodedSuperGraph.h" | ||
#include "phasar/Utils/Logger.h" | ||
|
||
namespace psr { | ||
template <typename AnalysisDomainTy, | ||
typename Container = std::set<typename AnalysisDomainTy::d_t>> | ||
class PathAwareIDESolver : public IDESolver<AnalysisDomainTy, Container> { | ||
using base_t = IDESolver<AnalysisDomainTy, Container>; | ||
|
||
public: | ||
using domain_t = AnalysisDomainTy; | ||
using n_t = typename base_t::n_t; | ||
using d_t = typename base_t::d_t; | ||
using i_t = typename base_t::i_t; | ||
using container_type = typename base_t::container_type; | ||
|
||
explicit PathAwareIDESolver( | ||
IDETabulationProblem<domain_t, container_type> &Problem, const i_t *ICF) | ||
: base_t(Problem, ICF), ESG(Problem.getZeroValue()) { | ||
|
||
if (Problem.getIFDSIDESolverConfig().autoAddZero()) { | ||
PHASAR_LOG_LEVEL( | ||
WARNING, | ||
"The PathAwareIDESolver is initialized with the option 'autoAddZero' " | ||
"being set. This might degrade the quality of the computed paths!"); | ||
} | ||
} | ||
|
||
[[nodiscard]] const ExplodedSuperGraph<domain_t> & | ||
getExplicitESG() const &noexcept { | ||
return ESG; | ||
} | ||
|
||
[[nodiscard]] ExplodedSuperGraph<domain_t> &&getExplicitESG() &&noexcept { | ||
return std::move(ESG); | ||
} | ||
|
||
private: | ||
void saveEdges(n_t Curr, n_t Succ, d_t CurrNode, | ||
const container_type &SuccNodes, ESGEdgeKind Kind) override { | ||
ESG.saveEdges(std::move(Curr), std::move(CurrNode), std::move(Succ), | ||
SuccNodes, Kind); | ||
} | ||
|
||
ExplodedSuperGraph<domain_t> ESG; | ||
}; | ||
|
||
template <typename ProblemTy> | ||
PathAwareIDESolver(ProblemTy &) | ||
-> PathAwareIDESolver<typename ProblemTy::ProblemAnalysisDomain>; | ||
|
||
} // namespace psr | ||
|
||
#endif // PHASAR_DATAFLOW_IFDSIDE_SOLVER_PATHAWAREIDESOLVER_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
Oops, something went wrong.