Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update pre-commit hooks #1137

Merged
merged 2 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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