Skip to content

Commit

Permalink
Fix some clang-tidy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
MikePopoloski committed Apr 21, 2024
1 parent 9b8d7d6 commit cd3c516
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/slang/ast/ScriptSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class SLANG_EXPORT ScriptSession {
CompilationUnitSymbol& scope;

/// Constructs a new ScriptSession.
explicit ScriptSession(const Bag& options = {});
explicit ScriptSession(Bag options = {});

/// Tries to evaluate the given snippet of SystemVerilog code
/// and returns the result as a constant value.
Expand Down
4 changes: 2 additions & 2 deletions source/ast/ScriptSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ static Bag& createOptions(Bag& options) {
return options;
}

ScriptSession::ScriptSession(const Bag& options) :
options(options), compilation(createOptions(this->options)),
ScriptSession::ScriptSession(Bag options) :
options(std::move(options)), compilation(createOptions(this->options)),
scope(compilation.createScriptScope()), astCtx(scope, LookupLocation::max),
evalContext(astCtx, EvalFlags::IsScript) {
evalContext.pushEmptyFrame();
Expand Down
2 changes: 1 addition & 1 deletion source/ast/builtins/ArrayMethods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ class ArrayMapMethod : public SystemSubroutine {
if (!cv)
return nullptr;

results.emplace(std::move(key), std::move(cv));
results.emplace(key, std::move(cv));
}
return results;
}
Expand Down
4 changes: 3 additions & 1 deletion source/ast/symbols/ParameterSymbols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ const ConstantValue& ParameterSymbol::getValue(SourceRange referencingRange) con
}

bool ParameterSymbol::isImplicitString(SourceRange referencingRange) const {
if (!value)
if (!value) {
getValue(referencingRange);
SLANG_ASSERT(value);
}
return fromStringLit || value->bad();
}

Expand Down

0 comments on commit cd3c516

Please sign in to comment.