Skip to content

Commit

Permalink
style: pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Sep 30, 2024
1 parent 58983c5 commit 0fa3247
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
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 0fa3247

Please sign in to comment.