Skip to content

Commit 79aa718

Browse files
committed
fix IFDS reporter bug
1 parent 224f5f6 commit 79aa718

8 files changed

Lines changed: 29 additions & 42 deletions

File tree

external/googletest

Submodule googletest updated 115 files

external/json

Submodule json updated 373 files

external/json-schema-validator

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/IDETabulationProblem.h

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -65,32 +65,6 @@ class IDETabulationProblem
6565

6666
/// Returns an edge function that represents the top element of the analysis.
6767
virtual EdgeFunctionPtrType allTopFunction() = 0;
68-
69-
#pragma clang diagnostic push
70-
#pragma clang diagnostic ignored "-Winconsistent-missing-override"
71-
#pragma clang diagnostic ignored "-Wsuggest-override"
72-
/// Generates a text report of the results that is written to the specified
73-
/// output stream.
74-
virtual void emitTextReport(const SolverResults<n_t, d_t, l_t> &SR,
75-
std::ostream &OS = std::cout) {
76-
OS << "No text report available!\n";
77-
}
78-
#pragma clang diagnostic pop
79-
80-
#pragma clang diagnostic push
81-
#pragma clang diagnostic ignored "-Winconsistent-missing-override"
82-
#pragma clang diagnostic ignored "-Wsuggest-override"
83-
/// Generates a graphical report, e.g. in html or other markup languages, of
84-
/// the results that is written to the specified output stream.
85-
virtual void emitGraphicalReport(const SolverResults<n_t, d_t, l_t> &SR,
86-
std::ostream &OS = std::cout) {
87-
OS << "No graphical report available!\n";
88-
}
89-
#pragma clang diagnostic pop
90-
91-
private:
92-
using IFDSTabulationProblem<AnalysisDomainTy, Container>::emitTextReport;
93-
using IFDSTabulationProblem<AnalysisDomainTy, Container>::emitGraphicalReport;
9468
};
9569

9670
} // namespace psr

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/IFDSTabulationProblem.h

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,31 +87,33 @@ class IFDSTabulationProblem
8787

8888
/// Checks if the given data-flow fact is the special tautological lambda (or
8989
/// zero) fact.
90-
virtual bool isZeroValue(d_t d) const = 0;
90+
virtual bool isZeroValue(d_t FlowFact) const = 0;
9191

9292
/// Returns initial seeds to be used for the analysis. This is a mapping of
9393
/// statements to initial analysis facts.
9494
virtual InitialSeeds<n_t, d_t, l_t> initialSeeds() = 0;
9595

9696
/// Returns the special tautological lambda (or zero) fact.
97-
d_t getZeroValue() const { return ZeroValue; }
97+
[[nodiscard]] d_t getZeroValue() const { return ZeroValue; }
9898

9999
/// Returns the analysis' entry points.
100100
[[nodiscard]] std::set<std::string> getEntryPoints() const {
101101
return EntryPoints;
102102
}
103103

104104
/// Returns the underlying IR.
105-
const ProjectIRDB *getProjectIRDB() const { return IRDB; }
105+
[[nodiscard]] const ProjectIRDB *getProjectIRDB() const { return IRDB; }
106106

107107
/// Returns the underlying type hierarchy.
108-
const TypeHierarchy<t_t, f_t> *getTypeHierarchy() const { return TH; }
108+
[[nodiscard]] const TypeHierarchy<t_t, f_t> *getTypeHierarchy() const {
109+
return TH;
110+
}
109111

110112
/// Returns the underlying inter-procedural control-flow graph.
111-
const i_t *getICFG() const { return ICF; }
113+
[[nodiscard]] const i_t *getICFG() const { return ICF; }
112114

113115
/// Returns the underlying points-to information.
114-
PointsToInfo<v_t, n_t> *getPointstoInfo() const { return PT; }
116+
[[nodiscard]] PointsToInfo<v_t, n_t> *getPointstoInfo() const { return PT; }
115117

116118
/// Sets the configuration to be used by the IFDS/IDE solver.
117119
void setIFDSIDESolverConfig(IFDSIDESolverConfig Config) {
@@ -125,16 +127,17 @@ class IFDSTabulationProblem
125127

126128
/// Generates a text report of the results that is written to the specified
127129
/// output stream.
128-
virtual void emitTextReport(const SolverResults<n_t, d_t, BinaryDomain> &SR,
129-
std::ostream &OS = std::cout) {
130+
virtual void
131+
emitTextReport([[maybe_unused]] const SolverResults<n_t, d_t, l_t> &Results,
132+
std::ostream &OS = std::cout) {
130133
OS << "No text report available!\n";
131134
}
132135

133136
/// Generates a graphical report, e.g. in html or other markup languages, of
134137
/// the results that is written to the specified output stream.
135-
virtual void
136-
emitGraphicalReport(const SolverResults<n_t, d_t, BinaryDomain> &SR,
137-
std::ostream &OS = std::cout) {
138+
virtual void emitGraphicalReport(
139+
[[maybe_unused]] const SolverResults<n_t, d_t, l_t> &Results,
140+
std::ostream &OS = std::cout) {
138141
OS << "No graphical report available!\n";
139142
}
140143

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Problems/IFDSUninitializedVariables.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class IFDSUninitializedVariables
8383

8484
void printFunction(std::ostream &os, f_t m) const override;
8585

86-
void emitTextReport(const SolverResults<n_t, d_t, BinaryDomain> &SR,
86+
void emitTextReport(const SolverResults<n_t, d_t, l_t> &Results,
8787
std::ostream &OS = std::cout) override;
8888

8989
const std::map<n_t, std::set<d_t>> &getAllUndefUses() const;

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Solver/IFDSToIDETabulationProblem.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,16 @@ class IFDSToIDETabulationProblem
178178
void printEdgeFact(std::ostream &os, BinaryDomain v) const override {
179179
os << v;
180180
}
181+
182+
void emitTextReport(const SolverResults<n_t, d_t, l_t> &Results,
183+
std::ostream &OS = std::cout) override {
184+
Problem.emitTextReport(Results, OS);
185+
}
186+
187+
void emitGraphicalReport(const SolverResults<n_t, d_t, l_t> &Results,
188+
std::ostream &OS = std::cout) override {
189+
Problem.emitGraphicalReport(Results, OS);
190+
}
181191
};
182192

183193
} // namespace psr

lib/PhasarLLVM/DataFlowSolver/IfdsIde/Problems/IFDSUninitializedVariables.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ void IFDSUninitializedVariables::printFunction(
443443

444444
void IFDSUninitializedVariables::emitTextReport(
445445
const SolverResults<IFDSUninitializedVariables::n_t,
446-
IFDSUninitializedVariables::d_t, BinaryDomain> &SR,
446+
IFDSUninitializedVariables::d_t, l_t> &Result,
447447
ostream &OS) {
448448
OS << "====================== IFDS-Uninitialized-Analysis Report "
449449
"======================\n";

0 commit comments

Comments
 (0)