Skip to content

Commit cfcb28a

Browse files
committed
minor
1 parent 186a1f5 commit cfcb28a

5 files changed

Lines changed: 18 additions & 16 deletions

File tree

include/phasar/PhasarLLVM/ControlFlow/CFGBase.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ template <typename Derived> class CFGBase {
4141
return self().getPredsOfImpl(Inst);
4242
}
4343
/// Returns an iterable range of all successor instructions of Inst in the
44-
/// CFG. NOTE: This function is typically being caled in a hot part of the
44+
/// CFG. NOTE: This function is typically being called in a hot part of the
4545
/// analysis and should therefore be highly optimized for performance
4646
[[nodiscard]] decltype(auto) getSuccsOf(ByConstRef<n_t> Inst) const {
4747
static_assert(
@@ -143,6 +143,7 @@ template <typename Derived> class CFGBase {
143143
};
144144

145145
template <typename ICF, typename Domain>
146+
// NOLINTNEXTLINE(readability-identifier-naming)
146147
constexpr bool is_cfg_v = is_crtp_base_of_v<CFGBase, ICF>
147148
&&std::is_same_v<typename ICF::n_t, typename Domain::n_t>
148149
&&std::is_same_v<typename ICF::f_t, typename Domain::f_t>;

include/phasar/PhasarLLVM/ControlFlow/ICFGBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ template <typename Derived> class ICFGBase {
6666
}
6767
/// Returns an iterable range of all possible callee candidates at the given
6868
/// call-site induced by the used call-graph. NOTE: This function is typically
69-
/// called in a hot part of the analysis any should therefore be very fast
69+
/// called in a hot part of the analysis and should therefore be very fast
7070
[[nodiscard]] decltype(auto) getCalleesOfCallAt(ByConstRef<n_t> Inst) const {
7171
static_assert(
7272
is_iterable_over_v<decltype(self().getCalleesOfCallAtImpl(Inst)), f_t>);

include/phasar/PhasarLLVM/ControlFlow/LLVMBasedICFG.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ class LLVMBasedICFG : public LLVMBasedCFG, public ICFGBase<LLVMBasedICFG> {
8686
/// \param IncludeGlobals Properly include global constructors/destructors
8787
/// into the ICFG, if true. Requires to generate artificial functions into the
8888
/// IRDB. True by default
89-
9089
explicit LLVMBasedICFG(ProjectIRDB *IRDB, CallGraphAnalysisType CGType,
9190
llvm::ArrayRef<std::string> EntryPoints = {},
9291
LLVMTypeHierarchy *TH = nullptr,

lib/PhasarLLVM/ControlFlow/LLVMBasedCFG.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "phasar/Utils/LLVMIRToSrc.h"
1414
#include "phasar/Utils/LLVMShorthands.h"
1515

16+
#include "llvm/ADT/StringExtras.h"
1617
#include "llvm/ADT/StringSwitch.h"
1718
#include "llvm/Demangle/Demangle.h"
1819
#include "llvm/IR/IntrinsicInst.h"
@@ -136,9 +137,10 @@ auto detail::LLVMBasedCFGImpl<Derived>::getStartPointsOfImpl(f_t Fun) const
136137
}
137138
return {EntryInst};
138139
}
139-
PHASAR_LOG_LEVEL(DEBUG, "Could not get starting points of '"
140-
<< Fun->getName()
141-
<< "' because it is a declaration");
140+
PHASAR_LOG_LEVEL_CAT(DEBUG, "LLVMBasedCFG",
141+
"Could not get starting points of '"
142+
<< Fun->getName()
143+
<< "' because it is a declaration");
142144
return {};
143145
}
144146

@@ -153,8 +155,9 @@ auto detail::LLVMBasedCFGImpl<Derived>::getExitPointsOfImpl(f_t Fun) const
153155
// A function can have more than one exit point
154156
return psr::getAllExitPoints(Fun);
155157
}
156-
PHASAR_LOG_LEVEL(DEBUG, "Could not get exit points of '"
157-
<< Fun->getName() << "' which is declaration!");
158+
PHASAR_LOG_LEVEL_CAT(DEBUG, "LLVMBasedCFG",
159+
"Could not get exit points of '"
160+
<< Fun->getName() << "' which is declaration!");
158161
return {};
159162
}
160163

lib/PhasarLLVM/ControlFlow/LLVMBasedICFGGlobalsImpl.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,18 @@ static llvm::Function *createDtorCallerForModule(
146146
[[nodiscard]] static llvm::Function *collectRegisteredDtors(
147147
std::multimap<size_t, llvm::Function *, std::greater<>> &GlobalDtors,
148148
llvm::Module &Mod) {
149-
PHASAR_LOG_LEVEL(DEBUG,
150-
"Collect Registered Dtors for Module " << Mod.getName());
149+
PHASAR_LOG_LEVEL_CAT(DEBUG, "LLVMBasedICFG",
150+
"Collect Registered Dtors for Module " << Mod.getName());
151151

152152
auto RegisteredDtors = collectRegisteredDtorsForModule(Mod);
153153

154154
if (RegisteredDtors.empty()) {
155155
return nullptr;
156156
}
157157

158-
PHASAR_LOG_LEVEL(DEBUG,
159-
"> Found " << RegisteredDtors.size() << " Registered Dtors");
158+
PHASAR_LOG_LEVEL_CAT(DEBUG, "LLVMBasedICFG",
159+
"> Found " << RegisteredDtors.size()
160+
<< " Registered Dtors");
160161

161162
auto *RegisteredDtorCaller = createDtorCallerForModule(Mod, RegisteredDtors);
162163
// auto It =
@@ -281,10 +282,8 @@ llvm::Function *LLVMBasedICFG::buildCRuntimeGlobalCtorsDtorsModel(
281282
IRB.CreateRetVoid();
282283
} else {
283284

284-
auto *UEntrySelectorFn = llvm::cast<llvm::Function>(
285-
M.getOrInsertFunction("__psrCRuntimeUserEntrySelector",
286-
llvm::Type::getInt32Ty(CTX))
287-
.getCallee());
285+
auto UEntrySelectorFn = M.getOrInsertFunction(
286+
"__psrCRuntimeUserEntrySelector", llvm::Type::getInt32Ty(CTX));
288287

289288
auto *UEntrySelector = IRB.CreateCall(UEntrySelectorFn, {});
290289

0 commit comments

Comments
 (0)