Skip to content

Commit

Permalink
Clean initial diagnostic reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
povik committed Nov 21, 2024
1 parent 1655102 commit b8ea856
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions src/slang_frontend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2390,15 +2390,9 @@ struct PopulateNetlist : public TimingPatternInterpretor, public ast::ASTVisitor
return;

auto result = body.visit(initial_eval);
if (result != ast::Statement::EvalResult::Success) {
for (auto& diag_ : initial_eval.context.getAllDiagnostics())
global_diagengine->issue(diag_);
global_diagengine->issue(slang::Diagnostic(diag::NoteIgnoreInitial,
slang::SourceLocation::NoLocation));
auto str = global_diagclient->getString();
log_error("Failed to execute initial block\n%s\n",
str.c_str());
}
if (result != ast::Statement::EvalResult::Success)
initial_eval.context.addDiag(diag::NoteIgnoreInitial,
slang::SourceLocation::NoLocation);
}

void handle(const ast::ProceduralBlockSymbol &symbol)
Expand Down Expand Up @@ -2892,14 +2886,7 @@ struct PopulateNetlist : public TimingPatternInterpretor, public ast::ASTVisitor
});
sym.visit(inittransfer);

for (auto& diag : initial_eval.context.getAllDiagnostics())
global_diagengine->issue(diag);
auto str = global_diagclient->getString();
if (global_diagengine->getNumErrors())
log_error("%s", str.c_str());
else
log("%s", str.c_str());
global_diagclient->clear();
initial_eval.context.reportAllDiags();
}

void handle(const ast::UninstantiatedDefSymbol &sym)
Expand Down

0 comments on commit b8ea856

Please sign in to comment.