From 85f61c6f517b228272f4a1e408c544d211f48b73 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 3 Oct 2024 14:22:35 -0400 Subject: [PATCH] chore: update pre-commit hooks (#1137) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update pre-commit hooks updates: - [github.com/pre-commit/mirrors-clang-format: v18.1.8 → v19.1.0](https://github.com/pre-commit/mirrors-clang-format/compare/v18.1.8...v19.1.0) * style: pre-commit fixes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- include/slang/util/TimeTrace.h | 29 +++++++++++++-------------- source/ast/Compilation.cpp | 4 ++-- tests/unittests/util/NumericTests.cpp | 4 +++- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index da5afeb57..014c52c6b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -65,7 +65,7 @@ repos: # clang-format - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v18.1.8 + rev: v19.1.0 hooks: - id: clang-format exclude: ^external/.* diff --git a/include/slang/util/TimeTrace.h b/include/slang/util/TimeTrace.h index eae3728e7..c82b00ae3 100644 --- a/include/slang/util/TimeTrace.h +++ b/include/slang/util/TimeTrace.h @@ -56,22 +56,21 @@ class SLANG_EXPORT TimeTrace { /// When the object is constructed, it begins the trace section and when /// it is destroyed, it stops it. If the time profiler is not initialized /// the overhead is a single branch. -class SLANG_EXPORT TimeTraceScope { -public: - TimeTraceScope(std::string_view name, std::string_view detail) { - if (TimeTrace::isEnabled()) - TimeTrace::beginTrace(name, detail); - } +class SLANG_EXPORT +TimeTraceScope{public: TimeTraceScope(std::string_view name, std::string_view detail){ + if (TimeTrace::isEnabled()) TimeTrace::beginTrace(name, detail); +} // namespace slang - TimeTraceScope(std::string_view name, function_ref detail) { - if (TimeTrace::isEnabled()) - TimeTrace::beginTrace(name, detail); - } +TimeTraceScope(std::string_view name, function_ref detail) { + if (TimeTrace::isEnabled()) + TimeTrace::beginTrace(name, detail); +} - ~TimeTraceScope() { - if (TimeTrace::isEnabled()) - TimeTrace::endTrace(); - } -}; +~TimeTraceScope() { + if (TimeTrace::isEnabled()) + TimeTrace::endTrace(); +} +} +; } // namespace slang diff --git a/source/ast/Compilation.cpp b/source/ast/Compilation.cpp index a6716eb98..8ad2a8e06 100644 --- a/source/ast/Compilation.cpp +++ b/source/ast/Compilation.cpp @@ -2392,8 +2392,8 @@ void Compilation::resolveDefParamsAndBinds() { } template -auto findDefByLib(TDefList& defList, - const SourceLibrary& target) -> std::remove_reference_t { +auto findDefByLib(TDefList& defList, const SourceLibrary& target) + -> std::remove_reference_t { for (auto def : defList) { if (def->getSourceLibrary() == &target) return def; diff --git a/tests/unittests/util/NumericTests.cpp b/tests/unittests/util/NumericTests.cpp index 19b081166..7530305fa 100644 --- a/tests/unittests/util/NumericTests.cpp +++ b/tests/unittests/util/NumericTests.cpp @@ -230,7 +230,9 @@ TEST_CASE("SVInt to string (and back)") { CHECK(ss.str() == "1"); // This caught a heap corruption bug in from-string truncation. - { "54'bxx0111x10xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"_si; } + { + "54'bxx0111x10xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"_si; + } CHECK("96'hx00000Z101"_si.toString(LiteralBase::Decimal, false) == "X"); CHECK("96'hxxxxxxxxxxxxxxxxxxxxxxxx"_si.toString(LiteralBase::Decimal, false) == "x");