Improve reusability of --dump-inputs output (#6812)

This commit is contained in:
Geza Lore
2025-12-16 11:08:19 +00:00
committed by GitHub
parent 25f72e4305
commit 47a4f7fb9b
31 changed files with 685 additions and 361 deletions
+8 -4
View File
@@ -528,7 +528,11 @@ void V3PreProcImp::comment(const string& text) {
//}
// else ignore the comment we don't recognize
} // else no assertions
} else if (vlcomment && !(v3Global.opt.publicOff() && VString::startsWith(cmd, "public"))) {
} else if (vlcomment
// Drop 'public' if disabled on the command line
&& !(v3Global.opt.publicOff() && VString::startsWith(cmd, "public"))
// Drop 'fargs', they are handled separately during option parsing
&& !VString::startsWith(cmd, "fargs")) {
if (VString::startsWith(cmd, "public_flat_rw")) {
// "/*verilator public_flat_rw @(foo) */" -> "/*verilator public_flat_rw*/ @(foo)"
string::size_type endOfCmd = std::strlen("public_flat_rw");
@@ -1062,12 +1066,12 @@ int V3PreProcImp::getStateToken() {
string rtn;
rtn.assign(yyourtext(), yyourleng());
comment(rtn);
// Need to ensure "foo/**/bar" becomes two tokens
insertUnreadback(" ");
// Need to ensure "foo/**/bar" becomes two tokens, not one 'foobar'
if (m_lineCmt.empty()) insertUnreadback(" ");
} else if (m_lexp->m_keepComments) {
return tok;
} else {
// Need to ensure "foo/**/bar" becomes two tokens
// Need to ensure "foo/**/bar" becomes two tokens, not one 'foobar'
insertUnreadback(" ");
}
}