99#include " ImportVerilogInternals.h"
1010#include " slang/ast/Compilation.h"
1111#include " slang/ast/SystemSubroutine.h"
12- #include " llvm/ADT/ScopeExit.h"
1312#include " slang/syntax/AllSyntax.h"
13+ #include " llvm/ADT/ScopeExit.h"
14+ #include < slang/ast/SFormat.h>
1415
1516using namespace mlir ;
1617using namespace circt ;
@@ -140,7 +141,8 @@ struct StmtVisitor {
140141 break ;
141142 }
142143 if (failed (context.convertStatement (*stmt))) {
143- context.dbgs (stmt->syntax ->sourceRange ().start ()) << " Failed to convert statement " << stmt->syntax ->toString ();
144+ context.dbgs (stmt->syntax ->sourceRange ().start ())
145+ << " Failed to convert statement " << stmt->syntax ->toString ();
144146 return failure ();
145147 }
146148 }
@@ -160,17 +162,25 @@ struct StmtVisitor {
160162 std::get_if<slang::ast::CallExpression::SystemCallInfo>(
161163 &call->subroutine )) {
162164 auto handled = visitSystemCall (stmt, *call, *info);
163- if (failed (handled))
165+ if (failed (handled)) {
166+ context.dbgs (stmt.sourceRange .start ())
167+ << " Failed to convert system call " << stmt.syntax ->toString ();
164168 return failure ();
169+ }
165170 if (handled == true )
166171 return success ();
167172 }
173+ context.dbgs (stmt.sourceRange .start ())
174+ << " Assuming statement "
175+ << stmt.syntax ->toString () << " is not a system task" ;
168176 }
169177
170178 auto value = context.convertRvalueExpression (stmt.expr );
171- if (!value)
179+ if (!value) {
180+ context.dbgs (stmt.sourceRange .start ())
181+ << " Failed to convert expression statement as RValue " << stmt.expr .syntax ->toString ();
172182 return failure ();
173-
183+ }
174184 // Expressions like calls to void functions return a dummy value that has no
175185 // uses. If the returned value is trivially dead, remove it.
176186 if (auto *defOp = value.getDefiningOp ())
0 commit comments