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 Nov 4, 2022
1 parent dc1788a commit 1ba07a0
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 15 deletions.
4 changes: 2 additions & 2 deletions bindings/python/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ void registerTypes(py::module_& m) {
.def_readwrite("elideScopeNames", &TypePrintingOptions::elideScopeNames)
.def_readwrite("printAKA", &TypePrintingOptions::printAKA)
.def_readwrite("anonymousTypeStyle", &TypePrintingOptions::anonymousTypeStyle);
.def_readwrite("skipScopedTypeNames", &TypePrintingOptions::anonymousTypeStyle);
.def_readwrite("fullEnumType", &TypePrintingOptions::anonymousTypeStyle);
.def_readwrite("skipScopedTypeNames", &TypePrintingOptions::anonymousTypeStyle);
.def_readwrite("fullEnumType", &TypePrintingOptions::anonymousTypeStyle);

py::enum_<TypePrintingOptions::AnonymousTypeStyle>(typePrintingOptions, "AnonymousTypeStyle")
.value("SystemName", TypePrintingOptions::SystemName)
Expand Down
5 changes: 3 additions & 2 deletions include/slang/numeric/ConstantValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ class SLANG_EXPORT ConstantValue {
Variant& getVariant() { return value; }
const Variant& getVariant() const { return value; }

std::string toString(bitwidth_t abbreviateThresholdBits = SVInt::DefaultStringAbbreviationThresholdBits,
bool exactUnknowns = false, bool useAssignmentPatterns = false) const;
std::string toString(
bitwidth_t abbreviateThresholdBits = SVInt::DefaultStringAbbreviationThresholdBits,
bool exactUnknowns = false, bool useAssignmentPatterns = false) const;
size_t hash() const;

[[nodiscard]] bool empty() const;
Expand Down
11 changes: 6 additions & 5 deletions include/slang/numeric/SVInt.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,14 +296,15 @@ class SLANG_EXPORT SVInt : SVIntStorage {
static SVInt createFillZ(bitwidth_t bitWidth, bool isSigned);

[[nodiscard]] size_t hash() const;
void writeTo(SmallVectorBase<char>& buffer, LiteralBase base, bitwidth_t
abbreviateThresholdBits = DefaultStringAbbreviationThresholdBits) const;
void writeTo(SmallVectorBase<char>& buffer, LiteralBase base,
bitwidth_t abbreviateThresholdBits = DefaultStringAbbreviationThresholdBits) const;
void writeTo(SmallVectorBase<char>& buffer, LiteralBase base, bool includeBase,
bitwidth_t abbreviateThresholdBits = MAX_BITS) const;
std::string toString(bitwidth_t abbreviateThresholdBits =
DefaultStringAbbreviationThresholdBits, bool exactUnknowns = false) const;
std::string toString(
bitwidth_t abbreviateThresholdBits = DefaultStringAbbreviationThresholdBits,
bool exactUnknowns = false) const;
std::string toString(LiteralBase base, bitwidth_t abbreviateThresholdBits =
DefaultStringAbbreviationThresholdBits) const;
DefaultStringAbbreviationThresholdBits) const;
std::string toString(LiteralBase base, bool includeBase,
bitwidth_t abbreviateThresholdBits = MAX_BITS) const;

Expand Down
15 changes: 10 additions & 5 deletions source/ast/types/TypePrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ void TypePrinter::visit(const EnumType& type, string_view overrideName) {
}
buffer->append("}");

if (options.skipScopedTypeNames);
if (options.skipScopedTypeNames)
;
else if (!overrideName.empty())
buffer->append(overrideName);
else {
Expand Down Expand Up @@ -147,7 +148,8 @@ void TypePrinter::visit(const PackedStructType& type, string_view overrideName)

appendMembers(type);

if (options.skipScopedTypeNames);
if (options.skipScopedTypeNames)
;
else if (!overrideName.empty())
buffer->append(overrideName);
else {
Expand All @@ -173,7 +175,8 @@ void TypePrinter::visit(const PackedUnionType& type, string_view overrideName) {

appendMembers(type);

if (options.skipScopedTypeNames);
if (options.skipScopedTypeNames)
;
else if (!overrideName.empty())
buffer->append(overrideName);
else {
Expand Down Expand Up @@ -248,7 +251,8 @@ void TypePrinter::visit(const UnpackedStructType& type, string_view overrideName
buffer->append("struct");
appendMembers(type);

if (options.skipScopedTypeNames);
if (options.skipScopedTypeNames)
;
else if (!overrideName.empty())
buffer->append(overrideName);
else {
Expand All @@ -271,7 +275,8 @@ void TypePrinter::visit(const UnpackedUnionType& type, string_view overrideName)
buffer->append("union");
appendMembers(type);

if (options.skipScopedTypeNames);
if (options.skipScopedTypeNames)
;
else if (!overrideName.empty())
buffer->append(overrideName);
else {
Expand Down
3 changes: 2 additions & 1 deletion source/numeric/ConstantValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ std::string ConstantValue::toString(bitwidth_t abbreviateThresholdBits, bool exa
if (!arg->activeMember)
return "(unset)"s;

return fmt::format("({}) {}", *arg->activeMember, arg->value.toString(abbreviateThresholdBits));
return fmt::format("({}) {}", *arg->activeMember,
arg->value.toString(abbreviateThresholdBits));
}
else {
static_assert(always_false<T>::value, "Missing case");
Expand Down

0 comments on commit 1ba07a0

Please sign in to comment.