Skip to content

Commit

Permalink
chore: update pre-commit hooks (#1137)
Browse files Browse the repository at this point in the history
* chore: update pre-commit hooks

updates:
- [github.com/pre-commit/mirrors-clang-format: v18.1.8 → v19.1.0](pre-commit/mirrors-clang-format@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>
  • Loading branch information
pre-commit-ci[bot] authored Oct 3, 2024
1 parent 39d3d29 commit 85f61c6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/.*
29 changes: 14 additions & 15 deletions include/slang/util/TimeTrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string()> detail) {
if (TimeTrace::isEnabled())
TimeTrace::beginTrace(name, detail);
}
TimeTraceScope(std::string_view name, function_ref<std::string()> detail) {
if (TimeTrace::isEnabled())
TimeTrace::beginTrace(name, detail);
}

~TimeTraceScope() {
if (TimeTrace::isEnabled())
TimeTrace::endTrace();
}
};
~TimeTraceScope() {
if (TimeTrace::isEnabled())
TimeTrace::endTrace();
}
}
;

} // namespace slang
4 changes: 2 additions & 2 deletions source/ast/Compilation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2392,8 +2392,8 @@ void Compilation::resolveDefParamsAndBinds() {
}

template<typename TDefList>
auto findDefByLib(TDefList& defList,
const SourceLibrary& target) -> std::remove_reference_t<decltype(defList[0])> {
auto findDefByLib(TDefList& defList, const SourceLibrary& target)
-> std::remove_reference_t<decltype(defList[0])> {
for (auto def : defList) {
if (def->getSourceLibrary() == &target)
return def;
Expand Down
4 changes: 3 additions & 1 deletion tests/unittests/util/NumericTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 85f61c6

Please sign in to comment.