// Temporary Fortran front end driver main program for development scaffolding.
-#ifdef LINK_WITH_FIR
-#include "../../lib/FIR/afforestation.h"
-#include "../../lib/FIR/graph-writer.h"
-#endif
#include "../../lib/common/default-kinds.h"
#include "../../lib/evaluate/expression.h"
#include "../../lib/parser/characters.h"
bool dumpUnparseWithSymbols{false};
bool dumpParseTree{false};
bool dumpSymbols{false};
- bool dumpGraph{false};
- bool debugLinearFIR{false};
bool debugResolveNames{false};
bool debugSemantics{false};
bool measureTree{false};
}
// TODO: Change this predicate to just "if (!driver.debugNoSemantics)"
if (driver.debugSemantics || driver.debugResolveNames || driver.dumpSymbols ||
- driver.dumpUnparseWithSymbols || driver.debugLinearFIR ||
- driver.dumpGraph) {
+ driver.dumpUnparseWithSymbols) {
Fortran::semantics::Semantics semantics{
semanticsContext, parseTree, parsing.cooked()};
semantics.Perform();
return {};
}
}
- if (driver.dumpGraph) {
-#ifdef LINK_WITH_FIR
- auto *fir{Fortran::FIR::CreateFortranIR(
- parseTree, semanticsContext, driver.debugLinearFIR)};
- Fortran::FIR::GraphWriter::print(*fir);
-#endif
- return {};
- }
if (driver.dumpParseTree) {
Fortran::parser::DumpTree(std::cout, parseTree);
}
driver.dumpUnparse = true;
} else if (arg == "-funparse-with-symbols") {
driver.dumpUnparseWithSymbols = true;
- } else if (arg == "-fdotty") {
- driver.dumpGraph = true;
- } else if (arg == "-fdebug-dump-linear-ir") {
- driver.debugLinearFIR = true;
} else if (arg == "-fparse-only") {
driver.parseOnly = true;
} else if (arg == "-c") {
<< " -fdebug-resolve-names\n"
<< " -fdebug-instrumented-parse\n"
<< " -fdebug-semantics perform semantic checks\n"
- << " -fdotty print FIR as a dotty graph\n"
- << " -fdebug-dump-linear-ir dump the flat linear FIR for debug\n"
<< " -v -c -o -I -D -U have their usual meanings\n"
<< " -help print this again\n"
<< "Other options are passed through to the compiler.\n";