Skip to content

Commit 1308770

Browse files
authored
Merge pull request #452 from secure-software-engineering/f-ClangTidyIdentifierRenameControlFlow
clang-tidy: Identifier rename ControlFlow
2 parents 8bcfd08 + 3cbabd0 commit 1308770

25 files changed

Lines changed: 287 additions & 285 deletions

include/phasar/PhasarClang/RandomChangeFrontendAction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class RandomChangeFrontendAction : public clang::ASTFrontendAction {
4141
void EndSourceFileAction() override;
4242

4343
std::unique_ptr<clang::ASTConsumer>
44-
CreateASTConsumer(clang::CompilerInstance &CI, llvm::StringRef file) override;
44+
CreateASTConsumer(clang::CompilerInstance &CI, llvm::StringRef File) override;
4545
};
4646

4747
} // namespace psr

include/phasar/PhasarLLVM/AnalysisStrategy/Strategies.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ std::string toString(const AnalysisStrategy &S);
2424

2525
AnalysisStrategy toAnalysisStrategy(const std::string &S);
2626

27-
std::ostream &operator<<(std::ostream &os, const AnalysisStrategy &S);
27+
std::ostream &operator<<(std::ostream &OS, const AnalysisStrategy &S);
2828

2929
} // namespace psr
3030

include/phasar/PhasarLLVM/AnalysisStrategy/WholeProgramAnalysis.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ class WholeProgramAnalysis {
9292
IRDB, CallGraphAnalysisType::OTF, EntryPoints,
9393
this->TypeHierarchy.get(), this->PointerInfo.get())
9494
: std::unique_ptr<CallGraphAnalysisTy>(CallGraph)),
95-
EntryPoints(EntryPoints), Config(Config), OwnsConfig(false),
96-
ConfigPath(""), ProblemDesc(&IRDB, TypeHierarchy, CallGraph,
97-
PointerInfo, *Config, EntryPoints),
95+
EntryPoints(EntryPoints), Config(Config),
96+
ProblemDesc(&IRDB, TypeHierarchy, CallGraph, PointerInfo, *Config,
97+
EntryPoints),
9898
DataFlowSolver(ProblemDesc) {}
9999

100100
template <typename T = ProblemDescription,

include/phasar/PhasarLLVM/ControlFlow/BiDiICFG.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,33 +27,33 @@ template <typename N, typename F> class BiDiICFG : public ICFG<N, F> {
2727
public:
2828
virtual ~BiDiICFG() = default;
2929

30-
virtual std::vector<N> getPredsOf(N u) = 0;
30+
virtual std::vector<N> getPredsOf(N U) = 0;
3131

32-
virtual std::set<N> getEndPointsOf(F f) = 0;
32+
virtual std::set<N> getEndPointsOf(F Func) = 0;
3333

34-
virtual std::vector<N> getPredsOfCallAt(N u) = 0;
34+
virtual std::vector<N> getPredsOfCallAt(N U) = 0;
3535

3636
virtual std::set<N> allNonCallEndNodes() = 0;
3737

3838
// also exposed to some clients who need it
3939
// virtual DirectedGraph<N> getOrCreateUnitGraph(F body) = 0;
4040

41-
virtual std::vector<N> getParameterRefs(F f) = 0;
41+
virtual std::vector<N> getParameterRefs(F Func) = 0;
4242

4343
/**
4444
* Gets whether the given statement is a return site of at least one call
4545
* @param n The statement to check
4646
* @return True if the given statement is a return site, otherwise false
4747
*/
48-
virtual bool isReturnSite(N n) = 0;
48+
virtual bool isReturnSite(N U) = 0;
4949

5050
/**
5151
* Checks whether the given statement is reachable from the entry point
5252
* @param u The statement to check
5353
* @return True if there is a control flow path from the entry point of the
5454
* program to the given statement, otherwise false
5555
*/
56-
virtual bool isReachable(N u) = 0;
56+
virtual bool isReachable(N U) = 0;
5757
};
5858

5959
} // namespace psr

include/phasar/PhasarLLVM/ControlFlow/CFG.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ std::string toString(const SpecialMemberFunctionType &SMFT);
3636

3737
SpecialMemberFunctionType toSpecialMemberFunctionType(const std::string &SMFT);
3838

39-
std::ostream &operator<<(std::ostream &os,
39+
std::ostream &operator<<(std::ostream &OS,
4040
const SpecialMemberFunctionType &SMFT);
4141

4242
template <typename N, typename F> class CFG {

include/phasar/PhasarLLVM/ControlFlow/ICFG.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ std::string toString(const CallGraphAnalysisType &CGA);
4141

4242
CallGraphAnalysisType toCallGraphAnalysisType(const std::string &S);
4343

44-
std::ostream &operator<<(std::ostream &os, const CallGraphAnalysisType &CGA);
44+
std::ostream &operator<<(std::ostream &OS, const CallGraphAnalysisType &CGA);
4545

4646
template <typename N, typename F> class ICFG : public virtual CFG<N, F> {
4747

include/phasar/PhasarLLVM/ControlFlow/LLVMBasedBackwardICFG.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class LLVMBasedBackwardsICFG
104104

105105
[[nodiscard]] bool isExitInst(const llvm::Instruction *Stmt) const override;
106106

107-
void mergeWith(const LLVMBasedBackwardsICFG &other);
107+
void mergeWith(const LLVMBasedBackwardsICFG &Other);
108108

109109
using LLVMBasedBackwardCFG::print; // tell the compiler we wish to have both
110110
// prints

include/phasar/PhasarLLVM/ControlFlow/LLVMBasedCFG.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,15 @@ class LLVMBasedCFG
117117
std::string IR;
118118
};
119119

120-
friend void from_json(const nlohmann::json &J, SourceCodeInfoWithIR &Info);
121-
friend void to_json(nlohmann::json &J, const SourceCodeInfoWithIR &Info);
120+
friend void from_json(const nlohmann::json &J, // NOLINT
121+
SourceCodeInfoWithIR &Info);
122+
friend void to_json(nlohmann::json &J, // NOLINT
123+
const SourceCodeInfoWithIR &Info);
122124

123125
/// Used by export(I)CFGAsJson
124126
static SourceCodeInfoWithIR
125-
getFirstNonEmpty(llvm::BasicBlock::const_iterator &it,
126-
llvm::BasicBlock::const_iterator end);
127+
getFirstNonEmpty(llvm::BasicBlock::const_iterator &It,
128+
llvm::BasicBlock::const_iterator End);
127129
static SourceCodeInfoWithIR getFirstNonEmpty(const llvm::BasicBlock *BB);
128130
};
129131

include/phasar/PhasarLLVM/ControlFlow/LLVMBasedICFG.h

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,8 @@ class LLVMBasedICFG
130130

131131
bool constructDynamicCall(const llvm::Instruction *I, Resolver &Resolver);
132132

133-
std::unique_ptr<Resolver> makeResolver(ProjectIRDB &IRDB,
134-
CallGraphAnalysisType CGT,
135-
LLVMTypeHierarchy &TH,
136-
LLVMPointsToInfo &PT);
133+
std::unique_ptr<Resolver>
134+
makeResolver(ProjectIRDB &IRDB, LLVMTypeHierarchy &TH, LLVMPointsToInfo &PT);
137135

138136
template <typename MapTy>
139137
static void insertGlobalCtorsDtorsImpl(MapTy &Into, const llvm::Module *M,
@@ -184,7 +182,8 @@ class LLVMBasedICFG
184182
LLVMTypeHierarchy *TH = nullptr, LLVMPointsToInfo *PT = nullptr,
185183
Soundness S = Soundness::Soundy, bool IncludeGlobals = true);
186184

187-
LLVMBasedICFG(const LLVMBasedICFG &);
185+
LLVMBasedICFG(const LLVMBasedICFG &ICF);
186+
188187
LLVMBasedICFG &operator=(const LLVMBasedICFG &) = delete;
189188

190189
~LLVMBasedICFG() override;
@@ -291,7 +290,7 @@ class LLVMBasedICFG
291290
void print(std::ostream &OS = std::cout) const override;
292291

293292
void printAsDot(std::ostream &OS = std::cout,
294-
bool printEdgeLabels = true) const;
293+
bool PrintEdgeLabels = true) const;
295294

296295
void printInternalPTGAsDot(std::ostream &OS = std::cout) const;
297296

@@ -320,26 +319,26 @@ class LLVMBasedICFG
320319
[[nodiscard]] const llvm::Function *
321320
getRegisteredDtorsCallerOrNull(const llvm::Module *Mod);
322321

323-
template <typename Fn> void forEachGlobalCtor(Fn &&fn) const {
322+
template <typename Fn> void forEachGlobalCtor(Fn &&F) const {
324323
for (auto [Prio, Fun] : GlobalCtors) {
325-
fn(static_cast<const llvm::Function *>(Fun));
324+
F(static_cast<const llvm::Function *>(Fun));
326325
}
327326
}
328327

329-
template <typename Fn> void forEachGlobalDtor(Fn &&fn) const {
328+
template <typename Fn> void forEachGlobalDtor(Fn &&F) const {
330329
for (auto [Prio, Fun] : GlobalDtors) {
331-
fn(static_cast<const llvm::Function *>(Fun));
330+
F(static_cast<const llvm::Function *>(Fun));
332331
}
333332
}
334333

335334
protected:
336-
void collectGlobalCtors() override;
335+
void collectGlobalCtors() final;
337336

338-
void collectGlobalDtors() override;
337+
void collectGlobalDtors() final;
339338

340-
void collectGlobalInitializers() override;
339+
void collectGlobalInitializers() final;
341340

342-
void collectRegisteredDtors() override;
341+
void collectRegisteredDtors() final;
343342
};
344343

345344
} // namespace psr

include/phasar/PhasarLLVM/ControlFlow/Resolver/DTAResolver.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,21 @@ class DTAResolver : public CHAResolver {
4040
using TypeGraph_t = CachedTypeGraph;
4141

4242
protected:
43-
TypeGraph_t typegraph;
43+
TypeGraph_t TypeGraph;
4444

4545
/**
4646
* An heuristic that return true if the bitcast instruction is interesting to
4747
* take into the DTA relational graph
4848
*/
4949
static bool
50-
heuristicAntiConstructorThisType(const llvm::BitCastInst *bitcast);
50+
heuristicAntiConstructorThisType(const llvm::BitCastInst *BitCast);
5151

5252
/**
5353
* Another heuristic that return true if the bitcast instruction is
5454
* interesting to take into the DTA relational graph (use the presence or not
5555
* of vtable)
5656
*/
57-
bool heuristicAntiConstructorVtablePos(const llvm::BitCastInst *bitcast);
57+
bool heuristicAntiConstructorVtablePos(const llvm::BitCastInst *BitCast);
5858

5959
public:
6060
DTAResolver(ProjectIRDB &IRDB, LLVMTypeHierarchy &TH);

0 commit comments

Comments
 (0)