diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 36da51edc..f6b60fe2a 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: v17.0.6 + rev: v18.1.1 hooks: - id: clang-format exclude: ^external/.* diff --git a/bindings/python/NumericBindings.cpp b/bindings/python/NumericBindings.cpp index 4af1f37ee..e194c63ac 100644 --- a/bindings/python/NumericBindings.cpp +++ b/bindings/python/NumericBindings.cpp @@ -330,10 +330,8 @@ void registerNumeric(py::module_& m) { py::class_(m, "ConstantRange") .def(py::init<>()) - .def(py::init([](int left, int right) { - return ConstantRange{left, right}; - }), - "left"_a, "right"_a) + .def(py::init([](int left, int right) { return ConstantRange{left, right}; }), "left"_a, + "right"_a) .def_readwrite("left", &ConstantRange::left) .def_readwrite("right", &ConstantRange::right) .def_property_readonly("width", &ConstantRange::width) diff --git a/include/slang/ast/ASTContext.h b/include/slang/ast/ASTContext.h index 371425f54..bc6c816a5 100644 --- a/include/slang/ast/ASTContext.h +++ b/include/slang/ast/ASTContext.h @@ -350,8 +350,7 @@ class SLANG_EXPORT ASTContext { /// @param flags Flags that control AST creation ASTContext(const Scope& scope, LookupLocation lookupLocation, bitmask flags = ASTFlags::None) : - scope(&scope), - lookupIndex(lookupLocation.getIndex()), flags(flags) { + scope(&scope), lookupIndex(lookupLocation.getIndex()), flags(flags) { SLANG_ASSERT(!lookupLocation.getScope() || lookupLocation.getScope() == &scope); } diff --git a/include/slang/ast/Compilation.h b/include/slang/ast/Compilation.h index 963030fa5..c8497cba5 100644 --- a/include/slang/ast/Compilation.h +++ b/include/slang/ast/Compilation.h @@ -370,8 +370,7 @@ class SLANG_EXPORT Compilation : public BumpAllocator { DefinitionLookupResult(const Symbol* definition, const ConfigBlockSymbol* configRoot, const ConfigRule* configRule) : - definition(definition), - configRoot(configRoot), configRule(configRule) {} + definition(definition), configRoot(configRoot), configRule(configRule) {} }; /// Gets the definition with the given name, or nullptr if there is no such definition. diff --git a/include/slang/ast/Constraints.h b/include/slang/ast/Constraints.h index 78e3aff65..6f2852c09 100644 --- a/include/slang/ast/Constraints.h +++ b/include/slang/ast/Constraints.h @@ -169,8 +169,8 @@ class SLANG_EXPORT ConditionalConstraint : public Constraint { ConditionalConstraint(const Expression& predicate, const Constraint& ifBody, const Constraint* elseBody) : - Constraint(ConstraintKind::Conditional), - predicate(predicate), ifBody(ifBody), elseBody(elseBody) {} + Constraint(ConstraintKind::Conditional), predicate(predicate), ifBody(ifBody), + elseBody(elseBody) {} static Constraint& fromSyntax(const syntax::ConditionalConstraintSyntax& syntax, const ASTContext& context); @@ -239,8 +239,7 @@ class SLANG_EXPORT SolveBeforeConstraint : public Constraint { SolveBeforeConstraint(std::span solve, std::span before) : - Constraint(ConstraintKind::SolveBefore), - solve(solve), before(before) {} + Constraint(ConstraintKind::SolveBefore), solve(solve), before(before) {} static Constraint& fromSyntax(const syntax::SolveBeforeConstraintSyntax& syntax, const ASTContext& context); @@ -268,8 +267,7 @@ class SLANG_EXPORT ForeachConstraint : public Constraint { ForeachConstraint(const Expression& arrayRef, std::span loopDims, const Constraint& body) : - Constraint(ConstraintKind::Foreach), - arrayRef(arrayRef), loopDims(loopDims), body(body) {} + Constraint(ConstraintKind::Foreach), arrayRef(arrayRef), loopDims(loopDims), body(body) {} static Constraint& fromSyntax(const syntax::LoopConstraintSyntax& syntax, const ASTContext& context); diff --git a/include/slang/ast/Statements.h b/include/slang/ast/Statements.h index 47fb2b9c9..71aafc576 100644 --- a/include/slang/ast/Statements.h +++ b/include/slang/ast/Statements.h @@ -434,8 +434,8 @@ class SLANG_EXPORT ConditionalStatement : public Statement { ConditionalStatement(std::span conditions, UniquePriorityCheck check, const Statement& ifTrue, const Statement* ifFalse, SourceRange sourceRange) : - Statement(StatementKind::Conditional, sourceRange), - conditions(conditions), ifTrue(ifTrue), ifFalse(ifFalse), check(check) {} + Statement(StatementKind::Conditional, sourceRange), conditions(conditions), ifTrue(ifTrue), + ifFalse(ifFalse), check(check) {} EvalResult evalImpl(EvalContext& context) const; @@ -480,8 +480,8 @@ class SLANG_EXPORT CaseStatement : public Statement { CaseStatement(CaseStatementCondition condition, UniquePriorityCheck check, const Expression& expr, std::span items, const Statement* defaultCase, SourceRange sourceRange) : - Statement(StatementKind::Case, sourceRange), - expr(expr), items(items), defaultCase(defaultCase), condition(condition), check(check) {} + Statement(StatementKind::Case, sourceRange), expr(expr), items(items), + defaultCase(defaultCase), condition(condition), check(check) {} EvalResult evalImpl(EvalContext& context) const; @@ -528,8 +528,8 @@ class SLANG_EXPORT PatternCaseStatement : public Statement { PatternCaseStatement(CaseStatementCondition condition, UniquePriorityCheck check, const Expression& expr, std::span items, const Statement* defaultCase, SourceRange sourceRange) : - Statement(StatementKind::PatternCase, sourceRange), - expr(expr), items(items), defaultCase(defaultCase), condition(condition), check(check) {} + Statement(StatementKind::PatternCase, sourceRange), expr(expr), items(items), + defaultCase(defaultCase), condition(condition), check(check) {} EvalResult evalImpl(EvalContext& context) const; @@ -571,8 +571,8 @@ class SLANG_EXPORT ForLoopStatement : public Statement { ForLoopStatement(std::span initializers, const Expression* stopExpr, std::span steps, const Statement& body, SourceRange sourceRange) : - Statement(StatementKind::ForLoop, sourceRange), - initializers(initializers), stopExpr(stopExpr), steps(steps), body(body) {} + Statement(StatementKind::ForLoop, sourceRange), initializers(initializers), + stopExpr(stopExpr), steps(steps), body(body) {} EvalResult evalImpl(EvalContext& context) const; @@ -648,8 +648,8 @@ class SLANG_EXPORT ForeachLoopStatement : public Statement { ForeachLoopStatement(const Expression& arrayRef, std::span loopDims, const Statement& body, SourceRange sourceRange) : - Statement(StatementKind::ForeachLoop, sourceRange), - arrayRef(arrayRef), loopDims(loopDims), body(body) {} + Statement(StatementKind::ForeachLoop, sourceRange), arrayRef(arrayRef), loopDims(loopDims), + body(body) {} EvalResult evalImpl(EvalContext& context) const; @@ -828,9 +828,8 @@ class SLANG_EXPORT ImmediateAssertionStatement : public Statement { ImmediateAssertionStatement(AssertionKind assertionKind, const Expression& cond, const Statement* ifTrue, const Statement* ifFalse, bool isDeferred, bool isFinal, SourceRange sourceRange) : - Statement(StatementKind::ImmediateAssertion, sourceRange), - cond(cond), ifTrue(ifTrue), ifFalse(ifFalse), assertionKind(assertionKind), - isDeferred(isDeferred), isFinal(isFinal) {} + Statement(StatementKind::ImmediateAssertion, sourceRange), cond(cond), ifTrue(ifTrue), + ifFalse(ifFalse), assertionKind(assertionKind), isDeferred(isDeferred), isFinal(isFinal) {} EvalResult evalImpl(EvalContext& context) const; @@ -866,9 +865,8 @@ class SLANG_EXPORT ConcurrentAssertionStatement : public Statement { ConcurrentAssertionStatement(AssertionKind assertionKind, const AssertionExpr& propertySpec, const Statement* ifTrue, const Statement* ifFalse, SourceRange sourceRange) : - Statement(StatementKind::ConcurrentAssertion, sourceRange), - propertySpec(propertySpec), ifTrue(ifTrue), ifFalse(ifFalse), assertionKind(assertionKind) { - } + Statement(StatementKind::ConcurrentAssertion, sourceRange), propertySpec(propertySpec), + ifTrue(ifTrue), ifFalse(ifFalse), assertionKind(assertionKind) {} EvalResult evalImpl(EvalContext& context) const; @@ -961,8 +959,8 @@ class SLANG_EXPORT WaitOrderStatement : public Statement { WaitOrderStatement(std::span events, const Statement* ifTrue, const Statement* ifFalse, SourceRange sourceRange) : - Statement(StatementKind::WaitOrder, sourceRange), - events(events), ifTrue(ifTrue), ifFalse(ifFalse) {} + Statement(StatementKind::WaitOrder, sourceRange), events(events), ifTrue(ifTrue), + ifFalse(ifFalse) {} EvalResult evalImpl(EvalContext& context) const; @@ -997,8 +995,8 @@ class SLANG_EXPORT EventTriggerStatement : public Statement { EventTriggerStatement(const Expression& target, const TimingControl* timing, bool isNonBlocking, SourceRange sourceRange) : - Statement(StatementKind::EventTrigger, sourceRange), - target(target), timing(timing), isNonBlocking(isNonBlocking) {} + Statement(StatementKind::EventTrigger, sourceRange), target(target), timing(timing), + isNonBlocking(isNonBlocking) {} EvalResult evalImpl(EvalContext& context) const; diff --git a/include/slang/ast/SystemSubroutine.h b/include/slang/ast/SystemSubroutine.h index d9e7fec8a..2e4a958c9 100644 --- a/include/slang/ast/SystemSubroutine.h +++ b/include/slang/ast/SystemSubroutine.h @@ -72,9 +72,8 @@ class SLANG_EXPORT SimpleSystemSubroutine : public SystemSubroutine { SimpleSystemSubroutine(const std::string& name, SubroutineKind kind, size_t requiredArgs, const std::vector& argTypes, const Type& returnType, bool isMethod, bool isFirstArgLValue = false) : - SystemSubroutine(name, kind), - argTypes(argTypes), returnType(&returnType), requiredArgs(requiredArgs), isMethod(isMethod), - isFirstArgLValue(isFirstArgLValue) { + SystemSubroutine(name, kind), argTypes(argTypes), returnType(&returnType), + requiredArgs(requiredArgs), isMethod(isMethod), isFirstArgLValue(isFirstArgLValue) { SLANG_ASSERT(requiredArgs <= argTypes.size()); } diff --git a/include/slang/ast/TimingControl.h b/include/slang/ast/TimingControl.h index a89ee177d..a1979f28b 100644 --- a/include/slang/ast/TimingControl.h +++ b/include/slang/ast/TimingControl.h @@ -131,8 +131,8 @@ class SLANG_EXPORT Delay3Control : public TimingControl { Delay3Control(const Expression& expr1, const Expression* expr2, const Expression* expr3, SourceRange sourceRange) : - TimingControl(TimingControlKind::Delay3, sourceRange), - expr1(expr1), expr2(expr2), expr3(expr3) {} + TimingControl(TimingControlKind::Delay3, sourceRange), expr1(expr1), expr2(expr2), + expr3(expr3) {} static TimingControl& fromSyntax(Compilation& compilation, const syntax::Delay3Syntax& syntax, const ASTContext& context); @@ -163,8 +163,8 @@ class SLANG_EXPORT SignalEventControl : public TimingControl { SignalEventControl(EdgeKind edge, const Expression& expr, const Expression* iffCondition, SourceRange sourceRange) : - TimingControl(TimingControlKind::SignalEvent, sourceRange), - expr(expr), iffCondition(iffCondition), edge(edge) {} + TimingControl(TimingControlKind::SignalEvent, sourceRange), expr(expr), + iffCondition(iffCondition), edge(edge) {} static TimingControl& fromSyntax(Compilation& compilation, const syntax::SignalEventExpressionSyntax& syntax, @@ -241,8 +241,7 @@ class SLANG_EXPORT RepeatedEventControl : public TimingControl { RepeatedEventControl(const Expression& expr, const TimingControl& event, SourceRange sourceRange) : - TimingControl(TimingControlKind::RepeatedEvent, sourceRange), - expr(expr), event(event) {} + TimingControl(TimingControlKind::RepeatedEvent, sourceRange), expr(expr), event(event) {} static TimingControl& fromSyntax(Compilation& compilation, const syntax::RepeatedEventControlSyntax& syntax, diff --git a/include/slang/ast/expressions/AssertionExpr.h b/include/slang/ast/expressions/AssertionExpr.h index 9a7207d3e..0c2cd0b83 100644 --- a/include/slang/ast/expressions/AssertionExpr.h +++ b/include/slang/ast/expressions/AssertionExpr.h @@ -255,8 +255,8 @@ class SLANG_EXPORT SequenceWithMatchExpr : public AssertionExpr { SequenceWithMatchExpr(const AssertionExpr& expr, std::optional repetition, std::span matchItems) : - AssertionExpr(AssertionExprKind::SequenceWithMatch), - expr(expr), repetition(repetition), matchItems(matchItems) {} + AssertionExpr(AssertionExprKind::SequenceWithMatch), expr(expr), repetition(repetition), + matchItems(matchItems) {} bool admitsEmptyImpl() const; @@ -286,8 +286,7 @@ class SLANG_EXPORT UnaryAssertionExpr : public AssertionExpr { UnaryAssertionExpr(UnaryAssertionOperator op, const AssertionExpr& expr, std::optional range) : - AssertionExpr(AssertionExprKind::Unary), - op(op), expr(expr), range(range) {} + AssertionExpr(AssertionExprKind::Unary), op(op), expr(expr), range(range) {} bool admitsEmptyImpl() const { return false; } @@ -316,8 +315,7 @@ class SLANG_EXPORT BinaryAssertionExpr : public AssertionExpr { BinaryAssertionExpr(BinaryAssertionOperator op, const AssertionExpr& left, const AssertionExpr& right) : - AssertionExpr(AssertionExprKind::Binary), - op(op), left(left), right(right) {} + AssertionExpr(AssertionExprKind::Binary), op(op), left(left), right(right) {} void requireSequence(const ASTContext& context, DiagCode code) const; bool admitsEmptyImpl() const; @@ -347,8 +345,7 @@ class SLANG_EXPORT FirstMatchAssertionExpr : public AssertionExpr { FirstMatchAssertionExpr(const AssertionExpr& seq, std::span matchItems) : - AssertionExpr(AssertionExprKind::FirstMatch), - seq(seq), matchItems(matchItems) {} + AssertionExpr(AssertionExprKind::FirstMatch), seq(seq), matchItems(matchItems) {} bool admitsEmptyImpl() const; @@ -435,8 +432,8 @@ class SLANG_EXPORT AbortAssertionExpr : public AssertionExpr { AbortAssertionExpr(const Expression& condition, const AssertionExpr& expr, Action action, bool isSync) : - AssertionExpr(AssertionExprKind::Abort), - condition(condition), expr(expr), action(action), isSync(isSync) {} + AssertionExpr(AssertionExprKind::Abort), condition(condition), expr(expr), action(action), + isSync(isSync) {} bool admitsEmptyImpl() const { return false; } @@ -463,8 +460,8 @@ class SLANG_EXPORT ConditionalAssertionExpr : public AssertionExpr { ConditionalAssertionExpr(const Expression& condition, const AssertionExpr& ifExpr, const AssertionExpr* elseExpr) : - AssertionExpr(AssertionExprKind::Conditional), - condition(condition), ifExpr(ifExpr), elseExpr(elseExpr) {} + AssertionExpr(AssertionExprKind::Conditional), condition(condition), ifExpr(ifExpr), + elseExpr(elseExpr) {} bool admitsEmptyImpl() const { return false; } @@ -498,8 +495,8 @@ class SLANG_EXPORT CaseAssertionExpr : public AssertionExpr { CaseAssertionExpr(const Expression& expr, std::span items, const AssertionExpr* defaultCase) : - AssertionExpr(AssertionExprKind::Case), - expr(expr), items(items), defaultCase(defaultCase) {} + AssertionExpr(AssertionExprKind::Case), expr(expr), items(items), defaultCase(defaultCase) { + } bool admitsEmptyImpl() const { return false; } diff --git a/include/slang/ast/expressions/AssignmentExpressions.h b/include/slang/ast/expressions/AssignmentExpressions.h index 4c34387fe..1ce616353 100644 --- a/include/slang/ast/expressions/AssignmentExpressions.h +++ b/include/slang/ast/expressions/AssignmentExpressions.h @@ -24,9 +24,8 @@ class SLANG_EXPORT AssignmentExpression : public Expression { AssignmentExpression(std::optional op, bool nonBlocking, const Type& type, Expression& left, Expression& right, const TimingControl* timingControl, SourceRange sourceRange) : - Expression(ExpressionKind::Assignment, type, sourceRange), - op(op), timingControl(timingControl), left_(&left), right_(&right), - nonBlocking(nonBlocking) {} + Expression(ExpressionKind::Assignment, type, sourceRange), op(op), + timingControl(timingControl), left_(&left), right_(&right), nonBlocking(nonBlocking) {} bool isCompound() const { return op.has_value(); } bool isNonBlocking() const { return nonBlocking; } @@ -86,8 +85,8 @@ class SLANG_EXPORT ConversionExpression : public Expression { ConversionExpression(const Type& type, ConversionKind conversionKind, Expression& operand, SourceRange sourceRange) : - Expression(ExpressionKind::Conversion, type, sourceRange), - conversionKind(conversionKind), operand_(&operand) {} + Expression(ExpressionKind::Conversion, type, sourceRange), conversionKind(conversionKind), + operand_(&operand) {} bool isImplicit() const { return conversionKind < ConversionKind::Explicit; } @@ -131,8 +130,8 @@ class SLANG_EXPORT NewArrayExpression : public Expression { public: NewArrayExpression(const Type& type, const Expression& sizeExpr, const Expression* initializer, SourceRange sourceRange) : - Expression(ExpressionKind::NewArray, type, sourceRange), - sizeExpr_(&sizeExpr), initializer_(initializer) {} + Expression(ExpressionKind::NewArray, type, sourceRange), sizeExpr_(&sizeExpr), + initializer_(initializer) {} const Expression& sizeExpr() const { return *sizeExpr_; } const Expression* initExpr() const { return initializer_; } @@ -167,8 +166,8 @@ class SLANG_EXPORT NewClassExpression : public Expression { NewClassExpression(const Type& type, const Expression* constructorCall, bool isSuperClass, SourceRange sourceRange) : - Expression(ExpressionKind::NewClass, type, sourceRange), - isSuperClass(isSuperClass), constructorCall_(constructorCall) {} + Expression(ExpressionKind::NewClass, type, sourceRange), isSuperClass(isSuperClass), + constructorCall_(constructorCall) {} const Expression* constructorCall() const { return constructorCall_; } @@ -199,8 +198,7 @@ class SLANG_EXPORT NewCovergroupExpression : public Expression { NewCovergroupExpression(const Type& type, std::span arguments, SourceRange sourceRange) : - Expression(ExpressionKind::NewCovergroup, type, sourceRange), - arguments(arguments) {} + Expression(ExpressionKind::NewCovergroup, type, sourceRange), arguments(arguments) {} ConstantValue evalImpl(EvalContext& context) const; @@ -238,8 +236,7 @@ class SLANG_EXPORT AssignmentPatternExpressionBase : public Expression { AssignmentPatternExpressionBase(ExpressionKind kind, const Type& type, std::span elements, SourceRange sourceRange) : - Expression(kind, type, sourceRange), - elements_(elements) {} + Expression(kind, type, sourceRange), elements_(elements) {} private: std::span elements_; diff --git a/include/slang/ast/expressions/CallExpression.h b/include/slang/ast/expressions/CallExpression.h index 60dc07100..0bac54e7b 100644 --- a/include/slang/ast/expressions/CallExpression.h +++ b/include/slang/ast/expressions/CallExpression.h @@ -42,9 +42,8 @@ class SLANG_EXPORT CallExpression : public Expression { CallExpression(const Subroutine& subroutine, const Type& returnType, const Expression* thisClass, std::span arguments, LookupLocation lookupLocation, SourceRange sourceRange) : - Expression(ExpressionKind::Call, returnType, sourceRange), - subroutine(subroutine), thisClass_(thisClass), arguments_(arguments), - lookupLocation(lookupLocation) {} + Expression(ExpressionKind::Call, returnType, sourceRange), subroutine(subroutine), + thisClass_(thisClass), arguments_(arguments), lookupLocation(lookupLocation) {} /// If this call is for a class method, returns the expression representing the /// class handle on which the method is being invoked. Otherwise returns nullptr. diff --git a/include/slang/ast/expressions/MiscExpressions.h b/include/slang/ast/expressions/MiscExpressions.h index a9049be9b..00ddbac7e 100644 --- a/include/slang/ast/expressions/MiscExpressions.h +++ b/include/slang/ast/expressions/MiscExpressions.h @@ -174,8 +174,8 @@ class SLANG_EXPORT ClockingEventExpression : public Expression { ClockingEventExpression(const Type& type, const TimingControl& timingControl, SourceRange sourceRange) : - Expression(ExpressionKind::ClockingEvent, type, sourceRange), - timingControl(timingControl) {} + Expression(ExpressionKind::ClockingEvent, type, sourceRange), timingControl(timingControl) { + } ConstantValue evalImpl(EvalContext&) const { return nullptr; } @@ -206,8 +206,8 @@ class SLANG_EXPORT AssertionInstanceExpression : public Expression { AssertionInstanceExpression(const Type& type, const Symbol& symbol, const AssertionExpr& body, bool isRecursiveProperty, SourceRange sourceRange) : - Expression(ExpressionKind::AssertionInstance, type, sourceRange), - symbol(symbol), body(body), isRecursiveProperty(isRecursiveProperty) {} + Expression(ExpressionKind::AssertionInstance, type, sourceRange), symbol(symbol), + body(body), isRecursiveProperty(isRecursiveProperty) {} ConstantValue evalImpl(EvalContext&) const { return nullptr; } @@ -244,8 +244,8 @@ class SLANG_EXPORT MinTypMaxExpression : public Expression { public: MinTypMaxExpression(const Type& type, Expression& min, Expression& typ, Expression& max, Expression* selected, SourceRange sourceRange) : - Expression(ExpressionKind::MinTypMax, type, sourceRange), - selected_(selected), min_(&min), typ_(&typ), max_(&max) {} + Expression(ExpressionKind::MinTypMax, type, sourceRange), selected_(selected), min_(&min), + typ_(&typ), max_(&max) {} const Expression& min() const { return *min_; } Expression& min() { return *min_; } @@ -330,8 +330,7 @@ class SLANG_EXPORT DistExpression : public Expression { DistExpression(const Type& type, const Expression& left, std::span items, SourceRange sourceRange) : - Expression(ExpressionKind::Dist, type, sourceRange), - left_(&left), items_(items) {} + Expression(ExpressionKind::Dist, type, sourceRange), left_(&left), items_(items) {} const Expression& left() const { return *left_; } std::span items() const { return items_; } @@ -368,8 +367,8 @@ class SLANG_EXPORT TaggedUnionExpression : public Expression { TaggedUnionExpression(const Type& type, const Symbol& member, const Expression* valueExpr, SourceRange sourceRange) : - Expression(ExpressionKind::TaggedUnion, type, sourceRange), - member(member), valueExpr(valueExpr) {} + Expression(ExpressionKind::TaggedUnion, type, sourceRange), member(member), + valueExpr(valueExpr) {} ConstantValue evalImpl(EvalContext& context) const; diff --git a/include/slang/ast/expressions/OperatorExpressions.h b/include/slang/ast/expressions/OperatorExpressions.h index 04b469d1c..3502314c7 100644 --- a/include/slang/ast/expressions/OperatorExpressions.h +++ b/include/slang/ast/expressions/OperatorExpressions.h @@ -22,8 +22,7 @@ class SLANG_EXPORT UnaryExpression : public Expression { UnaryExpression(UnaryOperator op, const Type& type, Expression& operand, SourceRange sourceRange) : - Expression(ExpressionKind::UnaryOp, type, sourceRange), - op(op), operand_(&operand) {} + Expression(ExpressionKind::UnaryOp, type, sourceRange), op(op), operand_(&operand) {} const Expression& operand() const { return *operand_; } Expression& operand() { return *operand_; } @@ -61,8 +60,8 @@ class SLANG_EXPORT BinaryExpression : public Expression { BinaryExpression(BinaryOperator op, const Type& type, Expression& left, Expression& right, SourceRange sourceRange) : - Expression(ExpressionKind::BinaryOp, type, sourceRange), - op(op), left_(&left), right_(&right) {} + Expression(ExpressionKind::BinaryOp, type, sourceRange), op(op), left_(&left), + right_(&right) {} const Expression& left() const { return *left_; } Expression& left() { return *left_; } @@ -109,8 +108,8 @@ class SLANG_EXPORT ConditionalExpression : public Expression { ConditionalExpression(const Type& type, std::span conditions, Expression& left, Expression& right, SourceRange sourceRange, bool isConst, bool isTrue) : - Expression(ExpressionKind::ConditionalOp, type, sourceRange), - conditions(conditions), left_(&left), right_(&right), isConst(isConst), isTrue(isTrue) {} + Expression(ExpressionKind::ConditionalOp, type, sourceRange), conditions(conditions), + left_(&left), right_(&right), isConst(isConst), isTrue(isTrue) {} const Expression& left() const { return *left_; } // NOLINT Expression& left() { return *left_; } @@ -160,8 +159,8 @@ class SLANG_EXPORT InsideExpression : public Expression { public: InsideExpression(const Type& type, const Expression& left, std::span rangeList, SourceRange sourceRange) : - Expression(ExpressionKind::Inside, type, sourceRange), - left_(&left), rangeList_(rangeList) {} + Expression(ExpressionKind::Inside, type, sourceRange), left_(&left), rangeList_(rangeList) { + } const Expression& left() const { return *left_; } @@ -194,8 +193,7 @@ class SLANG_EXPORT ConcatenationExpression : public Expression { public: ConcatenationExpression(const Type& type, std::span operands, SourceRange sourceRange) : - Expression(ExpressionKind::Concatenation, type, sourceRange), - operands_(operands) {} + Expression(ExpressionKind::Concatenation, type, sourceRange), operands_(operands) {} std::span operands() const { return operands_; } @@ -229,8 +227,8 @@ class SLANG_EXPORT ReplicationExpression : public Expression { public: ReplicationExpression(const Type& type, const Expression& count, Expression& concat, SourceRange sourceRange) : - Expression(ExpressionKind::Replication, type, sourceRange), - count_(&count), concat_(&concat) {} + Expression(ExpressionKind::Replication, type, sourceRange), count_(&count), + concat_(&concat) {} const Expression& count() const { return *count_; } @@ -270,8 +268,8 @@ class SLANG_EXPORT StreamingConcatenationExpression : public Expression { StreamingConcatenationExpression(const Type& type, uint64_t sliceSize, uint64_t bitstreamWidth, std::span streams, SourceRange sourceRange) : - Expression(ExpressionKind::Streaming, type, sourceRange), - streams_(streams), sliceSize(sliceSize), bitstreamWidth(bitstreamWidth) {} + Expression(ExpressionKind::Streaming, type, sourceRange), streams_(streams), + sliceSize(sliceSize), bitstreamWidth(bitstreamWidth) {} bool isFixedSize() const; uint64_t getBitstreamWidth() const { return bitstreamWidth; } @@ -314,8 +312,7 @@ class SLANG_EXPORT OpenRangeExpression : public Expression { public: OpenRangeExpression(const Type& type, Expression& left, Expression& right, SourceRange sourceRange) : - Expression(ExpressionKind::OpenRange, type, sourceRange), - left_(&left), right_(&right) {} + Expression(ExpressionKind::OpenRange, type, sourceRange), left_(&left), right_(&right) {} const Expression& left() const { return *left_; } Expression& left() { return *left_; } diff --git a/include/slang/ast/expressions/SelectExpressions.h b/include/slang/ast/expressions/SelectExpressions.h index 9cb02f6e6..5dca14978 100644 --- a/include/slang/ast/expressions/SelectExpressions.h +++ b/include/slang/ast/expressions/SelectExpressions.h @@ -17,8 +17,8 @@ class SLANG_EXPORT ElementSelectExpression : public Expression { public: ElementSelectExpression(const Type& type, Expression& value, const Expression& selector, SourceRange sourceRange) : - Expression(ExpressionKind::ElementSelect, type, sourceRange), - value_(&value), selector_(&selector) {} + Expression(ExpressionKind::ElementSelect, type, sourceRange), value_(&value), + selector_(&selector) {} const Expression& value() const { return *value_; } Expression& value() { return *value_; } @@ -68,8 +68,8 @@ class SLANG_EXPORT RangeSelectExpression : public Expression { RangeSelectExpression(RangeSelectionKind selectionKind, const Type& type, Expression& value, const Expression& left, const Expression& right, SourceRange sourceRange) : - Expression(ExpressionKind::RangeSelect, type, sourceRange), - value_(&value), left_(&left), right_(&right), selectionKind(selectionKind) {} + Expression(ExpressionKind::RangeSelect, type, sourceRange), value_(&value), left_(&left), + right_(&right), selectionKind(selectionKind) {} const Expression& value() const { return *value_; } Expression& value() { return *value_; } @@ -125,8 +125,8 @@ class SLANG_EXPORT MemberAccessExpression : public Expression { MemberAccessExpression(const Type& type, Expression& value, const Symbol& member, SourceRange sourceRange) : - Expression(ExpressionKind::MemberAccess, type, sourceRange), - member(member), value_(&value) {} + Expression(ExpressionKind::MemberAccess, type, sourceRange), member(member), + value_(&value) {} const Expression& value() const { return *value_; } Expression& value() { return *value_; } diff --git a/include/slang/ast/symbols/BlockSymbols.h b/include/slang/ast/symbols/BlockSymbols.h index 97905223e..ef08076ec 100644 --- a/include/slang/ast/symbols/BlockSymbols.h +++ b/include/slang/ast/symbols/BlockSymbols.h @@ -22,8 +22,8 @@ class SLANG_EXPORT StatementBlockSymbol : public Symbol, public Scope { StatementBlockSymbol(Compilation& compilation, std::string_view name, SourceLocation loc, StatementBlockKind blockKind, VariableLifetime defaultLifetime) : - Symbol(SymbolKind::StatementBlock, name, loc), - Scope(compilation, this), blockKind(blockKind), defaultLifetime(defaultLifetime) {} + Symbol(SymbolKind::StatementBlock, name, loc), Scope(compilation, this), + blockKind(blockKind), defaultLifetime(defaultLifetime) {} void setTemporaryParent(const Scope& scope, SymbolIndex index) { setParent(scope, index); } const Statement& getStatement(const ASTContext& context, @@ -112,9 +112,8 @@ class SLANG_EXPORT GenerateBlockSymbol : public Symbol, public Scope { GenerateBlockSymbol(Compilation& compilation, std::string_view name, SourceLocation loc, uint32_t constructIndex, bool isUninstantiated) : - Symbol(SymbolKind::GenerateBlock, name, loc), - Scope(compilation, this), constructIndex(constructIndex), - isUninstantiated(isUninstantiated) {} + Symbol(SymbolKind::GenerateBlock, name, loc), Scope(compilation, this), + constructIndex(constructIndex), isUninstantiated(isUninstantiated) {} std::string getExternalName() const; @@ -144,8 +143,8 @@ class SLANG_EXPORT GenerateBlockArraySymbol : public Symbol, public Scope { GenerateBlockArraySymbol(Compilation& compilation, std::string_view name, SourceLocation loc, uint32_t constructIndex) : - Symbol(SymbolKind::GenerateBlockArray, name, loc), - Scope(compilation, this), constructIndex(constructIndex) {} + Symbol(SymbolKind::GenerateBlockArray, name, loc), Scope(compilation, this), + constructIndex(constructIndex) {} std::string getExternalName() const; diff --git a/include/slang/ast/symbols/ClassSymbols.h b/include/slang/ast/symbols/ClassSymbols.h index efb8cf6fc..569aa77ed 100644 --- a/include/slang/ast/symbols/ClassSymbols.h +++ b/include/slang/ast/symbols/ClassSymbols.h @@ -161,8 +161,7 @@ class SLANG_EXPORT GenericClassDefSymbol : public Symbol { Symbol(SymbolKind::GenericClassDef, name, loc) {} GenericClassDefSymbol(std::string_view name, SourceLocation loc, function_ref specializeFunc) : - Symbol(SymbolKind::GenericClassDef, name, loc), - specializeFunc{specializeFunc} {} + Symbol(SymbolKind::GenericClassDef, name, loc), specializeFunc{specializeFunc} {} /// Gets the default specialization for the class, or nullptr if the generic /// class has no default specialization (because some parameters are not defaulted). diff --git a/include/slang/ast/symbols/CoverSymbols.h b/include/slang/ast/symbols/CoverSymbols.h index 61f43387e..0b3d0ef78 100644 --- a/include/slang/ast/symbols/CoverSymbols.h +++ b/include/slang/ast/symbols/CoverSymbols.h @@ -409,8 +409,8 @@ class SLANG_EXPORT BinSelectWithFilterExpr : public BinsSelectExpr { BinSelectWithFilterExpr(const BinsSelectExpr& expr, const Expression& filter, const Expression* matchesExpr) : - BinsSelectExpr(BinsSelectExprKind::WithFilter), - expr(expr), filter(filter), matchesExpr(matchesExpr) {} + BinsSelectExpr(BinsSelectExprKind::WithFilter), expr(expr), filter(filter), + matchesExpr(matchesExpr) {} static BinsSelectExpr& fromSyntax(const syntax::BinSelectWithFilterExprSyntax& syntax, const ASTContext& context); diff --git a/include/slang/ast/symbols/InstanceSymbols.h b/include/slang/ast/symbols/InstanceSymbols.h index 6f1e01e3b..dac3492b5 100644 --- a/include/slang/ast/symbols/InstanceSymbols.h +++ b/include/slang/ast/symbols/InstanceSymbols.h @@ -197,8 +197,8 @@ class SLANG_EXPORT InstanceArraySymbol : public Symbol, public Scope { InstanceArraySymbol(Compilation& compilation, std::string_view name, SourceLocation loc, std::span elements, ConstantRange range) : - Symbol(SymbolKind::InstanceArray, name, loc), - Scope(compilation, this), elements(elements), range(range) {} + Symbol(SymbolKind::InstanceArray, name, loc), Scope(compilation, this), elements(elements), + range(range) {} /// If this array is part of a multidimensional array, walk upward to find /// the root array's name. Otherwise returns the name of this symbol itself. @@ -225,8 +225,8 @@ class SLANG_EXPORT UninstantiatedDefSymbol : public Symbol { UninstantiatedDefSymbol(std::string_view name, SourceLocation loc, std::string_view definitionName, std::span params) : - Symbol(SymbolKind::UninstantiatedDef, name, loc), - definitionName(definitionName), paramExpressions(params) {} + Symbol(SymbolKind::UninstantiatedDef, name, loc), definitionName(definitionName), + paramExpressions(params) {} /// Gets the self-determined expressions that are assigned to the ports /// in the instantiation. These aren't necessarily correctly typed @@ -282,8 +282,8 @@ class SLANG_EXPORT PrimitiveInstanceSymbol : public InstanceSymbolBase { PrimitiveInstanceSymbol(std::string_view name, SourceLocation loc, const PrimitiveSymbol& primitiveType) : - InstanceSymbolBase(SymbolKind::PrimitiveInstance, name, loc), - primitiveType(primitiveType) {} + InstanceSymbolBase(SymbolKind::PrimitiveInstance, name, loc), primitiveType(primitiveType) { + } std::span getPortConnections() const; const TimingControl* getDelay() const; @@ -329,8 +329,8 @@ class SLANG_EXPORT CheckerInstanceSymbol : public InstanceSymbolBase { Connection(const CheckerInstanceBodySymbol& parent, const Symbol& formal, const syntax::ExpressionSyntax* outputInitialSyntax, std::span attributes) : - parent(parent), - formal(formal), attributes(attributes), outputInitialSyntax(outputInitialSyntax) {} + parent(parent), formal(formal), attributes(attributes), + outputInitialSyntax(outputInitialSyntax) {} const Expression* getOutputInitialExpr() const; diff --git a/include/slang/ast/symbols/MemberSymbols.h b/include/slang/ast/symbols/MemberSymbols.h index 486e5f274..e53df3ab9 100644 --- a/include/slang/ast/symbols/MemberSymbols.h +++ b/include/slang/ast/symbols/MemberSymbols.h @@ -62,8 +62,8 @@ class SLANG_EXPORT ExplicitImportSymbol : public Symbol { ExplicitImportSymbol(std::string_view packageName, std::string_view importName, SourceLocation location) : - Symbol(SymbolKind::ExplicitImport, importName, location), - packageName(packageName), importName(importName) {} + Symbol(SymbolKind::ExplicitImport, importName, location), packageName(packageName), + importName(importName) {} const PackageSymbol* package() const; const Symbol* importedSymbol() const; @@ -276,8 +276,8 @@ class SLANG_EXPORT PrimitiveSymbol : public Symbol, public Scope { PrimitiveSymbol(Compilation& compilation, std::string_view name, SourceLocation loc, PrimitiveKind primitiveKind) : - Symbol(SymbolKind::Primitive, name, loc), - Scope(compilation, this), primitiveKind(primitiveKind) {} + Symbol(SymbolKind::Primitive, name, loc), Scope(compilation, this), + primitiveKind(primitiveKind) {} static PrimitiveSymbol& fromSyntax(const Scope& scope, const syntax::UdpDeclarationSyntax& syntax); @@ -498,8 +498,7 @@ class SLANG_EXPORT RandSeqProductionSymbol : public Symbol, public Scope { CaseProd(const Expression& expr, std::span items, std::optional defaultItem) : - ProdBase(ProdKind::Case), - expr(&expr), items(items), defaultItem(defaultItem) {} + ProdBase(ProdKind::Case), expr(&expr), items(items), defaultItem(defaultItem) {} static bool isKind(ProdKind kind) { return kind == ProdKind::Case; } }; @@ -515,9 +514,8 @@ class SLANG_EXPORT RandSeqProductionSymbol : public Symbol, public Scope { Rule(const StatementBlockSymbol& ruleBlock, std::span prods, const Expression* weightExpr, const Expression* randJoinExpr, std::optional codeBlock, bool isRandJoin) : - ruleBlock(&ruleBlock), - prods(prods), weightExpr(weightExpr), randJoinExpr(randJoinExpr), codeBlock(codeBlock), - isRandJoin(isRandJoin) {} + ruleBlock(&ruleBlock), prods(prods), weightExpr(weightExpr), randJoinExpr(randJoinExpr), + codeBlock(codeBlock), isRandJoin(isRandJoin) {} }; DeclaredType declaredReturnType; diff --git a/include/slang/ast/symbols/SpecifySymbols.h b/include/slang/ast/symbols/SpecifySymbols.h index 667528fe8..85a0ac33a 100644 --- a/include/slang/ast/symbols/SpecifySymbols.h +++ b/include/slang/ast/symbols/SpecifySymbols.h @@ -172,8 +172,7 @@ class SLANG_EXPORT SystemTimingCheckSymbol : public Symbol { Arg(const Expression& expr) : expr(&expr) {} Arg(const Expression& expr, const Expression* condition, EdgeKind edge, std::span edgeDescriptors) : - expr(&expr), - condition(condition), edge(edge), edgeDescriptors(edgeDescriptors) {} + expr(&expr), condition(condition), edge(edge), edgeDescriptors(edgeDescriptors) {} }; SystemTimingCheckKind timingCheckKind; diff --git a/include/slang/ast/symbols/SubroutineSymbols.h b/include/slang/ast/symbols/SubroutineSymbols.h index d78db35f6..918e2f357 100644 --- a/include/slang/ast/symbols/SubroutineSymbols.h +++ b/include/slang/ast/symbols/SubroutineSymbols.h @@ -86,8 +86,8 @@ class SLANG_EXPORT SubroutineSymbol : public Symbol, public Scope { SubroutineSymbol(Compilation& compilation, std::string_view name, SourceLocation loc, VariableLifetime defaultLifetime, SubroutineKind subroutineKind) : - Symbol(SymbolKind::Subroutine, name, loc), - Scope(compilation, this), declaredReturnType(*this), defaultLifetime(defaultLifetime), + Symbol(SymbolKind::Subroutine, name, loc), Scope(compilation, this), + declaredReturnType(*this), defaultLifetime(defaultLifetime), subroutineKind(subroutineKind) {} ArgList getArguments() const { diff --git a/include/slang/ast/symbols/ValueSymbol.h b/include/slang/ast/symbols/ValueSymbol.h index 4694c33c4..ac3c66df5 100644 --- a/include/slang/ast/symbols/ValueSymbol.h +++ b/include/slang/ast/symbols/ValueSymbol.h @@ -121,8 +121,8 @@ class SLANG_EXPORT ValueDriver { /// Constructs a new ValueDriver instance. ValueDriver(DriverKind kind, const Expression& longestStaticPrefix, const Symbol& containingSymbol, bitmask flags) : - prefixExpression(&longestStaticPrefix), - containingSymbol(&containingSymbol), flags(flags), kind(kind) {} + prefixExpression(&longestStaticPrefix), containingSymbol(&containingSymbol), flags(flags), + kind(kind) {} /// Indicates whether the driver is for an input port. bool isInputPort() const { return flags.has(AssignFlags::InputPort); } diff --git a/include/slang/ast/symbols/VariableSymbols.h b/include/slang/ast/symbols/VariableSymbols.h index 209ac7d24..1919981df 100644 --- a/include/slang/ast/symbols/VariableSymbols.h +++ b/include/slang/ast/symbols/VariableSymbols.h @@ -218,8 +218,7 @@ class SLANG_EXPORT TempVarSymbol : public VariableSymbol { protected: TempVarSymbol(SymbolKind childKind, std::string_view name, SourceLocation loc, - VariableLifetime lifetime) : - VariableSymbol(childKind, name, loc, lifetime) {} + VariableLifetime lifetime) : VariableSymbol(childKind, name, loc, lifetime) {} }; /// Represents an iterator variable created for array manipulation methods. diff --git a/include/slang/ast/types/AllTypes.h b/include/slang/ast/types/AllTypes.h index 3391ba629..f1b112da0 100644 --- a/include/slang/ast/types/AllTypes.h +++ b/include/slang/ast/types/AllTypes.h @@ -417,8 +417,8 @@ class SLANG_EXPORT VirtualInterfaceType : public Type { VirtualInterfaceType(const InstanceSymbol& iface, const ModportSymbol* modport, bool isRealIface, SourceLocation loc) : - Type(SymbolKind::VirtualInterfaceType, "", loc), - iface(iface), modport(modport), isRealIface(isRealIface) {} + Type(SymbolKind::VirtualInterfaceType, "", loc), iface(iface), modport(modport), + isRealIface(isRealIface) {} ConstantValue getDefaultValueImpl() const; @@ -438,8 +438,7 @@ class SLANG_EXPORT ForwardingTypedefSymbol : public Symbol { ForwardingTypedefSymbol(std::string_view name, SourceLocation loc, ForwardTypeRestriction typeRestriction) : - Symbol(SymbolKind::ForwardingTypedef, name, loc), - typeRestriction(typeRestriction) {} + Symbol(SymbolKind::ForwardingTypedef, name, loc), typeRestriction(typeRestriction) {} static ForwardingTypedefSymbol& fromSyntax( const Scope& scope, const syntax::ForwardTypedefDeclarationSyntax& syntax); diff --git a/include/slang/driver/SourceLoader.h b/include/slang/driver/SourceLoader.h index 01f3dfb7c..da822df8f 100644 --- a/include/slang/driver/SourceLoader.h +++ b/include/slang/driver/SourceLoader.h @@ -186,8 +186,8 @@ class SLANG_EXPORT SourceLoader { FileEntry(std::filesystem::path&& path, bool isLibraryFile, const SourceLibrary* library, const UnitEntry* unit, GlobRank libraryRank) : - path(std::move(path)), - library(library), unit(unit), libraryRank(libraryRank), isLibraryFile(isLibraryFile) {} + path(std::move(path)), library(library), unit(unit), libraryRank(libraryRank), + isLibraryFile(isLibraryFile) {} }; // The result of a loadAndParse call. diff --git a/include/slang/parsing/Preprocessor.h b/include/slang/parsing/Preprocessor.h index 0cd4308cb..d60c8d376 100644 --- a/include/slang/parsing/Preprocessor.h +++ b/include/slang/parsing/Preprocessor.h @@ -265,8 +265,8 @@ class SLANG_EXPORT Preprocessor { public: MacroExpansion(SourceManager& sourceManager, BumpAllocator& alloc, SmallVectorBase& dest, Token usageSite, bool isTopLevel) : - sourceManager(sourceManager), - alloc(alloc), dest(dest), usageSite(usageSite), isTopLevel(isTopLevel) {} + sourceManager(sourceManager), alloc(alloc), dest(dest), usageSite(usageSite), + isTopLevel(isTopLevel) {} SourceRange getRange() const; diff --git a/include/slang/text/SourceManager.h b/include/slang/text/SourceManager.h index 9f182130a..ef1c80b5b 100644 --- a/include/slang/text/SourceManager.h +++ b/include/slang/text/SourceManager.h @@ -189,8 +189,7 @@ class SLANG_EXPORT SourceManager { DiagnosticDirectiveInfo(std::string_view name, size_t offset, DiagnosticSeverity severity) noexcept : - name(name), - offset(offset), severity(severity) {} + name(name), offset(offset), severity(severity) {} }; /// Visits each buffer that contains diagnostic directives and invokes the provided @@ -236,8 +235,8 @@ class SLANG_EXPORT SourceManager { FileData(const std::filesystem::path* directory, std::string name, SmallVector&& data, std::filesystem::path fullPath) : - name(std::move(name)), - mem(std::move(data)), directory(directory), fullPath(std::move(fullPath)) {} + name(std::move(name)), mem(std::move(data)), directory(directory), + fullPath(std::move(fullPath)) {} }; // Stores a pointer to file data along with information about where we included it. @@ -277,8 +276,7 @@ class SLANG_EXPORT SourceManager { ExpansionInfo(SourceLocation originalLoc, SourceRange expansionRange, std::string_view macroName) : - originalLoc(originalLoc), - expansionRange(expansionRange), macroName(macroName) {} + originalLoc(originalLoc), expansionRange(expansionRange), macroName(macroName) {} }; // This mutex protects pretty much everything in this class. diff --git a/include/slang/util/Iterator.h b/include/slang/util/Iterator.h index f01e97d7c..d59b52164 100644 --- a/include/slang/util/Iterator.h +++ b/include/slang/util/Iterator.h @@ -218,8 +218,9 @@ class iterator_facade { /// @brief Arrow operator /// @return Pointer or arrow proxy to the return value of /// Derived::dereference() const - constexpr decltype(auto) operator->() const noexcept( - (detail::has_nothrow_dereference&& noexcept(detail::arrow_helper(**this)))) { + constexpr decltype(auto) operator->() const + noexcept((detail::has_nothrow_dereference && + noexcept(detail::arrow_helper(**this)))) { if constexpr (detail::dereferences_lvalue) { return std::addressof(**this); } @@ -266,8 +267,8 @@ class iterator_facade { /// Derived::advance(1) template requires(detail::has_increment || detail::has_advance) - constexpr self_type operator++(int) noexcept( - std::is_nothrow_copy_constructible_v&& noexcept(++(*this))) { + constexpr self_type operator++(int) noexcept(std::is_nothrow_copy_constructible_v && + noexcept(++(*this))) { auto copy = self(); ++(*this); return copy; @@ -294,8 +295,8 @@ class iterator_facade { /// Derived::advance(-1) template requires(detail::has_decrement || detail::has_advance) - constexpr self_type operator--(int) noexcept( - std::is_nothrow_copy_constructible_v&& noexcept(--(*this))) { + constexpr self_type operator--(int) noexcept(std::is_nothrow_copy_constructible_v && + noexcept(--(*this))) { auto copy = self(); ++(*this); return copy; diff --git a/source/ast/Compilation.cpp b/source/ast/Compilation.cpp index 113cab355..540fa9994 100644 --- a/source/ast/Compilation.cpp +++ b/source/ast/Compilation.cpp @@ -2400,8 +2400,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/source/ast/Expression.cpp b/source/ast/Expression.cpp index f76148559..3d459b66f 100644 --- a/source/ast/Expression.cpp +++ b/source/ast/Expression.cpp @@ -135,8 +135,7 @@ struct Expression::PropagationVisitor { PropagationVisitor(const ASTContext& context, const Type& newType, const Expression* parentExpr, SourceLocation assignmentLoc) : - context(context), - newType(newType), parentExpr(parentExpr), assignmentLoc(assignmentLoc) {} + context(context), newType(newType), parentExpr(parentExpr), assignmentLoc(assignmentLoc) {} template Expression& visit(T& expr) { diff --git a/source/ast/builtins/CoverageFuncs.cpp b/source/ast/builtins/CoverageFuncs.cpp index 300bb782e..575100d55 100644 --- a/source/ast/builtins/CoverageFuncs.cpp +++ b/source/ast/builtins/CoverageFuncs.cpp @@ -22,9 +22,8 @@ class CoverageNameOrHierFunc : public SystemSubroutine { CoverageNameOrHierFunc(const std::string& name, const Type& returnType, unsigned int nameOrHierIndex, size_t requiredArgs = 0, const std::vector& argTypes = {}) : - SystemSubroutine(name, SubroutineKind::Function), - argTypes(argTypes), returnType(&returnType), nameOrHierIndex(nameOrHierIndex), - requiredArgs(requiredArgs) { + SystemSubroutine(name, SubroutineKind::Function), argTypes(argTypes), + returnType(&returnType), nameOrHierIndex(nameOrHierIndex), requiredArgs(requiredArgs) { SLANG_ASSERT(requiredArgs <= argTypes.size()); SLANG_ASSERT(nameOrHierIndex <= argTypes.size()); SLANG_ASSERT(requiredArgs > nameOrHierIndex); diff --git a/source/ast/builtins/SystemTasks.cpp b/source/ast/builtins/SystemTasks.cpp index e4b9d424c..168aeabf1 100644 --- a/source/ast/builtins/SystemTasks.cpp +++ b/source/ast/builtins/SystemTasks.cpp @@ -580,8 +580,7 @@ class StochasticTask : public SystemSubroutine { public: StochasticTask(const std::string& name, SubroutineKind subroutineKind, size_t inputArgs, size_t outputArgs) : - SystemSubroutine(name, subroutineKind), - inputArgs(inputArgs), outputArgs(outputArgs) { + SystemSubroutine(name, subroutineKind), inputArgs(inputArgs), outputArgs(outputArgs) { hasOutputArgs = outputArgs > 0; } diff --git a/source/ast/expressions/AssertionExpr.cpp b/source/ast/expressions/AssertionExpr.cpp index 1c57c29ad..46cf653c6 100644 --- a/source/ast/expressions/AssertionExpr.cpp +++ b/source/ast/expressions/AssertionExpr.cpp @@ -307,8 +307,8 @@ struct SampledValueExprVisitor { SampledValueExprVisitor(const ASTContext& context, bool isFutureGlobal, DiagCode localVarCode, DiagCode matchedCode) : - context(context), - isFutureGlobal(isFutureGlobal), localVarCode(localVarCode), matchedCode(matchedCode) {} + context(context), isFutureGlobal(isFutureGlobal), localVarCode(localVarCode), + matchedCode(matchedCode) {} template void visit(const T& expr) { diff --git a/source/ast/expressions/CallExpression.cpp b/source/ast/expressions/CallExpression.cpp index 4779e9001..9039da961 100644 --- a/source/ast/expressions/CallExpression.cpp +++ b/source/ast/expressions/CallExpression.cpp @@ -865,8 +865,7 @@ class DriverVisitor : public ASTVisitor { DriverVisitor(const Symbol& procedure, SmallSet& visitedSubs, const SubroutineSymbol& sub, const Expression& callExpr) : - procedure(procedure), - sub(sub), callExpr(callExpr), visitedSubs(visitedSubs) {} + procedure(procedure), sub(sub), callExpr(callExpr), visitedSubs(visitedSubs) {} void handle(const CallExpression& expr) { if (!expr.isSystemCall() && !expr.thisClass()) { diff --git a/source/ast/expressions/LiteralExpressions.cpp b/source/ast/expressions/LiteralExpressions.cpp index f7934ce69..7552b6a28 100644 --- a/source/ast/expressions/LiteralExpressions.cpp +++ b/source/ast/expressions/LiteralExpressions.cpp @@ -255,8 +255,8 @@ ConstantValue UnboundedLiteral::evalImpl(EvalContext& context) const { StringLiteral::StringLiteral(const Type& type, std::string_view value, std::string_view rawValue, ConstantValue& intVal, SourceRange sourceRange) : - Expression(ExpressionKind::StringLiteral, type, sourceRange), - value(value), rawValue(rawValue), intStorage(&intVal) { + Expression(ExpressionKind::StringLiteral, type, sourceRange), value(value), rawValue(rawValue), + intStorage(&intVal) { } Expression& StringLiteral::fromSyntax(const ASTContext& context, diff --git a/source/ast/symbols/AttributeSymbol.cpp b/source/ast/symbols/AttributeSymbol.cpp index 8a8e433aa..b5b357fd4 100644 --- a/source/ast/symbols/AttributeSymbol.cpp +++ b/source/ast/symbols/AttributeSymbol.cpp @@ -19,20 +19,18 @@ using namespace syntax; AttributeSymbol::AttributeSymbol(std::string_view name, SourceLocation loc, const Symbol& symbol, const ExpressionSyntax& expr) : - Symbol(SymbolKind::Attribute, name, loc), - symbol(&symbol), expr(&expr) { + Symbol(SymbolKind::Attribute, name, loc), symbol(&symbol), expr(&expr) { } AttributeSymbol::AttributeSymbol(std::string_view name, SourceLocation loc, const Scope& scope, LookupLocation lookupLocation, const ExpressionSyntax& expr) : - Symbol(SymbolKind::Attribute, name, loc), - scope(&scope), expr(&expr), lookupLocation(lookupLocation) { + Symbol(SymbolKind::Attribute, name, loc), scope(&scope), expr(&expr), + lookupLocation(lookupLocation) { } AttributeSymbol::AttributeSymbol(std::string_view name, SourceLocation loc, const ConstantValue& value) : - Symbol(SymbolKind::Attribute, name, loc), - value(&value) { + Symbol(SymbolKind::Attribute, name, loc), value(&value) { } const ConstantValue& AttributeSymbol::getValue() const { diff --git a/source/ast/symbols/BlockSymbols.cpp b/source/ast/symbols/BlockSymbols.cpp index b8df32047..2192f6c88 100644 --- a/source/ast/symbols/BlockSymbols.cpp +++ b/source/ast/symbols/BlockSymbols.cpp @@ -242,8 +242,8 @@ void StatementBlockSymbol::elaborateVariables(function_ref ProceduralBlockSymbol::ProceduralBlockSymbol(SourceLocation loc, ProceduralBlockKind procedureKind, bool isFromAssertion) : - Symbol(SymbolKind::ProceduralBlock, "", loc), - procedureKind(procedureKind), isFromAssertion(isFromAssertion) { + Symbol(SymbolKind::ProceduralBlock, "", loc), procedureKind(procedureKind), + isFromAssertion(isFromAssertion) { } const Statement& ProceduralBlockSymbol::getBody() const { diff --git a/source/ast/symbols/ClassSymbols.cpp b/source/ast/symbols/ClassSymbols.cpp index 27e2bff91..c5e36828f 100644 --- a/source/ast/symbols/ClassSymbols.cpp +++ b/source/ast/symbols/ClassSymbols.cpp @@ -31,8 +31,7 @@ using namespace syntax; ClassPropertySymbol::ClassPropertySymbol(std::string_view name, SourceLocation loc, VariableLifetime lifetime, Visibility visibility) : - VariableSymbol(SymbolKind::ClassProperty, name, loc, lifetime), - visibility(visibility) { + VariableSymbol(SymbolKind::ClassProperty, name, loc, lifetime), visibility(visibility) { } void ClassPropertySymbol::fromSyntax(const Scope& scope, @@ -928,8 +927,7 @@ void GenericClassDefSymbol::serializeTo(ASTSerializer& serializer) const { GenericClassDefSymbol::SpecializationKey::SpecializationKey( const GenericClassDefSymbol& def, std::span paramValues, std::span typeParams) : - definition(&def), - paramValues(paramValues), typeParams(typeParams) { + definition(&def), paramValues(paramValues), typeParams(typeParams) { // Precompute the hash. size_t h = 0; @@ -981,8 +979,7 @@ bool GenericClassDefSymbol::SpecializationKey::operator==(const SpecializationKe ConstraintBlockSymbol::ConstraintBlockSymbol(Compilation& c, std::string_view name, SourceLocation loc) : - Symbol(SymbolKind::ConstraintBlock, name, loc), - Scope(c, this) { + Symbol(SymbolKind::ConstraintBlock, name, loc), Scope(c, this) { } ConstraintBlockSymbol* ConstraintBlockSymbol::fromSyntax( diff --git a/source/ast/symbols/CompilationUnitSymbols.cpp b/source/ast/symbols/CompilationUnitSymbols.cpp index fca9059ed..10d758b2c 100644 --- a/source/ast/symbols/CompilationUnitSymbols.cpp +++ b/source/ast/symbols/CompilationUnitSymbols.cpp @@ -25,8 +25,8 @@ using namespace syntax; CompilationUnitSymbol::CompilationUnitSymbol(Compilation& compilation, const SourceLibrary& sourceLibrary) : - Symbol(SymbolKind::CompilationUnit, "", SourceLocation()), - Scope(compilation, this), sourceLibrary(sourceLibrary) { + Symbol(SymbolKind::CompilationUnit, "", SourceLocation()), Scope(compilation, this), + sourceLibrary(sourceLibrary) { // Default the time scale to the compilation default. If it turns out // this scope has a time unit declaration it will overwrite the member. @@ -64,8 +64,8 @@ void CompilationUnitSymbol::addMembers(const SyntaxNode& syntax) { PackageSymbol::PackageSymbol(Compilation& compilation, std::string_view name, SourceLocation loc, const NetType& defaultNetType, VariableLifetime defaultLifetime) : - Symbol(SymbolKind::Package, name, loc), - Scope(compilation, this), defaultNetType(defaultNetType), defaultLifetime(defaultLifetime) { + Symbol(SymbolKind::Package, name, loc), Scope(compilation, this), + defaultNetType(defaultNetType), defaultLifetime(defaultLifetime) { } PackageSymbol& PackageSymbol::fromSyntax(const Scope& scope, const ModuleDeclarationSyntax& syntax, @@ -170,9 +170,8 @@ void PackageSymbol::noteImport(const Symbol& symbol) const { DefinitionSymbol::ParameterDecl::ParameterDecl( const Scope& scope, const ParameterDeclarationSyntax& syntax, const DeclaratorSyntax& decl, bool isLocal, bool isPort, std::span attributes) : - valueSyntax(&syntax), - valueDecl(&decl), attributes(attributes), isTypeParam(false), isLocalParam(isLocal), - isPortParam(isPort), hasSyntax(true) { + valueSyntax(&syntax), valueDecl(&decl), attributes(attributes), isTypeParam(false), + isLocalParam(isLocal), isPortParam(isPort), hasSyntax(true) { name = decl.name.valueText(); location = decl.name.location(); @@ -189,9 +188,8 @@ DefinitionSymbol::ParameterDecl::ParameterDecl( const Scope& scope, const TypeParameterDeclarationSyntax& syntax, const TypeAssignmentSyntax& decl, bool isLocal, bool isPort, std::span attributes) : - typeSyntax(&syntax), - typeDecl(&decl), attributes(attributes), isTypeParam(true), isLocalParam(isLocal), - isPortParam(isPort), hasSyntax(true) { + typeSyntax(&syntax), typeDecl(&decl), attributes(attributes), isTypeParam(true), + isLocalParam(isLocal), isPortParam(isPort), hasSyntax(true) { name = decl.name.valueText(); location = decl.name.location(); @@ -207,17 +205,15 @@ DefinitionSymbol::ParameterDecl::ParameterDecl( DefinitionSymbol::ParameterDecl::ParameterDecl(std::string_view name, SourceLocation location, const Type& givenType, bool isLocal, bool isPort, const Expression* givenInitializer) : - givenType(&givenType), - givenInitializer(givenInitializer), name(name), location(location), isTypeParam(false), - isLocalParam(isLocal), isPortParam(isPort), hasSyntax(false) { + givenType(&givenType), givenInitializer(givenInitializer), name(name), location(location), + isTypeParam(false), isLocalParam(isLocal), isPortParam(isPort), hasSyntax(false) { SLANG_ASSERT(givenInitializer || (isPort && !isLocal)); } DefinitionSymbol::ParameterDecl::ParameterDecl(std::string_view name, SourceLocation location, bool isLocal, bool isPort, const Type* defaultType) : - givenType(defaultType), - name(name), location(location), isTypeParam(true), isLocalParam(isLocal), isPortParam(isPort), - hasSyntax(false) { + givenType(defaultType), name(name), location(location), isTypeParam(true), + isLocalParam(isLocal), isPortParam(isPort), hasSyntax(false) { SLANG_ASSERT(givenType || (isPort && !isLocal)); } @@ -356,8 +352,7 @@ void DefinitionSymbol::serializeTo(ASTSerializer& serializer) const { ResolvedConfig::ResolvedConfig(const ConfigBlockSymbol& useConfig, const InstanceSymbol& rootInstance) : - useConfig(useConfig), - rootInstance(rootInstance), liblist(useConfig.getDefaultLiblist()) { + useConfig(useConfig), rootInstance(rootInstance), liblist(useConfig.getDefaultLiblist()) { } ConfigBlockSymbol& ConfigBlockSymbol::fromSyntax(const Scope& scope, diff --git a/source/ast/symbols/CoverSymbols.cpp b/source/ast/symbols/CoverSymbols.cpp index f6c4344c2..62f01a59f 100644 --- a/source/ast/symbols/CoverSymbols.cpp +++ b/source/ast/symbols/CoverSymbols.cpp @@ -195,8 +195,7 @@ void CovergroupBodySymbol::serializeTo(ASTSerializer& serializer) const { CovergroupType::CovergroupType(Compilation& compilation, std::string_view name, SourceLocation loc, const CovergroupBodySymbol& body) : - Type(SymbolKind::CovergroupType, name, loc), - Scope(compilation, this), body(body) { + Type(SymbolKind::CovergroupType, name, loc), Scope(compilation, this), body(body) { } const CovergroupType& CovergroupType::fromSyntax(const Scope& scope, @@ -785,8 +784,7 @@ void CoverpointSymbol::serializeTo(ASTSerializer& serializer) const { CoverCrossSymbol::CoverCrossSymbol(Compilation& comp, std::string_view name, SourceLocation loc, std::span targets) : - Symbol(SymbolKind::CoverCross, name, loc), - Scope(comp, this), targets(targets) { + Symbol(SymbolKind::CoverCross, name, loc), Scope(comp, this), targets(targets) { auto& int_t = comp.getIntType(); auto& string_t = comp.getStringType(); diff --git a/source/ast/symbols/InstanceSymbols.cpp b/source/ast/symbols/InstanceSymbols.cpp index fccd00d72..e71ed54a4 100644 --- a/source/ast/symbols/InstanceSymbols.cpp +++ b/source/ast/symbols/InstanceSymbols.cpp @@ -92,9 +92,9 @@ class InstanceBuilder { InstanceBuilder(const ASTContext& context, SmallVectorBase& implicitNets, const HierarchyOverrideNode* parentOverrideNode, std::span attributes, bool isFromBind) : - netType(context.scope->getDefaultNetType()), - comp(context.getCompilation()), context(context), parentOverrideNode(parentOverrideNode), - implicitNets(implicitNets), attributes(attributes), isFromBind(isFromBind) {} + netType(context.scope->getDefaultNetType()), comp(context.getCompilation()), + context(context), parentOverrideNode(parentOverrideNode), implicitNets(implicitNets), + attributes(attributes), isFromBind(isFromBind) {} // Resets the builder to be ready to create more instances with different settings. // Must be called at least once prior to creating instances. @@ -405,8 +405,7 @@ void InstanceSymbolBase::getArrayDimensions(SmallVectorBase& dime InstanceSymbol::InstanceSymbol(std::string_view name, SourceLocation loc, InstanceBodySymbol& body) : - InstanceSymbolBase(SymbolKind::Instance, name, loc), - body(body) { + InstanceSymbolBase(SymbolKind::Instance, name, loc), body(body) { body.parentInstance = this; } @@ -1782,8 +1781,7 @@ void createCheckers(const CheckerSymbol& checker, const TSyntax& syntax, const A CheckerInstanceSymbol::CheckerInstanceSymbol(std::string_view name, SourceLocation loc, CheckerInstanceBodySymbol& body) : - InstanceSymbolBase(SymbolKind::CheckerInstance, name, loc), - body(body) { + InstanceSymbolBase(SymbolKind::CheckerInstance, name, loc), body(body) { body.parentInstance = this; } diff --git a/source/ast/symbols/MemberSymbols.cpp b/source/ast/symbols/MemberSymbols.cpp index 0ca23fdfc..692ef5520 100644 --- a/source/ast/symbols/MemberSymbols.cpp +++ b/source/ast/symbols/MemberSymbols.cpp @@ -152,8 +152,7 @@ void WildcardImportSymbol::serializeTo(ASTSerializer& serializer) const { ModportPortSymbol::ModportPortSymbol(std::string_view name, SourceLocation loc, ArgumentDirection direction) : - ValueSymbol(SymbolKind::ModportPort, name, loc), - direction(direction) { + ValueSymbol(SymbolKind::ModportPort, name, loc), direction(direction) { } ModportPortSymbol& ModportPortSymbol::fromSyntax(const ASTContext& context, @@ -741,8 +740,7 @@ void ElabSystemTaskSymbol::serializeTo(ASTSerializer& serializer) const { PrimitivePortSymbol::PrimitivePortSymbol(Compilation& compilation, std::string_view name, SourceLocation loc, PrimitivePortDirection direction) : - ValueSymbol(SymbolKind::PrimitivePort, name, loc), - direction(direction) { + ValueSymbol(SymbolKind::PrimitivePort, name, loc), direction(direction) { // All primitive ports are single bit logic types. setType(compilation.getLogicType()); } @@ -1336,8 +1334,7 @@ void AssertionPortSymbol::serializeTo(ASTSerializer& serializer) const { SequenceSymbol::SequenceSymbol(Compilation& compilation, std::string_view name, SourceLocation loc) : - Symbol(SymbolKind::Sequence, name, loc), - Scope(compilation, this) { + Symbol(SymbolKind::Sequence, name, loc), Scope(compilation, this) { } SequenceSymbol& SequenceSymbol::fromSyntax(const Scope& scope, @@ -1362,8 +1359,7 @@ void SequenceSymbol::makeDefaultInstance() const { PropertySymbol::PropertySymbol(Compilation& compilation, std::string_view name, SourceLocation loc) : - Symbol(SymbolKind::Property, name, loc), - Scope(compilation, this) { + Symbol(SymbolKind::Property, name, loc), Scope(compilation, this) { } PropertySymbol& PropertySymbol::fromSyntax(const Scope& scope, @@ -1388,8 +1384,7 @@ void PropertySymbol::makeDefaultInstance() const { LetDeclSymbol::LetDeclSymbol(Compilation& compilation, const ExpressionSyntax& exprSyntax, std::string_view name, SourceLocation loc) : - Symbol(SymbolKind::LetDecl, name, loc), - Scope(compilation, this), exprSyntax(&exprSyntax) { + Symbol(SymbolKind::LetDecl, name, loc), Scope(compilation, this), exprSyntax(&exprSyntax) { } LetDeclSymbol& LetDeclSymbol::fromSyntax(const Scope& scope, const LetDeclarationSyntax& syntax) { @@ -1495,8 +1490,7 @@ CheckerSymbol& CheckerSymbol::fromSyntax(const Scope& scope, ClockingBlockSymbol::ClockingBlockSymbol(Compilation& compilation, std::string_view name, SourceLocation loc) : - Symbol(SymbolKind::ClockingBlock, name, loc), - Scope(compilation, this) { + Symbol(SymbolKind::ClockingBlock, name, loc), Scope(compilation, this) { } ClockingBlockSymbol& ClockingBlockSymbol::fromSyntax(const Scope& scope, @@ -1621,8 +1615,8 @@ void ClockingBlockSymbol::serializeTo(ASTSerializer& serializer) const { RandSeqProductionSymbol::RandSeqProductionSymbol(Compilation& compilation, std::string_view name, SourceLocation loc) : - Symbol(SymbolKind::RandSeqProduction, name, loc), - Scope(compilation, this), declaredReturnType(*this) { + Symbol(SymbolKind::RandSeqProduction, name, loc), Scope(compilation, this), + declaredReturnType(*this) { } RandSeqProductionSymbol& RandSeqProductionSymbol::fromSyntax(Compilation& compilation, diff --git a/source/ast/symbols/ParameterBuilder.cpp b/source/ast/symbols/ParameterBuilder.cpp index 720e8511b..fce9198fc 100644 --- a/source/ast/symbols/ParameterBuilder.cpp +++ b/source/ast/symbols/ParameterBuilder.cpp @@ -20,8 +20,7 @@ using namespace syntax; ParameterBuilder::ParameterBuilder(const Scope& scope, std::string_view definitionName, std::span parameterDecls) : - scope(scope), - definitionName(definitionName), parameterDecls(parameterDecls) { + scope(scope), definitionName(definitionName), parameterDecls(parameterDecls) { } void ParameterBuilder::setAssignments(const ParameterValueAssignmentSyntax& syntax, diff --git a/source/ast/symbols/ParameterSymbols.cpp b/source/ast/symbols/ParameterSymbols.cpp index 152d30381..2ffaae88c 100644 --- a/source/ast/symbols/ParameterSymbols.cpp +++ b/source/ast/symbols/ParameterSymbols.cpp @@ -169,9 +169,8 @@ static DeclaredTypeFlags getTypeParamFlags(const Scope& scope) { TypeParameterSymbol::TypeParameterSymbol(const Scope& scope, std::string_view name, SourceLocation loc, bool isLocal, bool isPort, ForwardTypeRestriction typeRestriction) : - Symbol(SymbolKind::TypeParameter, name, loc), - ParameterSymbolBase(*this, isLocal, isPort), targetType(*this, getTypeParamFlags(scope)), - typeRestriction(typeRestriction) { + Symbol(SymbolKind::TypeParameter, name, loc), ParameterSymbolBase(*this, isLocal, isPort), + targetType(*this, getTypeParamFlags(scope)), typeRestriction(typeRestriction) { auto alias = scope.getCompilation().emplace(name, loc); alias->setParent(scope); diff --git a/source/ast/symbols/PortSymbols.cpp b/source/ast/symbols/PortSymbols.cpp index ed6ecd0a6..fab6575cc 100644 --- a/source/ast/symbols/PortSymbols.cpp +++ b/source/ast/symbols/PortSymbols.cpp @@ -85,8 +85,7 @@ class AnsiPortListBuilder { public: AnsiPortListBuilder(const Scope& scope, SmallVectorBase>& implicitMembers) : - comp(scope.getCompilation()), - scope(scope), implicitMembers(implicitMembers) {} + comp(scope.getCompilation()), scope(scope), implicitMembers(implicitMembers) {} Symbol* createPort(const ImplicitAnsiPortSyntax& syntax) { // Helper function to check if an implicit type syntax is totally empty. @@ -342,8 +341,7 @@ class NonAnsiPortListBuilder { const Scope& scope, std::span const> portDeclarations, SmallVectorBase>& implicitMembers) : - comp(scope.getCompilation()), - scope(scope), implicitMembers(implicitMembers) { + comp(scope.getCompilation()), scope(scope), implicitMembers(implicitMembers) { // All port declarations in the scope have been collected; index them for easy lookup. for (auto [syntax, insertionPoint] : portDeclarations) { @@ -475,8 +473,7 @@ class NonAnsiPortListBuilder { PortInfo(const DeclaratorSyntax& syntax, std::span attrs) : - syntax(&syntax), - attrs(attrs) {} + syntax(&syntax), attrs(attrs) {} }; SmallMap portInfos; @@ -753,8 +750,7 @@ class PortConnectionBuilder { public: PortConnectionBuilder(const InstanceSymbol& instance, const SeparatedSyntaxList& portConnections) : - scope(*instance.getParentScope()), - instance(instance), comp(scope.getCompilation()), + scope(*instance.getParentScope()), instance(instance), comp(scope.getCompilation()), lookupLocation(LookupLocation::after(instance)), connMap(portConnections, scope, lookupLocation) { @@ -1495,8 +1491,7 @@ void PortSymbol::serializeTo(ASTSerializer& serializer) const { MultiPortSymbol::MultiPortSymbol(std::string_view name, SourceLocation loc, std::span ports, ArgumentDirection direction) : - Symbol(SymbolKind::MultiPort, name, loc), - ports(ports), direction(direction) { + Symbol(SymbolKind::MultiPort, name, loc), ports(ports), direction(direction) { } const Type& MultiPortSymbol::getType() const { @@ -1642,14 +1637,12 @@ PortConnection::PortConnection(const Symbol& port, bool useDefault) : PortConnection::PortConnection(const InterfacePortSymbol& port, const Symbol* connectedSymbol, const ModportSymbol* modport) : - port(port), - connectedSymbol(connectedSymbol), modport(modport) { + port(port), connectedSymbol(connectedSymbol), modport(modport) { } PortConnection::PortConnection(const Symbol& port, const Symbol* connectedSymbol, SourceRange implicitNameRange) : - port(port), - connectedSymbol(connectedSymbol), implicitNameRange(implicitNameRange) { + port(port), connectedSymbol(connectedSymbol), implicitNameRange(implicitNameRange) { } PortConnection::IfaceConn PortConnection::getIfaceConn() const { diff --git a/source/ast/symbols/SpecifySymbols.cpp b/source/ast/symbols/SpecifySymbols.cpp index 18039e983..6ecf06483 100644 --- a/source/ast/symbols/SpecifySymbols.cpp +++ b/source/ast/symbols/SpecifySymbols.cpp @@ -134,9 +134,8 @@ bool SpecifyBlockSymbol::checkPathTerminal(const ValueSymbol& terminal, const Ty TimingPathSymbol::TimingPathSymbol(SourceLocation loc, ConnectionKind connectionKind, Polarity polarity, Polarity edgePolarity, EdgeKind edgeIdentifier) : - Symbol(SymbolKind::TimingPath, ""sv, loc), - connectionKind(connectionKind), polarity(polarity), edgePolarity(edgePolarity), - edgeIdentifier(edgeIdentifier) { + Symbol(SymbolKind::TimingPath, ""sv, loc), connectionKind(connectionKind), polarity(polarity), + edgePolarity(edgePolarity), edgeIdentifier(edgeIdentifier) { } TimingPathSymbol& TimingPathSymbol::fromSyntax(const Scope& parent, @@ -808,8 +807,7 @@ static void createImplicitNets(const SystemTimingCheckSymbol& timingCheck, SystemTimingCheckSymbol::SystemTimingCheckSymbol(SourceLocation loc, const SystemTimingCheckDef* def) : - Symbol(SymbolKind::SystemTimingCheck, ""sv, loc), - def(def) { + Symbol(SymbolKind::SystemTimingCheck, ""sv, loc), def(def) { timingCheckKind = def ? def->kind : SystemTimingCheckKind::Unknown; } diff --git a/source/ast/symbols/SubroutineSymbols.cpp b/source/ast/symbols/SubroutineSymbols.cpp index 949503b1e..f01bdaaa3 100644 --- a/source/ast/symbols/SubroutineSymbols.cpp +++ b/source/ast/symbols/SubroutineSymbols.cpp @@ -762,9 +762,9 @@ void SubroutineSymbol::addThisVar(const Type& type) { MethodPrototypeSymbol::MethodPrototypeSymbol(Compilation& compilation, std::string_view name, SourceLocation loc, SubroutineKind subroutineKind, Visibility visibility, bitmask flags) : - Symbol(SymbolKind::MethodPrototype, name, loc), - Scope(compilation, this), declaredReturnType(*this), subroutineKind(subroutineKind), - visibility(visibility), flags(flags) { + Symbol(SymbolKind::MethodPrototype, name, loc), Scope(compilation, this), + declaredReturnType(*this), subroutineKind(subroutineKind), visibility(visibility), + flags(flags) { } MethodPrototypeSymbol& MethodPrototypeSymbol::fromSyntax(const Scope& scope, diff --git a/source/ast/symbols/ValueSymbol.cpp b/source/ast/symbols/ValueSymbol.cpp index f03a77e4f..7178c1bb5 100644 --- a/source/ast/symbols/ValueSymbol.cpp +++ b/source/ast/symbols/ValueSymbol.cpp @@ -27,8 +27,7 @@ using namespace syntax; ValueSymbol::ValueSymbol(SymbolKind kind, std::string_view name, SourceLocation location, bitmask flags) : - Symbol(kind, name, location), - declaredType(*this, flags) { + Symbol(kind, name, location), declaredType(*this, flags) { } void ValueSymbol::setFromDeclarator(const DeclaratorSyntax& decl) { diff --git a/source/ast/symbols/VariableSymbols.cpp b/source/ast/symbols/VariableSymbols.cpp index 291fb77a0..5ea671369 100644 --- a/source/ast/symbols/VariableSymbols.cpp +++ b/source/ast/symbols/VariableSymbols.cpp @@ -137,8 +137,7 @@ VariableSymbol::VariableSymbol(std::string_view name, SourceLocation loc, VariableSymbol::VariableSymbol(SymbolKind childKind, std::string_view name, SourceLocation loc, VariableLifetime lifetime) : - ValueSymbol(childKind, name, loc), - lifetime(lifetime) { + ValueSymbol(childKind, name, loc), lifetime(lifetime) { if (lifetime == VariableLifetime::Automatic) getDeclaredType()->addFlags(DeclaredTypeFlags::AutomaticInitializer); } @@ -167,8 +166,7 @@ void VariableSymbol::serializeTo(ASTSerializer& serializer) const { FormalArgumentSymbol::FormalArgumentSymbol(std::string_view name, SourceLocation loc, ArgumentDirection direction, VariableLifetime lifetime) : - VariableSymbol(SymbolKind::FormalArgument, name, loc, lifetime), - direction(direction) { + VariableSymbol(SymbolKind::FormalArgument, name, loc, lifetime), direction(direction) { } void FormalArgumentSymbol::fromSyntax(const Scope& scope, const PortDeclarationSyntax& syntax, @@ -464,8 +462,8 @@ PatternVarSymbol::PatternVarSymbol(std::string_view name, SourceLocation loc, co ClockVarSymbol::ClockVarSymbol(std::string_view name, SourceLocation loc, ArgumentDirection direction, ClockingSkew inputSkew, ClockingSkew outputSkew) : - VariableSymbol(SymbolKind::ClockVar, name, loc, VariableLifetime::Static), - direction(direction), inputSkew(inputSkew), outputSkew(outputSkew) { + VariableSymbol(SymbolKind::ClockVar, name, loc, VariableLifetime::Static), direction(direction), + inputSkew(inputSkew), outputSkew(outputSkew) { } void ClockVarSymbol::fromSyntax(const Scope& scope, const ClockingItemSyntax& syntax, diff --git a/source/ast/types/AllTypes.cpp b/source/ast/types/AllTypes.cpp index b98da4063..a8abaab05 100644 --- a/source/ast/types/AllTypes.cpp +++ b/source/ast/types/AllTypes.cpp @@ -119,8 +119,7 @@ const ErrorType ErrorType::Instance; IntegralType::IntegralType(SymbolKind kind, std::string_view name, SourceLocation loc, bitwidth_t bitWidth_, bool isSigned_, bool isFourState_) : - Type(kind, name, loc), - bitWidth(bitWidth_), isSigned(isSigned_), isFourState(isFourState_) { + Type(kind, name, loc), bitWidth(bitWidth_), isSigned(isSigned_), isFourState(isFourState_) { } bool IntegralType::isKind(SymbolKind kind) { @@ -669,9 +668,8 @@ const Type& PackedArrayType::fromDim(const Scope& scope, const Type& elementType FixedSizeUnpackedArrayType::FixedSizeUnpackedArrayType(const Type& elementType, ConstantRange range, uint64_t selectableWidth, uint64_t bitstreamWidth) : - Type(SymbolKind::FixedSizeUnpackedArrayType, "", SourceLocation()), - elementType(elementType), range(range), selectableWidth(selectableWidth), - bitstreamWidth(bitstreamWidth) { + Type(SymbolKind::FixedSizeUnpackedArrayType, "", SourceLocation()), elementType(elementType), + range(range), selectableWidth(selectableWidth), bitstreamWidth(bitstreamWidth) { } const Type& FixedSizeUnpackedArrayType::fromDims(const Scope& scope, const Type& elementType, @@ -837,8 +835,8 @@ const Type& PackedStructType::fromSyntax(Compilation& comp, const StructUnionTyp UnpackedStructType::UnpackedStructType(Compilation& compilation, SourceLocation loc, const ASTContext& context) : - Type(SymbolKind::UnpackedStructType, "", loc), - Scope(compilation, this), systemId(compilation.getNextStructSystemId()) { + Type(SymbolKind::UnpackedStructType, "", loc), Scope(compilation, this), + systemId(compilation.getNextStructSystemId()) { // Struct types don't live as members of the parent scope (they're "owned" by // the declaration containing them) but we hook up the parent pointer so that @@ -1007,8 +1005,8 @@ const Type& PackedUnionType::fromSyntax(Compilation& comp, const StructUnionType UnpackedUnionType::UnpackedUnionType(Compilation& compilation, bool isTagged, SourceLocation loc, const ASTContext& context) : - Type(SymbolKind::UnpackedUnionType, "", loc), - Scope(compilation, this), systemId(compilation.getNextUnionSystemId()), isTagged(isTagged) { + Type(SymbolKind::UnpackedUnionType, "", loc), Scope(compilation, this), + systemId(compilation.getNextUnionSystemId()), isTagged(isTagged) { // Union types don't live as members of the parent scope (they're "owned" by // the declaration containing them) but we hook up the parent pointer so that diff --git a/source/parsing/Lexer.cpp b/source/parsing/Lexer.cpp index 002940038..e81e95356 100644 --- a/source/parsing/Lexer.cpp +++ b/source/parsing/Lexer.cpp @@ -37,9 +37,9 @@ Lexer::Lexer(SourceBuffer buffer, BumpAllocator& alloc, Diagnostics& diagnostics Lexer::Lexer(BufferID bufferId, std::string_view source, const char* startPtr, BumpAllocator& alloc, Diagnostics& diagnostics, LexerOptions options) : - alloc(alloc), - diagnostics(diagnostics), options(options), bufferId(bufferId), originalBegin(source.data()), - sourceBuffer(startPtr), sourceEnd(source.data() + source.length()), marker(nullptr) { + alloc(alloc), diagnostics(diagnostics), options(options), bufferId(bufferId), + originalBegin(source.data()), sourceBuffer(startPtr), + sourceEnd(source.data() + source.length()), marker(nullptr) { ptrdiff_t count = sourceEnd - sourceBuffer; SLANG_ASSERT(count); SLANG_ASSERT(sourceEnd[-1] == '\0'); diff --git a/source/parsing/NumberParser.cpp b/source/parsing/NumberParser.cpp index b617d4885..5f46295ca 100644 --- a/source/parsing/NumberParser.cpp +++ b/source/parsing/NumberParser.cpp @@ -29,8 +29,7 @@ static logic_t getLogicCharValue(char c) { NumberParser::NumberParser(Diagnostics& diagnostics, BumpAllocator& alloc, LanguageVersion languageVersion) : - languageVersion(languageVersion), - diagnostics(diagnostics), alloc(alloc) { + languageVersion(languageVersion), diagnostics(diagnostics), alloc(alloc) { } void NumberParser::startVector(Token baseToken, Token sizeToken) { diff --git a/source/parsing/Parser_expressions.cpp b/source/parsing/Parser_expressions.cpp index 87ef1d796..8818d7cf7 100644 --- a/source/parsing/Parser_expressions.cpp +++ b/source/parsing/Parser_expressions.cpp @@ -651,8 +651,7 @@ NameSyntax& Parser::parseName(bitmask options) { usedDot = true; else if (usedDot && !reportedError) { reportedError = true; - addDiag(diag::InvalidAccessDotColon, separator.location()) << "::"sv - << "."sv; + addDiag(diag::InvalidAccessDotColon, separator.location()) << "::"sv << "."sv; } if (kind == TokenKind::DoubleColon && name->kind == SyntaxKind::IdentifierName) @@ -662,16 +661,14 @@ NameSyntax& Parser::parseName(bitmask options) { case SyntaxKind::UnitScope: case SyntaxKind::LocalScope: if (kind != TokenKind::DoubleColon) { - addDiag(diag::InvalidAccessDotColon, separator.location()) << "."sv - << "::"sv; + addDiag(diag::InvalidAccessDotColon, separator.location()) << "."sv << "::"sv; } break; case SyntaxKind::RootScope: case SyntaxKind::ThisHandle: case SyntaxKind::SuperHandle: if (kind != TokenKind::Dot) { - addDiag(diag::InvalidAccessDotColon, separator.location()) << "::"sv - << "."sv; + addDiag(diag::InvalidAccessDotColon, separator.location()) << "::"sv << "."sv; } break; case SyntaxKind::ConstructorName: diff --git a/source/parsing/Preprocessor.cpp b/source/parsing/Preprocessor.cpp index a3307cedb..540b3afda 100644 --- a/source/parsing/Preprocessor.cpp +++ b/source/parsing/Preprocessor.cpp @@ -25,8 +25,8 @@ using LF = LexerFacts; Preprocessor::Preprocessor(SourceManager& sourceManager, BumpAllocator& alloc, Diagnostics& diagnostics, const Bag& options_, std::span inheritedMacros) : - sourceManager(sourceManager), - alloc(alloc), diagnostics(diagnostics), options(options_.getOrDefault()), + sourceManager(sourceManager), alloc(alloc), diagnostics(diagnostics), + options(options_.getOrDefault()), lexerOptions(options_.getOrDefault()), numberParser(diagnostics, alloc, options.languageVersion) { diff --git a/source/syntax/SyntaxTree.cpp b/source/syntax/SyntaxTree.cpp index 5c856d9c0..d2b8e6fa5 100644 --- a/source/syntax/SyntaxTree.cpp +++ b/source/syntax/SyntaxTree.cpp @@ -19,8 +19,7 @@ using namespace parsing; SyntaxTree::SyntaxTree(SyntaxNode* root, SourceManager& sourceManager, BumpAllocator&& alloc, const SourceLibrary* library, std::shared_ptr parent) : - rootNode(root), - library(library), sourceMan(sourceManager), alloc(std::move(alloc)), + rootNode(root), library(library), sourceMan(sourceManager), alloc(std::move(alloc)), parentTree(std::move(parent)) { metadata = std::make_unique(ParserMetadata::fromSyntax(*root)); if (!metadata->eofToken && parentTree) @@ -118,8 +117,7 @@ SourceManager& SyntaxTree::getDefaultSourceManager() { SyntaxTree::SyntaxTree(SyntaxNode* root, const SourceLibrary* library, SourceManager& sourceManager, BumpAllocator&& alloc, Diagnostics&& diagnostics, ParserMetadata&& metadata, std::vector&& macros, Bag options) : - rootNode(root), - library(library), sourceMan(sourceManager), alloc(std::move(alloc)), + rootNode(root), library(library), sourceMan(sourceManager), alloc(std::move(alloc)), diagnosticsBuffer(std::move(diagnostics)), options_(std::move(options)), metadata(std::make_unique(std::move(metadata))), macros(std::move(macros)) { } diff --git a/tests/unittests/ast/PortTests.cpp b/tests/unittests/ast/PortTests.cpp index 0f81a507a..dd5dd554a 100644 --- a/tests/unittests/ast/PortTests.cpp +++ b/tests/unittests/ast/PortTests.cpp @@ -46,7 +46,7 @@ module mh22(ref wire x); endmodule auto def = compilation.getRoot().find(moduleName); \ REQUIRE(def); \ auto& body = def->as().body; \ - auto& port = body.findPort(name) -> as(); \ + auto& port = body.findPort(name)->as(); \ CHECK(port.direction == ArgumentDirection::dir); \ CHECK(port.getType().toString() == (type)); \ if (nt) { \ @@ -126,28 +126,28 @@ module m6(I.bar bar); endmodule return inst.body.findPort(portName); }; -#define checkWirePort(moduleName, name, dir, nt, type) \ - { \ - auto& port = getPort(moduleName, name) -> as(); \ - CHECK(port.direction == ArgumentDirection::dir); \ - CHECK(port.getType().toString() == (type)); \ - if (nt) { \ - auto& net = port.internalSymbol->as(); \ - CHECK(&net.netType == (nt)); \ - } \ +#define checkWirePort(moduleName, name, dir, nt, type) \ + { \ + auto& port = getPort(moduleName, name)->as(); \ + CHECK(port.direction == ArgumentDirection::dir); \ + CHECK(port.getType().toString() == (type)); \ + if (nt) { \ + auto& net = port.internalSymbol->as(); \ + CHECK(&net.netType == (nt)); \ + } \ }; -#define checkIfacePort(moduleName, portName, ifaceName, modportName) \ - { \ - auto& port = getPort(moduleName, portName) -> as(); \ - REQUIRE(port.interfaceDef); \ - CHECK(port.interfaceDef->name == (ifaceName)); \ - if (*(modportName)) { \ - CHECK(port.modport == (modportName)); \ - } \ - else { \ - CHECK(port.modport.empty()); \ - } \ +#define checkIfacePort(moduleName, portName, ifaceName, modportName) \ + { \ + auto& port = getPort(moduleName, portName)->as(); \ + REQUIRE(port.interfaceDef); \ + CHECK(port.interfaceDef->name == (ifaceName)); \ + if (*(modportName)) { \ + CHECK(port.modport == (modportName)); \ + } \ + else { \ + CHECK(port.modport.empty()); \ + } \ }; auto wire = &compilation.getWireNetType(); diff --git a/tools/netlist/include/Netlist.h b/tools/netlist/include/Netlist.h index 7544641d4..983a247f9 100644 --- a/tools/netlist/include/Netlist.h +++ b/tools/netlist/include/Netlist.h @@ -109,8 +109,8 @@ struct VariableRangeSelect : public VariableSelectorBase { VariableRangeSelect(ast::RangeSelectExpression const& expr, ConstantValue leftIndex, ConstantValue rightIndex) : - VariableSelectorBase(VariableSelectorKind::RangeSelect), - expr(expr), leftIndex(std::move(leftIndex)), rightIndex(std::move(rightIndex)) {} + VariableSelectorBase(VariableSelectorKind::RangeSelect), expr(expr), + leftIndex(std::move(leftIndex)), rightIndex(std::move(rightIndex)) {} static bool isKind(VariableSelectorKind otherKind) { return otherKind == VariableSelectorKind::RangeSelect; @@ -271,8 +271,8 @@ class NetlistVariableReference : public NetlistNode { NetlistVariableReference(const ast::Symbol& symbol, const ast::Expression& expr, bool leftOperand) : - NetlistNode(NodeKind::VariableReference, symbol), - expression(expr), leftOperand(leftOperand) {} + NetlistNode(NodeKind::VariableReference, symbol), expression(expr), + leftOperand(leftOperand) {} void addElementSelect(ast::ElementSelectExpression const& expr, const ConstantValue& index) { selectors.emplace_back(std::make_unique(expr.selector(), index)); diff --git a/tools/netlist/include/NetlistVisitor.h b/tools/netlist/include/NetlistVisitor.h index 4c280e45d..6f5e1ccd5 100644 --- a/tools/netlist/include/NetlistVisitor.h +++ b/tools/netlist/include/NetlistVisitor.h @@ -66,8 +66,7 @@ class VariableReferenceVisitor : public ast::ASTVisitor public: explicit AssignmentVisitor(Netlist& netlist, ast::EvalContext& evalCtx, SmallVector& condVars) : - netlist(netlist), - evalCtx(evalCtx), condVars(condVars) {} + netlist(netlist), evalCtx(evalCtx), condVars(condVars) {} void handle(const ast::AssignmentExpression& expr) { // Collect variable references on the left-hand side of the assignment. diff --git a/tools/reflect/include/SvTypeReflector.h b/tools/reflect/include/SvTypeReflector.h index 876703e2e..81b3f65d0 100644 --- a/tools/reflect/include/SvTypeReflector.h +++ b/tools/reflect/include/SvTypeReflector.h @@ -16,8 +16,8 @@ class SvTypeReflector { public: explicit SvTypeReflector(std::unique_ptr compilation, bool verbose, bool noSystemC) : - compilation(std::move(compilation)), - verbose(verbose), noSystemC(noSystemC), cppEmitter(noSystemC) {} + compilation(std::move(compilation)), verbose(verbose), noSystemC(noSystemC), + cppEmitter(noSystemC) {} void reflect();