Skip to content

Commit

Permalink
Merge branch 'development' into f-ModernizeUninitVariablesAnalysis
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianbs96 authored Jul 31, 2023
2 parents d1712f6 + f1c5865 commit 149776d
Show file tree
Hide file tree
Showing 150 changed files with 1,170 additions and 403 deletions.
11 changes: 9 additions & 2 deletions config/TaintConfigSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,36 @@ R"(
"description": "Version of this taint configuration"
},
"functions": {
"description": "Array of functions you want to include in your analysis",
"type": "array",
"properties": {
"name": {
"type": "string"
"type": "string",
"description": "Name of the function in the llvm IR, look for possible mangling"
},
"ret": {
"enum": ["source", "sink", "sanitizer"]
"enum": ["source", "sink", "sanitizer"],
"description": "Tags the returned value as source sink or sanitizer"
},
"params": {
"description": "Tags function parameters as source, sink or sanitizer",
"properties": {
"source": {
"description": "Zero based indices of source tags",
"type": "array",
"properties": {
"type": ["number", "string"]
}
},
"sink": {
"description": "Zero based indices of sink tags. A Leak is detected if the function gets called with source taged value in this indices.",
"type": "array",
"properties": {
"type": ["number", "string"]
}
},
"sanitizer": {
"description": "Zero based indices of sanitizer tags",
"type": "array",
"properties": {
"type": ["number", "string"]
Expand Down
4 changes: 2 additions & 2 deletions include/phasar/AnalysisStrategy/AnalysisSetup.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Philipp Schubert and others
*****************************************************************************/

#ifndef PHASAR_PHASARLLVM_ANALYSISSTRATEGY_ANALYSISSETUP_H_
#define PHASAR_PHASARLLVM_ANALYSISSTRATEGY_ANALYSISSETUP_H_
#ifndef PHASAR_ANALYSISSTRATEGY_ANALYSISSETUP_H
#define PHASAR_ANALYSISSTRATEGY_ANALYSISSETUP_H

#include "phasar/PhasarLLVM/ControlFlow/LLVMBasedICFG.h"
#include "phasar/PhasarLLVM/Pointer/LLVMAliasSet.h"
Expand Down
4 changes: 2 additions & 2 deletions include/phasar/AnalysisStrategy/DemandDrivenAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Philipp Schubert and others
*****************************************************************************/

#ifndef PHASAR_PHASARLLVM_ANALYSISSTRATEGY_DEMANDDRIVENANALYSIS_H_
#define PHASAR_PHASARLLVM_ANALYSISSTRATEGY_DEMANDDRIVENANALYSIS_H_
#ifndef PHASAR_ANALYSISSTRATEGY_DEMANDDRIVENANALYSIS_H
#define PHASAR_ANALYSISSTRATEGY_DEMANDDRIVENANALYSIS_H

namespace psr {

Expand Down
4 changes: 2 additions & 2 deletions include/phasar/AnalysisStrategy/IncrementalUpdateAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Philipp Schubert and others
*****************************************************************************/

#ifndef PHASAR_PHASARLLVM_ANALYSISSTRATEGY_INCREMENTALUPDATEANALYSIS_H_
#define PHASAR_PHASARLLVM_ANALYSISSTRATEGY_INCREMENTALUPDATEANALYSIS_H_
#ifndef PHASAR_ANALYSISSTRATEGY_INCREMENTALUPDATEANALYSIS_H
#define PHASAR_ANALYSISSTRATEGY_INCREMENTALUPDATEANALYSIS_H

namespace psr {

Expand Down
4 changes: 2 additions & 2 deletions include/phasar/AnalysisStrategy/ModuleWiseAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Philipp Schubert and others
*****************************************************************************/

#ifndef PHASAR_PHASARLLVM_ANALYSISSTRATEGY_MODULEWISEANALYSIS_H_
#define PHASAR_PHASARLLVM_ANALYSISSTRATEGY_MODULEWISEANALYSIS_H_
#ifndef PHASAR_ANALYSISSTRATEGY_MODULEWISEANALYSIS_H
#define PHASAR_ANALYSISSTRATEGY_MODULEWISEANALYSIS_H

namespace psr {

Expand Down
4 changes: 2 additions & 2 deletions include/phasar/AnalysisStrategy/Strategies.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Philipp Schubert and others
*****************************************************************************/

#ifndef PHASAR_PHASARLLVM_ANALYSISSTRATEGY_STRATEGIES_H
#define PHASAR_PHASARLLVM_ANALYSISSTRATEGY_STRATEGIES_H
#ifndef PHASAR_ANALYSISSTRATEGY_STRATEGIES_H
#define PHASAR_ANALYSISSTRATEGY_STRATEGIES_H

#include "llvm/ADT/StringRef.h"
#include "llvm/Support/raw_ostream.h"
Expand Down
4 changes: 2 additions & 2 deletions include/phasar/AnalysisStrategy/VariationalAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Philipp Schubert and others
*****************************************************************************/

#ifndef PHASAR_PHASARLLVM_ANALYSISSTRATEGY_VARIATIONALANALYSIS_H_
#define PHASAR_PHASARLLVM_ANALYSISSTRATEGY_VARIATIONALANALYSIS_H_
#ifndef PHASAR_ANALYSISSTRATEGY_VARIATIONALANALYSIS_H
#define PHASAR_ANALYSISSTRATEGY_VARIATIONALANALYSIS_H

#include "phasar/AnalysisStrategy/AnalysisSetup.h"

Expand Down
6 changes: 3 additions & 3 deletions include/phasar/ControlFlow/CFGBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Fabian Schiebel and others
*****************************************************************************/

#ifndef PHASAR_PHASARLLVM_CONTROLFLOW_CFGBASE_H
#define PHASAR_PHASARLLVM_CONTROLFLOW_CFGBASE_H
#ifndef PHASAR_CONTROLFLOW_CFGBASE_H
#define PHASAR_CONTROLFLOW_CFGBASE_H

#include "phasar/Utils/ByRef.h"
#include "phasar/Utils/TypeTraits.h"
Expand Down Expand Up @@ -150,4 +150,4 @@ constexpr bool is_cfg_v = is_crtp_base_of_v<CFGBase, ICF>

} // namespace psr

#endif // PHASAR_PHASARLLVM_CONTROLFLOW_CFGBASE_H
#endif // PHASAR_CONTROLFLOW_CFGBASE_H
6 changes: 3 additions & 3 deletions include/phasar/ControlFlow/CallGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Fabian Schiebel and others
*****************************************************************************/

#ifndef PHASAR_PHASARLLVM_CONTROLFLOW_CALLGRAPH_H
#define PHASAR_PHASARLLVM_CONTROLFLOW_CALLGRAPH_H
#ifndef PHASAR_CONTROLFLOW_CALLGRAPH_H
#define PHASAR_CONTROLFLOW_CALLGRAPH_H

#include "phasar/ControlFlow/CallGraphBase.h"
#include "phasar/Utils/ByRef.h"
Expand Down Expand Up @@ -301,4 +301,4 @@ extern template class psr::CallGraph<const llvm::Instruction *,
extern template class psr::CallGraphBuilder<const llvm::Instruction *,
const llvm::Function *>;

#endif // PHASAR_PHASARLLVM_CONTROLFLOW_CALLGRAPH_H
#endif // PHASAR_CONTROLFLOW_CALLGRAPH_H
6 changes: 3 additions & 3 deletions include/phasar/ControlFlow/CallGraphAnalysisType.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Philipp Schubert, Fabian Schiebel and others
*****************************************************************************/

#ifndef PHASAR_PHASARLLVM_CALLGRAPHANALYSISTYPE_H
#define PHASAR_PHASARLLVM_CALLGRAPHANALYSISTYPE_H
#ifndef PHASAR_CONTROLFLOW_CALLGRAPHANALYSISTYPE_H
#define PHASAR_CONTROLFLOW_CALLGRAPHANALYSISTYPE_H

#include "llvm/ADT/StringRef.h"
#include "llvm/Support/raw_ostream.h"
Expand All @@ -30,4 +30,4 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, CallGraphAnalysisType CGA);

} // namespace psr

#endif // PHASAR_PHASARLLVM_CALLGRAPHANALYSISTYPE_H
#endif // PHASAR_CONTROLFLOW_CALLGRAPHANALYSISTYPE_H
6 changes: 3 additions & 3 deletions include/phasar/ControlFlow/CallGraphBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Fabian Schiebel and others
*****************************************************************************/

#ifndef PHASAR_PHASARLLVM_CONTROLFLOW_CALLGRAPHBASE_H
#define PHASAR_PHASARLLVM_CONTROLFLOW_CALLGRAPHBASE_H
#ifndef PHASAR_CONTROLFLOW_CALLGRAPHBASE_H
#define PHASAR_CONTROLFLOW_CALLGRAPHBASE_H

#include "phasar/Utils/ByRef.h"
#include "phasar/Utils/TypeTraits.h"
Expand Down Expand Up @@ -56,4 +56,4 @@ template <typename Derived> class CallGraphBase {
};
} // namespace psr

#endif // PHASAR_PHASARLLVM_CONTROLFLOW_CALLGRAPHBASE_H
#endif // PHASAR_CONTROLFLOW_CALLGRAPHBASE_H
6 changes: 3 additions & 3 deletions include/phasar/ControlFlow/ICFGBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Fabian Schiebel and others
*****************************************************************************/

#ifndef PHASAR_PHASARLLVM_CONTROLFLOW_ICFGBASE_H
#define PHASAR_PHASARLLVM_CONTROLFLOW_ICFGBASE_H
#ifndef PHASAR_CONTROLFLOW_ICFGBASE_H
#define PHASAR_CONTROLFLOW_ICFGBASE_H

#include "phasar/ControlFlow/CFGBase.h"
#include "phasar/ControlFlow/CallGraphBase.h"
Expand Down Expand Up @@ -134,4 +134,4 @@ constexpr bool is_icfg_v = is_crtp_base_of_v<ICFGBase, ICF>

} // namespace psr

#endif // PHASAR_PHASARLLVM_CONTROLFLOW_ICFGBASE_H
#endif // PHASAR_CONTROLFLOW_ICFGBASE_H
6 changes: 3 additions & 3 deletions include/phasar/ControlFlow/SpecialMemberFunctionType.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* Author: philipp
*/

#ifndef PHASAR_PHASARLLVM_SPECIALMEMBERFUNCTIONTYPE_H
#define PHASAR_PHASARLLVM_SPECIALMEMBERFUNCTIONTYPE_H
#ifndef PHASAR_CONTROLFLOW_SPECIALMEMBERFUNCTIONTYPE_H
#define PHASAR_CONTROLFLOW_SPECIALMEMBERFUNCTIONTYPE_H

#include "llvm/ADT/StringRef.h"

Expand All @@ -40,4 +40,4 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &OS,
SpecialMemberFunctionType SMFT);
} // namespace psr

#endif // PHASAR_PHASARLLVM_SPECIALMEMBERFUNCTIONTYPE_H
#endif // PHASAR_CONTROLFLOW_SPECIALMEMBERFUNCTIONTYPE_H
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Philipp Schubert and others
*****************************************************************************/

#ifndef PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_DEFAULTEDGEFUNCTIONSINGLETONCACHE_H
#define PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_DEFAULTEDGEFUNCTIONSINGLETONCACHE_H
#ifndef PHASAR_DATAFLOW_IFDSIDE_DEFAULTEDGEFUNCTIONSINGLETONCACHE_H
#define PHASAR_DATAFLOW_IFDSIDE_DEFAULTEDGEFUNCTIONSINGLETONCACHE_H

#include "phasar/DataFlow/IfdsIde/EdgeFunction.h"
#include "phasar/DataFlow/IfdsIde/EdgeFunctionSingletonCache.h"
Expand Down Expand Up @@ -68,8 +68,9 @@ class DefaultEdgeFunctionSingletonCache
if (LHS == RHS) {
return true;
}
auto Empty = llvm::DenseMapInfo<const EdgeFunctionTy *>::getEmptyKey();
auto Tombstone =
const auto *Empty =
llvm::DenseMapInfo<const EdgeFunctionTy *>::getEmptyKey();
const auto *Tombstone =
llvm::DenseMapInfo<const EdgeFunctionTy *>::getTombstoneKey();
if (LHS == Empty || LHS == Tombstone || RHS == Empty ||
RHS == Tombstone) {
Expand Down Expand Up @@ -114,4 +115,4 @@ class DefaultEdgeFunctionSingletonCache<

} // namespace psr

#endif // PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_DEFAULTEDGEFUNCTIONSINGLETONCACHE_H
#endif // PHASAR_DATAFLOW_IFDSIDE_DEFAULTEDGEFUNCTIONSINGLETONCACHE_H
10 changes: 5 additions & 5 deletions include/phasar/DataFlow/IfdsIde/EdgeFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Fabian Schiebel and others
*****************************************************************************/

#ifndef PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_EDGEFUNCTION_H
#define PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_EDGEFUNCTION_H
#ifndef PHASAR_DATAFLOW_IFDSIDE_EDGEFUNCTION_H
#define PHASAR_DATAFLOW_IFDSIDE_EDGEFUNCTION_H

#include "phasar/DataFlow/IfdsIde/EdgeFunctionSingletonCache.h"
#include "phasar/Utils/ByRef.h"
Expand Down Expand Up @@ -263,7 +263,7 @@ class [[clang::trivial_abi]] EdgeFunction final : EdgeFunctionBase {
: EdgeFunction(
[](auto &&...Args) {
if constexpr (IsSOOCandidate<std::decay_t<ConcreteEF>>) {
void *Ret;
void *Ret = nullptr;
new (&Ret) ConcreteEF(std::forward<ArgTys>(Args)...);
return Ret;
} else {
Expand Down Expand Up @@ -300,7 +300,7 @@ class [[clang::trivial_abi]] EdgeFunction final : EdgeFunctionBase {
new (&Ret) ConcreteEF(std::move(EF.EF));
return Ret;
} else {
if (auto Mem = EF.Cache->lookup(EF.EF)) {
if (const auto *Mem = EF.Cache->lookup(EF.EF)) {
return static_cast<const RefCounted<ConcreteEF> *>(Mem);
}

Expand Down Expand Up @@ -804,4 +804,4 @@ struct CastInfo<To, const psr::EdgeFunction<L>>
#endif
} // namespace llvm

#endif // PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_EDGEFUNCTION_H
#endif // PHASAR_DATAFLOW_IFDSIDE_EDGEFUNCTION_H
6 changes: 3 additions & 3 deletions include/phasar/DataFlow/IfdsIde/EdgeFunctionSingletonCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Philipp Schubert and others
*****************************************************************************/

#ifndef PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_EDGEFUNCTIONSINGLETONCACHE_H
#define PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_EDGEFUNCTIONSINGLETONCACHE_H
#ifndef PHASAR_DATAFLOW_IFDSIDE_EDGEFUNCTIONSINGLETONCACHE_H
#define PHASAR_DATAFLOW_IFDSIDE_EDGEFUNCTIONSINGLETONCACHE_H

#include "phasar/Utils/ByRef.h"

Expand Down Expand Up @@ -72,4 +72,4 @@ CachedEdgeFunction(EdgeFunctionTy, EdgeFunctionSingletonCache<EdgeFunctionTy> *)

} // namespace psr

#endif // PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_EDGEFUNCTIONSINGLETONCACHE_H
#endif // PHASAR_DATAFLOW_IFDSIDE_EDGEFUNCTIONSINGLETONCACHE_H
6 changes: 3 additions & 3 deletions include/phasar/DataFlow/IfdsIde/EdgeFunctionUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Philipp Schubert, Fabian Schiebel and others
*****************************************************************************/

#ifndef PHASAR_DATAFLOW_IFDSIDE_EDGEFUNCTIONUTILS_H_
#define PHASAR_DATAFLOW_IFDSIDE_EDGEFUNCTIONUTILS_H_
#ifndef PHASAR_DATAFLOW_IFDSIDE_EDGEFUNCTIONUTILS_H
#define PHASAR_DATAFLOW_IFDSIDE_EDGEFUNCTIONUTILS_H

#include "phasar/DataFlow/IfdsIde/EdgeFunction.h"
#include "phasar/Utils/ByRef.h"
Expand Down Expand Up @@ -473,4 +473,4 @@ JoinEdgeFunction<L, N>::join(EdgeFunctionRef<JoinEdgeFunction> This,

} // namespace psr

#endif // PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_EDGEFUNCTIONUTILS_H
#endif // PHASAR_DATAFLOW_IFDSIDE_EDGEFUNCTIONUTILS_H
4 changes: 2 additions & 2 deletions include/phasar/DataFlow/IfdsIde/EdgeFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* Author: pdschbrt
*/

#ifndef PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_EDGEFUNCTIONS_H_
#define PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_EDGEFUNCTIONS_H_
#ifndef PHASAR_DATAFLOW_IFDSIDE_EDGEFUNCTIONS_H
#define PHASAR_DATAFLOW_IFDSIDE_EDGEFUNCTIONS_H

#include "phasar/DataFlow/IfdsIde/EdgeFunction.h"
#include "phasar/Utils/ByRef.h"
Expand Down
4 changes: 2 additions & 2 deletions include/phasar/DataFlow/IfdsIde/FlowFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* Author: pdschbrt
*/

#ifndef PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_FLOWFUNCTIONS_H_
#define PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_FLOWFUNCTIONS_H_
#ifndef PHASAR_DATAFLOW_IFDSIDE_FLOWFUNCTIONS_H
#define PHASAR_DATAFLOW_IFDSIDE_FLOWFUNCTIONS_H

#include "phasar/Utils/TypeTraits.h"

Expand Down
2 changes: 1 addition & 1 deletion include/phasar/DataFlow/IfdsIde/IDETabulationProblem.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class IDETabulationProblem : public FlowFunctions<AnalysisDomainTy, Container>,
assert(IRDB != nullptr);
}

virtual ~IDETabulationProblem() = default;
~IDETabulationProblem() override = default;

/// Returns an edge function that represents the top element of the analysis.
virtual EdgeFunction<l_t> allTopFunction() = 0;
Expand Down
4 changes: 2 additions & 2 deletions include/phasar/DataFlow/IfdsIde/IFDSIDESolverConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* Author: pdschbrt
*/

#ifndef PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_IFDSIDESOLVERCONFIG_H_
#define PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_IFDSIDESOLVERCONFIG_H_
#ifndef PHASAR_DATAFLOW_IFDSIDE_IFDSIDESOLVERCONFIG_H
#define PHASAR_DATAFLOW_IFDSIDE_IFDSIDESOLVERCONFIG_H

#include "phasar/Utils/EnumFlags.h"

Expand Down
4 changes: 2 additions & 2 deletions include/phasar/DataFlow/IfdsIde/IFDSTabulationProblem.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Philipp Schubert, Fabian Schiebel and others
*****************************************************************************/

#ifndef PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_IFDSTABULATIONPROBLEM_H
#define PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_IFDSTABULATIONPROBLEM_H
#ifndef PHASAR_DATAFLOW_IFDSIDE_IFDSTABULATIONPROBLEM_H
#define PHASAR_DATAFLOW_IFDSIDE_IFDSTABULATIONPROBLEM_H

#include "phasar/DataFlow/IfdsIde/EdgeFunctionUtils.h"
#include "phasar/DataFlow/IfdsIde/IDETabulationProblem.h"
Expand Down
4 changes: 2 additions & 2 deletions include/phasar/DataFlow/IfdsIde/InitialSeeds.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Philipp Schubert and others
*****************************************************************************/

#ifndef PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_INITIALSEEDS_H
#define PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_INITIALSEEDS_H
#ifndef PHASAR_DATAFLOW_IFDSIDE_INITIALSEEDS_H
#define PHASAR_DATAFLOW_IFDSIDE_INITIALSEEDS_H

#include "phasar/Domain/BinaryDomain.h"
#include "phasar/Utils/TypeTraits.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* Philipp Schubert and others
*****************************************************************************/

#ifndef PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_FLOWEDGEFUNCTIONCACHE_H_
#define PHASAR_PHASARLLVM_DATAFLOWSOLVER_IFDSIDE_FLOWEDGEFUNCTIONCACHE_H_
#ifndef PHASAR_DATAFLOW_IFDSIDE_SOLVER_FLOWEDGEFUNCTIONCACHE_H
#define PHASAR_DATAFLOW_IFDSIDE_SOLVER_FLOWEDGEFUNCTIONCACHE_H

#include "phasar/DataFlow/IfdsIde/EdgeFunctions.h"
#include "phasar/DataFlow/IfdsIde/IDETabulationProblem.h"
Expand Down
Loading

0 comments on commit 149776d

Please sign in to comment.