From 6c266cfb99e1bbf90c0f7507b6321399ddafd0bc Mon Sep 17 00:00:00 2001 From: Fabian Schiebel Date: Mon, 23 Mar 2026 18:09:29 +0100 Subject: [PATCH 1/2] Update code format --- include/phasar/ControlFlow/SparseCFGBase.h | 7 ++++--- .../DataFlow/IfdsIde/Solver/FlowEdgeFunctionCache.h | 8 ++++---- .../phasar/DataFlow/IfdsIde/Solver/PathAwareIDESolver.h | 4 ++-- include/phasar/DataFlow/IfdsIde/Solver/PathEdge.h | 4 ++-- .../PathSensitivity/Z3BasedPathSensitivityConfig.h | 4 ++-- include/phasar/Utils/Logger.h | 9 ++++++--- include/phasar/Utils/Table.h | 4 ++-- test/llvm_test_code/call_graphs/function_pointer_3.cpp | 2 +- test/llvm_test_code/globals/globals_lca_5.cpp | 2 +- unittests/Utils/OnTheFlyAnalysisPrinterTest.cpp | 2 +- 10 files changed, 25 insertions(+), 21 deletions(-) diff --git a/include/phasar/ControlFlow/SparseCFGBase.h b/include/phasar/ControlFlow/SparseCFGBase.h index 3d5f531c26..074f829d04 100644 --- a/include/phasar/ControlFlow/SparseCFGBase.h +++ b/include/phasar/ControlFlow/SparseCFGBase.h @@ -34,9 +34,10 @@ template class SparseCFGBase : public CFGBase { template // NOLINTNEXTLINE(readability-identifier-naming) -constexpr bool is_sparse_cfg_v = is_crtp_base_of_v - &&std::is_same_v - &&std::is_same_v; +constexpr bool is_sparse_cfg_v = + is_crtp_base_of_v && + std::is_same_v && + std::is_same_v; } // namespace psr diff --git a/include/phasar/DataFlow/IfdsIde/Solver/FlowEdgeFunctionCache.h b/include/phasar/DataFlow/IfdsIde/Solver/FlowEdgeFunctionCache.h index 637eaa083c..09b48c89c5 100644 --- a/include/phasar/DataFlow/IfdsIde/Solver/FlowEdgeFunctionCache.h +++ b/include/phasar/DataFlow/IfdsIde/Solver/FlowEdgeFunctionCache.h @@ -292,8 +292,8 @@ class FlowEdgeFunctionCache { PHASAR_LOG_LEVEL(DEBUG, "(N) Call Site : " << NToString(CallSite)); PHASAR_LOG_LEVEL(DEBUG, "(N) Ret Site : " << NToString(RetSite)); - PHASAR_LOG_LEVEL(DEBUG, "(F) Callee's : "); for (auto callee - : Callees) { + PHASAR_LOG_LEVEL(DEBUG, "(F) Callee's : "); + for (auto callee : Callees) { PHASAR_LOG_LEVEL(DEBUG, " " << FToString(callee)); };); auto Key = std::tie(CallSite, RetSite); @@ -462,8 +462,8 @@ class FlowEdgeFunctionCache { PHASAR_LOG_LEVEL(DEBUG, "(N) Ret Site : " << NToString(RetSite)); PHASAR_LOG_LEVEL(DEBUG, "(D) Ret Node : " << DToString(RetSiteNode)); - PHASAR_LOG_LEVEL(DEBUG, "(F) Callee's : "); for (auto callee - : Callees) { + PHASAR_LOG_LEVEL(DEBUG, "(F) Callee's : "); + for (auto callee : Callees) { PHASAR_LOG_LEVEL(DEBUG, " " << FToString(callee)); }); diff --git a/include/phasar/DataFlow/IfdsIde/Solver/PathAwareIDESolver.h b/include/phasar/DataFlow/IfdsIde/Solver/PathAwareIDESolver.h index 711932c878..b8c0912152 100644 --- a/include/phasar/DataFlow/IfdsIde/Solver/PathAwareIDESolver.h +++ b/include/phasar/DataFlow/IfdsIde/Solver/PathAwareIDESolver.h @@ -42,11 +42,11 @@ class PathAwareIDESolver : public IDESolver { } [[nodiscard]] const ExplodedSuperGraph & - getExplicitESG() const &noexcept { + getExplicitESG() const & noexcept { return ESG; } - [[nodiscard]] ExplodedSuperGraph &&getExplicitESG() &&noexcept { + [[nodiscard]] ExplodedSuperGraph &&getExplicitESG() && noexcept { return std::move(ESG); } diff --git a/include/phasar/DataFlow/IfdsIde/Solver/PathEdge.h b/include/phasar/DataFlow/IfdsIde/Solver/PathEdge.h index 9bbd90c196..dc1bd2e4e4 100644 --- a/include/phasar/DataFlow/IfdsIde/Solver/PathEdge.h +++ b/include/phasar/DataFlow/IfdsIde/Solver/PathEdge.h @@ -22,8 +22,8 @@ template class PathEdge { public: PathEdge(D DSource, N Target, - D DTarget) noexcept(std::is_nothrow_move_constructible_v - &&std::is_nothrow_move_constructible_v) + D DTarget) noexcept(std::is_nothrow_move_constructible_v && + std::is_nothrow_move_constructible_v) : DSource(std::move(DSource)), Target(std::move(Target)), DTarget(std::move(DTarget)) {} diff --git a/include/phasar/PhasarLLVM/DataFlow/PathSensitivity/Z3BasedPathSensitivityConfig.h b/include/phasar/PhasarLLVM/DataFlow/PathSensitivity/Z3BasedPathSensitivityConfig.h index 3d219f5fcd..39576dbc03 100644 --- a/include/phasar/PhasarLLVM/DataFlow/PathSensitivity/Z3BasedPathSensitivityConfig.h +++ b/include/phasar/PhasarLLVM/DataFlow/PathSensitivity/Z3BasedPathSensitivityConfig.h @@ -22,7 +22,7 @@ struct Z3BasedPathSensitivityConfig std::optional AdditionalConstraint; [[nodiscard]] Z3BasedPathSensitivityConfig - withAdditionalConstraint(const z3::expr &Constr) const &noexcept { + withAdditionalConstraint(const z3::expr &Constr) const & noexcept { auto Ret = *this; Ret.AdditionalConstraint = Ret.AdditionalConstraint ? *Ret.AdditionalConstraint && Constr : Constr; @@ -30,7 +30,7 @@ struct Z3BasedPathSensitivityConfig } [[nodiscard]] Z3BasedPathSensitivityConfig - withAdditionalConstraint(const z3::expr &Constr) &&noexcept { + withAdditionalConstraint(const z3::expr &Constr) && noexcept { AdditionalConstraint = AdditionalConstraint ? *AdditionalConstraint && Constr : Constr; return std::move(*this); diff --git a/include/phasar/Utils/Logger.h b/include/phasar/Utils/Logger.h index abf1fd65e6..cc80addcbe 100644 --- a/include/phasar/Utils/Logger.h +++ b/include/phasar/Utils/Logger.h @@ -143,12 +143,15 @@ class Logger final { #else #define IS_LOG_ENABLED false #define IF_LOG_ENABLED_BOOL(condition, computation) \ - {} + { \ + } #define IF_LOG_ENABLED(computation) \ - {} + { \ + } #define IS_LOG_LEVEL_ENABLED(level) false #define IF_LOG_LEVEL_ENABLED(level, computation) \ - {} + { \ + } #define PHASAR_LOG(computation) (void)0 #define PHASAR_LOG_CAT(cat, message) (void)0 #define PHASAR_LOG_LEVEL_CAT(level, cat, message) (void)0 diff --git a/include/phasar/Utils/Table.h b/include/phasar/Utils/Table.h index 0a8a3b33ac..77734bfde4 100644 --- a/include/phasar/Utils/Table.h +++ b/include/phasar/Utils/Table.h @@ -267,13 +267,13 @@ template class Table { } [[nodiscard]] const std::unordered_map> & - rowMap() const &noexcept { + rowMap() const & noexcept { // Returns a view that associates each row key with the corresponding map // from column keys to values. return Tab; } [[nodiscard]] std::unordered_map> && - rowMap() &&noexcept { + rowMap() && noexcept { // Returns a view that associates each row key with the corresponding map // from column keys to values. return std::move(Tab); diff --git a/test/llvm_test_code/call_graphs/function_pointer_3.cpp b/test/llvm_test_code/call_graphs/function_pointer_3.cpp index 056354408d..2bf3412636 100644 --- a/test/llvm_test_code/call_graphs/function_pointer_3.cpp +++ b/test/llvm_test_code/call_graphs/function_pointer_3.cpp @@ -6,7 +6,7 @@ int bar(int i) { return 13; } int main() { int (*fptr)(); fptr = &foo; - fptr = (int (*)()) & bar; + fptr = (int (*)())&bar; int result = fptr(); return result; } diff --git a/test/llvm_test_code/globals/globals_lca_5.cpp b/test/llvm_test_code/globals/globals_lca_5.cpp index f5371b861e..087a36c890 100644 --- a/test/llvm_test_code/globals/globals_lca_5.cpp +++ b/test/llvm_test_code/globals/globals_lca_5.cpp @@ -39,7 +39,7 @@ Foo foo; __attribute__((constructor)) void makeGlobalFoo() { foo = createFoo(); - __cxa_atexit((void (*)(void *)) & Foo_dtor, &foo, nullptr); + __cxa_atexit((void (*)(void *))&Foo_dtor, &foo, nullptr); } int main() { printf("x: %d\n", foo); } diff --git a/unittests/Utils/OnTheFlyAnalysisPrinterTest.cpp b/unittests/Utils/OnTheFlyAnalysisPrinterTest.cpp index f3cd874d5a..30c9e88351 100644 --- a/unittests/Utils/OnTheFlyAnalysisPrinterTest.cpp +++ b/unittests/Utils/OnTheFlyAnalysisPrinterTest.cpp @@ -23,7 +23,7 @@ class GroundTruthCollector public: // constructor init Groundtruth in each fixture GroundTruthCollector(llvm::DenseMap> &GroundTruth) - : GroundTruth(GroundTruth){}; + : GroundTruth(GroundTruth) {}; void findAndRemove(int LeakId, const std::string &LeakedFactId) { From 2a6af8017d5b0daee9341f3150ed7fe22a448ed1 Mon Sep 17 00:00:00 2001 From: Fabian Schiebel Date: Tue, 24 Mar 2026 18:30:38 +0100 Subject: [PATCH 2/2] Update pre-commit --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5543f809cf..10157758b6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v6.0.0 hooks: - id: trailing-whitespace exclude: "^.*\\.patch$"