Skip to content

Commit 42ad7ed

Browse files
author
Martin Mory
committed
clang-tidy fixes for plugins - mostly renames
1 parent 74296bc commit 42ad7ed

14 files changed

Lines changed: 208 additions & 188 deletions

include/phasar/PhasarLLVM/Plugins/Interfaces/IfdsIde/IDETabulationProblemPlugin.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,27 +56,27 @@ class IDETabulationProblemPlugin
5656
const LLVMTypeHierarchy *TH,
5757
const LLVMBasedICFG *ICF, LLVMPointsToInfo *PT,
5858
std::set<std::string> EntryPoints)
59-
: IDETabulationProblem(IRDB, TH, ICF, PT, EntryPoints) {}
59+
: IDETabulationProblem(IRDB, TH, ICF, PT, std::move(EntryPoints)) {}
6060
~IDETabulationProblemPlugin() override = default;
6161

62-
bool isZeroValue(d_t d) const override { return d == getZeroValue(); }
62+
bool isZeroValue(d_t Fact) const override { return Fact == getZeroValue(); }
6363

64-
void printNode(std::ostream &os, const llvm::Instruction *n) const override {
65-
os << llvmIRToString(n);
64+
void printNode(std::ostream &OS, const llvm::Instruction *Stmt) const override {
65+
OS << llvmIRToString(Stmt);
6666
}
6767

68-
void printDataFlowFact(std::ostream &os, d_t d) const override {
68+
void printDataFlowFact(std::ostream &OS, d_t Fact) const override {
6969
// os << llvmIRToString(d);
70-
d->print(os);
70+
Fact->print(OS);
7171
}
7272

73-
void printFunction(std::ostream &os, const llvm::Function *m) const override {
74-
os << m->getName().str();
73+
void printFunction(std::ostream &OS, const llvm::Function *Func) const override {
74+
OS << Func->getName().str();
7575
}
7676

77-
void printEdgeFact(std::ostream &os, l_t l) const override {
77+
void printEdgeFact(std::ostream &OS, l_t L) const override {
7878
// os << llvmIRToString(l);
79-
l->print(os);
79+
L->print(OS);
8080
}
8181

8282
std::shared_ptr<EdgeFunction<l_t>> allTopFunction() override {
@@ -89,7 +89,7 @@ extern std::map<std::string,
8989
const ProjectIRDB *IRDB, const LLVMTypeHierarchy *TH,
9090
const LLVMBasedICFG *ICF, LLVMPointsToInfo *PT,
9191
std::set<std::string> EntryPoints)>
92-
IDETabulationProblemPluginFactory;
92+
IDETabulationProblemPluginFactory; // NOLINT
9393

9494
} // namespace psr
9595

include/phasar/PhasarLLVM/Plugins/Interfaces/IfdsIde/IFDSTabulationProblemPlugin.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,22 @@ class IFDSTabulationProblemPlugin
5858
const LLVMBasedICFG *ICF, LLVMPointsToInfo *PT,
5959
std::set<std::string> EntryPoints)
6060
: IFDSTabulationProblem<AnalysisDomainTy>(IRDB, TH, ICF, PT,
61-
EntryPoints) {}
61+
std::move(EntryPoints)) {}
6262
~IFDSTabulationProblemPlugin() override = default;
6363

64-
bool isZeroValue(d_t d) const override { return d == getZeroValue(); }
64+
bool isZeroValue(d_t Fact) const override { return Fact == getZeroValue(); }
6565

66-
void printNode(std::ostream &os, n_t n) const override {
67-
os << llvmIRToString(n);
66+
void printNode(std::ostream &OS, n_t Stmt) const override {
67+
OS << llvmIRToString(Stmt);
6868
}
6969

70-
void printDataFlowFact(std::ostream &os, d_t d) const override {
70+
void printDataFlowFact(std::ostream &OS, d_t Fact) const override {
7171
// os << llvmIRToString(d);
72-
d->print(os);
72+
Fact->print(OS);
7373
}
7474

75-
void printFunction(std::ostream &os, f_t m) const override {
76-
os << m->getName().str();
75+
void printFunction(std::ostream &OS, f_t Func) const override {
76+
OS << Func->getName().str();
7777
}
7878
};
7979

@@ -82,7 +82,7 @@ extern std::map<std::string,
8282
const ProjectIRDB *IRDB, const LLVMTypeHierarchy *TH,
8383
const LLVMBasedICFG *ICF, LLVMPointsToInfo *PT,
8484
std::set<std::string> EntryPoints)>
85-
IFDSTabulationProblemPluginFactory;
85+
IFDSTabulationProblemPluginFactory; // NOLINT
8686

8787
} // namespace psr
8888

include/phasar/PhasarLLVM/Plugins/Interfaces/Mono/InterMonoProblemPlugin.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class InterMonoProblemPlugin
3333
InterMonoProblemPlugin(const ProjectIRDB *IRDB, const LLVMTypeHierarchy *TH,
3434
const LLVMBasedICFG *ICF, LLVMPointsToInfo *PT,
3535
std::set<std::string> EntryPoints)
36-
: InterMonoProblem(IRDB, TH, ICF, PT, EntryPoints) {}
36+
: InterMonoProblem(IRDB, TH, ICF, PT, std::move(EntryPoints)) {}
3737

3838
void printNode(std::ostream &OS, n_t Inst) const override {
3939
OS << llvmIRToString((llvm::Value *)Inst);
@@ -56,7 +56,7 @@ extern std::map<std::string,
5656
const ProjectIRDB *IRDB, const LLVMTypeHierarchy *TH,
5757
const LLVMBasedICFG *ICF, LLVMPointsToInfo *PT,
5858
std::set<std::string> EntryPoints)>
59-
InterMonoProblemPluginFactory;
59+
InterMonoProblemPluginFactory; // NOLINT
6060

6161
} // namespace psr
6262

include/phasar/PhasarLLVM/Plugins/Interfaces/Mono/IntraMonoProblemPlugin.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ class IntraMonoProblemPlugin
3232
IntraMonoProblemPlugin(const ProjectIRDB *IRDB, const LLVMTypeHierarchy *TH,
3333
const LLVMBasedCFG *CF, LLVMPointsToInfo *PT,
3434
std::set<std::string> EntryPoints)
35-
: IntraMonoProblem(IRDB, TH, CF, PT, EntryPoints) {}
35+
: IntraMonoProblem(IRDB, TH, CF, PT, std::move(EntryPoints)) {}
3636

37-
void printNode(std::ostream &os, n_t n) const override {
38-
os << llvmIRToString((llvm::Value *)n);
37+
void printNode(std::ostream &OS, n_t Stmt) const override {
38+
OS << llvmIRToString((llvm::Value *)Stmt);
3939
}
40-
void printDataFlowFact(std::ostream &os, d_t d) const override {
41-
os << llvmIRToString(d);
40+
void printDataFlowFact(std::ostream &OS, d_t Fact) const override {
41+
OS << llvmIRToString(Fact);
4242
}
43-
void printFunction(std::ostream &os, f_t f) const override {
44-
os << f->getName().str();
43+
void printFunction(std::ostream &OS, f_t Func) const override {
44+
OS << Func->getName().str();
4545
}
4646
};
4747

@@ -55,7 +55,7 @@ extern std::map<std::string,
5555
const ProjectIRDB *IRDB, const LLVMTypeHierarchy *TH,
5656
const LLVMBasedCFG *CF, LLVMPointsToInfo *PT,
5757
std::set<std::string> EntryPoints)>
58-
IntraMonoProblemPluginFactory;
58+
IntraMonoProblemPluginFactory; // NOLINT
5959

6060
} // namespace psr
6161

lib/PhasarLLVM/Plugins/AnalysisPluginController.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ using namespace psr;
3232
namespace psr {
3333

3434
AnalysisPluginController::AnalysisPluginController(
35-
const std::vector<std::string> &AnalysisPlygins, const ProjectIRDB *IRDB,
36-
const LLVMTypeHierarchy *TH, const LLVMBasedICFG *ICF,
37-
const LLVMPointsToInfo *PT, const std::set<std::string> &EntryPoints) {
35+
const std::vector<std::string> &AnalysisPlygins,
36+
const ProjectIRDB * /*IRDB*/, const LLVMTypeHierarchy * /*TH*/,
37+
const LLVMBasedICFG * /*ICF*/, const LLVMPointsToInfo * /*PT*/,
38+
const std::set<std::string> & /*EntryPoints*/) {
3839
for (const auto &AnalysisPlugin : AnalysisPlygins) {
3940
boost::filesystem::path LibPath(AnalysisPlugin);
4041
boost::system::error_code Err;

lib/PhasarLLVM/Plugins/IDETabulationProblemTestPlugin.cxx

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -36,43 +36,48 @@ IDETabulationProblemTestPlugin::IDETabulationProblemTestPlugin(
3636
const LLVMBasedICFG *ICF, LLVMPointsToInfo *PT,
3737
std::set<std::string> EntryPoints)
3838
: IDETabulationProblemPlugin(IRDB, TH, ICF, PT, std::move(EntryPoints)) {
39-
ZeroValue = createZeroValue();
39+
ZeroValue = IDETabulationProblemTestPlugin::createZeroValue();
4040
}
4141

4242
const FlowFact *IDETabulationProblemTestPlugin::createZeroValue() const {
43-
static auto zero = new ValueFlowFactWrapper(nullptr);
44-
return zero;
43+
static auto *Zero = new ValueFlowFactWrapper(nullptr); // NOLINT
44+
return Zero;
4545
}
4646

4747
IDETabulationProblemTestPlugin::FlowFunctionPtrType
4848
IDETabulationProblemTestPlugin::getNormalFlowFunction(
49-
const llvm::Instruction *Curr, const llvm::Instruction *Succ) {
49+
const llvm::Instruction * /*Curr*/, const llvm::Instruction * /*Succ*/) {
5050
return Identity<const FlowFact *>::getInstance();
5151
}
5252

5353
IDETabulationProblemTestPlugin::FlowFunctionPtrType
5454
IDETabulationProblemTestPlugin::getCallFlowFunction(
55-
const llvm::Instruction *CallSite, const llvm::Function *DestFun) {
55+
const llvm::Instruction * /*CallSite*/,
56+
const llvm::Function * /*DestFun*/) {
5657
return Identity<const FlowFact *>::getInstance();
5758
}
5859

5960
IDETabulationProblemTestPlugin::FlowFunctionPtrType
6061
IDETabulationProblemTestPlugin::getRetFlowFunction(
61-
const llvm::Instruction *CallSite, const llvm::Function *CalleeFun,
62-
const llvm::Instruction *ExitSite, const llvm::Instruction *RetSite) {
62+
const llvm::Instruction * /*CallSite*/,
63+
const llvm::Function * /*CalleeFun*/,
64+
const llvm::Instruction * /*ExitSite*/,
65+
const llvm::Instruction * /*RetSite*/) {
6366
return Identity<const FlowFact *>::getInstance();
6467
}
6568

6669
IDETabulationProblemTestPlugin::FlowFunctionPtrType
6770
IDETabulationProblemTestPlugin::getCallToRetFlowFunction(
68-
const llvm::Instruction *CallSite, const llvm::Instruction *RetSite,
69-
set<const llvm::Function *> Callees) {
71+
const llvm::Instruction * /*CallSite*/,
72+
const llvm::Instruction * /*RetSite*/,
73+
set<const llvm::Function *> /*Callees*/) {
7074
return Identity<const FlowFact *>::getInstance();
7175
}
7276

7377
IDETabulationProblemTestPlugin::FlowFunctionPtrType
7478
IDETabulationProblemTestPlugin::getSummaryFlowFunction(
75-
const llvm::Instruction *CallSite, const llvm::Function *DestFun) {
79+
const llvm::Instruction * /*CallSite*/,
80+
const llvm::Function * /*DestFun*/) {
7681
return nullptr;
7782
}
7883

@@ -93,51 +98,54 @@ IDETabulationProblemTestPlugin::initialSeeds() {
9398
}
9499

95100
IDETabulationProblemTestPlugin::EdgeFunctionPtrType
96-
IDETabulationProblemTestPlugin::getNormalEdgeFunction(n_t curr, d_t currNode,
97-
n_t succ, d_t succNode) {
101+
IDETabulationProblemTestPlugin::getNormalEdgeFunction(n_t /*Curr*/,
102+
d_t /*CurrNode*/,
103+
n_t /*Succ*/,
104+
d_t /*SuccNode*/) {
98105
return EdgeIdentity<l_t>::getInstance();
99106
}
100107
IDETabulationProblemTestPlugin::EdgeFunctionPtrType
101-
IDETabulationProblemTestPlugin::getCallEdgeFunction(n_t callSite, d_t srcNode,
102-
f_t destinationFunction,
103-
d_t destNode) {
108+
IDETabulationProblemTestPlugin::getCallEdgeFunction(n_t /*CallSite*/,
109+
d_t /*SrcNode*/,
110+
f_t /*DestinationFunction*/,
111+
d_t /*DestNode*/) {
104112
return EdgeIdentity<l_t>::getInstance();
105113
}
106114
IDETabulationProblemTestPlugin::EdgeFunctionPtrType
107-
IDETabulationProblemTestPlugin::getReturnEdgeFunction(n_t callSite,
108-
f_t calleeFunction,
109-
n_t exitSite,
110-
d_t exitNode, n_t reSite,
111-
d_t retNode) {
115+
IDETabulationProblemTestPlugin::getReturnEdgeFunction(
116+
n_t /*CallSite*/, f_t /*CalleeFunction*/, n_t /*ExitSite*/,
117+
d_t /*ExitNode*/, n_t /*RetSite*/, d_t /*RetNode*/) {
112118
return EdgeIdentity<l_t>::getInstance();
113119
}
114120
IDETabulationProblemTestPlugin::EdgeFunctionPtrType
115121
IDETabulationProblemTestPlugin::getCallToRetEdgeFunction(
116-
n_t callSite, d_t callNode, n_t retSite, d_t retSiteNode,
117-
std::set<f_t> callees) {
122+
n_t /*CallSite*/, d_t /*CallNode*/, n_t /*RetSite*/, d_t /*RetSiteNode*/,
123+
std::set<f_t> /*Callees*/) {
118124
return EdgeIdentity<l_t>::getInstance();
119125
}
120126
IDETabulationProblemTestPlugin::EdgeFunctionPtrType
121-
IDETabulationProblemTestPlugin::getSummaryEdgeFunction(n_t curr, d_t currNode,
122-
n_t succ, d_t succNode) {
127+
IDETabulationProblemTestPlugin::getSummaryEdgeFunction(n_t /*Curr*/,
128+
d_t /*CurrNode*/,
129+
n_t /*Succ*/,
130+
d_t /*SuccNode*/) {
123131
return nullptr;
124132
}
125133

126134
IDETabulationProblemTestPlugin::l_t
127135
IDETabulationProblemTestPlugin::topElement() {
128-
return efManager.getOrCreateEdgeFact(-1);
136+
return EFManager.getOrCreateEdgeFact(-1);
129137
}
130138
IDETabulationProblemTestPlugin::l_t
131139
IDETabulationProblemTestPlugin::bottomElement() {
132-
return efManager.getOrCreateEdgeFact(0);
140+
return EFManager.getOrCreateEdgeFact(0);
133141
}
134142
IDETabulationProblemTestPlugin::l_t
135-
IDETabulationProblemTestPlugin::join(l_t lhs, l_t rhs) {
136-
if (lhs == rhs || rhs == topElement()) {
137-
return lhs;
143+
IDETabulationProblemTestPlugin::join(l_t Lhs, l_t Rhs) {
144+
if (Lhs == Rhs || Rhs == topElement()) {
145+
return Lhs;
138146
}
139-
if (lhs == topElement()) {
140-
return rhs;
147+
if (Lhs == topElement()) {
148+
return Rhs;
141149
}
142150
return bottomElement();
143151
}

lib/PhasarLLVM/Plugins/IDETabulationProblemTestPlugin.h

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ namespace psr {
88
struct IntEdgeFactWrapper : public EdgeFactWrapper<int> {
99
using EdgeFactWrapper::EdgeFactWrapper;
1010

11-
inline void print(std::ostream &os) const override { os << get(); }
11+
inline void print(std::ostream &OS) const override { OS << get(); }
1212
};
1313
struct ValueFlowFactWrapper : public FlowFactWrapper<const llvm::Value *> {
1414
using FlowFactWrapper::FlowFactWrapper;
1515

16-
inline void print(std::ostream &os,
17-
const llvm::Value *const &nonzeroFact) const override {
18-
os << llvmIRToShortString(nonzeroFact) << '\n';
16+
inline void print(std::ostream &OS,
17+
const llvm::Value *const &NonzeroFact) const override {
18+
OS << llvmIRToShortString(NonzeroFact) << '\n';
1919
}
2020
};
2121

2222
class IDETabulationProblemTestPlugin : public IDETabulationProblemPlugin {
23-
EdgeFactManager<IntEdgeFactWrapper> efManager;
23+
EdgeFactManager<IntEdgeFactWrapper> EFManager;
2424

2525
public:
2626
IDETabulationProblemTestPlugin(const ProjectIRDB *IRDB,
@@ -33,47 +33,47 @@ class IDETabulationProblemTestPlugin : public IDETabulationProblemPlugin {
3333
[[nodiscard]] const FlowFact *createZeroValue() const override;
3434

3535
FlowFunctionPtrType
36-
getNormalFlowFunction(const llvm::Instruction *curr,
37-
const llvm::Instruction *succ) override;
36+
getNormalFlowFunction(const llvm::Instruction *Curr,
37+
const llvm::Instruction *Succ) override;
3838

3939
FlowFunctionPtrType
40-
getCallFlowFunction(const llvm::Instruction *callSite,
41-
const llvm::Function *destFun) override;
40+
getCallFlowFunction(const llvm::Instruction *CallSite,
41+
const llvm::Function *DestFun) override;
4242

4343
FlowFunctionPtrType
44-
getRetFlowFunction(const llvm::Instruction *callSite,
45-
const llvm::Function *calleeFun,
46-
const llvm::Instruction *exitSite,
47-
const llvm::Instruction *retSite) override;
44+
getRetFlowFunction(const llvm::Instruction *CallSite,
45+
const llvm::Function *CalleeFun,
46+
const llvm::Instruction *ExitStmt,
47+
const llvm::Instruction *RetSite) override;
4848

4949
FlowFunctionPtrType
50-
getCallToRetFlowFunction(const llvm::Instruction *callSite,
51-
const llvm::Instruction *retSite,
52-
std::set<const llvm::Function *> callees) override;
50+
getCallToRetFlowFunction(const llvm::Instruction *CallSite,
51+
const llvm::Instruction *RetSite,
52+
std::set<const llvm::Function *> Callees) override;
5353

5454
FlowFunctionPtrType
55-
getSummaryFlowFunction(const llvm::Instruction *callSite,
56-
const llvm::Function *destFun) override;
55+
getSummaryFlowFunction(const llvm::Instruction *CallSite,
56+
const llvm::Function *DestFun) override;
5757

5858
InitialSeeds<n_t, d_t, l_t> initialSeeds() override;
5959

60-
EdgeFunctionPtrType getNormalEdgeFunction(n_t curr, d_t currNode, n_t succ,
61-
d_t succNode) override;
62-
EdgeFunctionPtrType getCallEdgeFunction(n_t callSite, d_t srcNode,
63-
f_t destinationFunction,
64-
d_t destNode) override;
65-
EdgeFunctionPtrType getReturnEdgeFunction(n_t callSite, f_t calleeFunction,
66-
n_t exitSite, d_t exitNode,
67-
n_t reSite, d_t retNode) override;
68-
EdgeFunctionPtrType getCallToRetEdgeFunction(n_t callSite, d_t callNode,
69-
n_t retSite, d_t retSiteNode,
70-
std::set<f_t> callees) override;
71-
EdgeFunctionPtrType getSummaryEdgeFunction(n_t curr, d_t currNode, n_t succ,
72-
d_t succNode) override;
60+
EdgeFunctionPtrType getNormalEdgeFunction(n_t Curr, d_t CurrNode, n_t Succ,
61+
d_t SuccNode) override;
62+
EdgeFunctionPtrType getCallEdgeFunction(n_t CallSite, d_t SrcNode,
63+
f_t DestinationFunction,
64+
d_t DestNode) override;
65+
EdgeFunctionPtrType getReturnEdgeFunction(n_t CallSite, f_t CalleeFunction,
66+
n_t ExitStmt, d_t ExitNode,
67+
n_t RetSite, d_t RetNode) override;
68+
EdgeFunctionPtrType getCallToRetEdgeFunction(n_t CallSite, d_t CallNode,
69+
n_t RetSite, d_t RetSiteNode,
70+
std::set<f_t> Callees) override;
71+
EdgeFunctionPtrType getSummaryEdgeFunction(n_t Curr, d_t CurrNode, n_t Succ,
72+
d_t SuccNode) override;
7373

7474
l_t topElement() override;
7575
l_t bottomElement() override;
76-
l_t join(l_t lhs, l_t rhs) override;
76+
l_t join(l_t Lhs, l_t Rhs) override;
7777
};
7878

7979
extern "C" std::unique_ptr<IDETabulationProblemPlugin>
@@ -84,5 +84,4 @@ makeIDETabulationProblemtestPlugin(const ProjectIRDB *IRDB,
8484
std::set<std::string> EntryPoints);
8585

8686
} // namespace psr
87-
8887
#endif

0 commit comments

Comments
 (0)