Add suggestions on misspelled PLI functions.

This commit is contained in:
Wilson Snyder
2024-07-20 07:20:10 -04:00
parent b7345eb5d5
commit 981d3ce782
8 changed files with 36 additions and 1 deletions
+7 -1
View File
@@ -67,6 +67,7 @@
#include "V3Graph.h"
#include "V3MemberMap.h"
#include "V3Parse.h"
#include "V3String.h"
#include "V3SymTable.h"
@@ -3355,8 +3356,13 @@ class LinkDotResolveVisitor final : public VNVisitor {
VL_DO_DANGLING(nodep->deleteTree(), nodep);
return;
} else {
VSpellCheck speller;
V3Parse::candidatePli(&speller);
const string suggest = speller.bestCandidateMsg(nodep->prettyName());
nodep->v3error(
"Unsupported or unknown PLI call: " << nodep->prettyNameQ());
"Unsupported or unknown PLI call: "
<< nodep->prettyNameQ() << '\n'
<< (suggest.empty() ? "" : nodep->warnMore() + suggest));
}
} else {
const string suggest = m_statep->suggestSymFallback(