[flang-commits] [flang] f372142 - [flang] Add dump-symbols option to bbc
Valentin Clement via flang-commits
flang-commits at lists.llvm.org
Mon Jul 18 04:40:32 PDT 2022
Author: Valentin Clement
Date: 2022-07-18T13:40:25+02:00
New Revision: f372142740dd5543dafc17fe3e0c521a63d4ff43
URL: https://github.com/llvm/llvm-project/commit/f372142740dd5543dafc17fe3e0c521a63d4ff43
DIFF: https://github.com/llvm/llvm-project/commit/f372142740dd5543dafc17fe3e0c521a63d4ff43.diff
LOG: [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
Added:
Modified:
flang/test/Semantics/typeinfo01.f90
flang/tools/bbc/bbc.cpp
Removed:
################################################################################
diff --git a/flang/test/Semantics/typeinfo01.f90 b/flang/test/Semantics/typeinfo01.f90
index 570898ca781c2..323fb27399258 100644
--- a/flang/test/Semantics/typeinfo01.f90
+++ b/flang/test/Semantics/typeinfo01.f90
@@ -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
diff --git a/flang/tools/bbc/bbc.cpp b/flang/tools/bbc/bbc.cpp
index 6f2f326173f2b..cb8c78427a798 100644
--- a/flang/tools/bbc/bbc.cpp
+++ b/flang/tools/bbc/bbc.cpp
@@ -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);
More information about the flang-commits
mailing list