[flang] Add dump-symbols option to bbc

Restore the `--dump-symbols` option in the `bbc`
tool.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D129850
This commit is contained in:
Valentin Clement 2022-07-18 13:39:41 +02:00
parent 098488e09a
commit f372142740
No known key found for this signature in database
GPG Key ID: 086D54783C928776
2 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,4 @@
!RUN: bbc --dump-symbols %s | FileCheck %s
!RUN: %flang_fc1 -fdebug-dump-symbols %s | FileCheck %s
! Tests for derived type runtime descriptions

View File

@ -106,6 +106,10 @@ static llvm::cl::opt<bool> warnIsError("Werror",
llvm::cl::desc("warnings are errors"),
llvm::cl::init(false));
static llvm::cl::opt<bool> dumpSymbols("dump-symbols",
llvm::cl::desc("dump the symbol table"),
llvm::cl::init(false));
static llvm::cl::opt<bool> pftDumpTest(
"pft-test",
llvm::cl::desc("parse the input, create a PFT, dump it, and exit"),
@ -189,6 +193,11 @@ static mlir::LogicalResult convertFortranSourceToMLIR(
<< "could not find module file for __fortran_type_info\n";
}
if (dumpSymbols) {
semantics.DumpSymbols(llvm::outs());
return mlir::success();
}
if (pftDumpTest) {
if (auto ast = Fortran::lower::createPFT(parseTree, semanticsContext)) {
Fortran::lower::dumpPFT(llvm::outs(), *ast);