Add JSON AST dumps (#5020)

This commit is contained in:
Szymon Gizler
2024-03-28 07:32:18 -04:00
committed by GitHub
parent f645382f11
commit 8301fdc6d3
17 changed files with 828 additions and 26 deletions
+5 -1
View File
@@ -221,12 +221,16 @@ void V3ErrorGuarded::v3errorEnd(std::ostringstream& sstr, const string& extra)
tellManual(2);
}
#ifndef V3ERROR_NO_GLOBAL_
if (dumpTreeLevel() || debug()) {
if (dumpTreeLevel() || dumpTreeJsonLevel() || debug()) {
V3Broken::allowMidvisitorCheck(true);
const V3ThreadPool::ScopedExclusiveAccess exclusiveAccess;
if (dumpTreeLevel()) {
v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("final.tree", 990));
}
if (dumpTreeJsonLevel()) {
v3Global.rootp()->dumpTreeJsonFile(
v3Global.debugFilename("final.tree.json", 990));
}
if (debug()) {
execErrorExitCb();
V3Stats::statsFinalAll(v3Global.rootp());