[PATCH] D100649: [flang][driver] Fine-tune `-fdebug-dump-symbols`

Andrzej Warzynski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 16 08:47:53 PDT 2021


awarzynski updated this revision to Diff 338136.
awarzynski added a comment.

Rebase on top of D100648 <https://reviews.llvm.org/D100648>


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100649/new/

https://reviews.llvm.org/D100649

Files:
  flang/lib/Frontend/FrontendActions.cpp
  flang/test/Semantics/typeinfo01.f90


Index: flang/test/Semantics/typeinfo01.f90
===================================================================
--- flang/test/Semantics/typeinfo01.f90
+++ flang/test/Semantics/typeinfo01.f90
@@ -1,4 +1,4 @@
-!RUN: not %f18 -fdebug-dump-symbols %s | FileCheck %s
+!RUN: not %flang_fc1 -fdebug-dump-symbols %s | FileCheck %s
 ! Tests for derived type runtime descriptions
 
 module m01
Index: flang/lib/Frontend/FrontendActions.cpp
===================================================================
--- flang/lib/Frontend/FrontendActions.cpp
+++ flang/lib/Frontend/FrontendActions.cpp
@@ -49,7 +49,6 @@
   std::string currentInputPath{GetCurrentFileOrBufferName()};
   Fortran::parser::Options parserOptions = ci.invocation().fortranOpts();
 
-
   // Prescan. In case of failure, report and return.
   ci.parsing().Prescan(currentInputPath, parserOptions);
 
@@ -282,10 +281,22 @@
 }
 
 void DebugDumpSymbolsAction::ExecuteAction() {
+  CompilerInstance &ci = this->instance();
   auto &semantics = this->semantics();
 
+  auto tables{Fortran::semantics::BuildRuntimeDerivedTypeTables(
+      instance().invocation().semanticsContext())};
+  if (!tables.schemata) {
+    unsigned DiagID =
+        ci.diagnostics().getCustomDiagID(clang::DiagnosticsEngine::Error,
+            "could not find module file for __fortran_type_info");
+    ci.diagnostics().Report(DiagID);
+    llvm::errs() << "\n";
+  }
+
   // Dump symbols
   semantics.DumpSymbols(llvm::outs());
+
   // Report fatal semantic errors
   reportFatalSemanticErrors(
       semantics, this->instance().diagnostics(), GetCurrentFileOrBufferName());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100649.338136.patch
Type: text/x-patch
Size: 1610 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210416/806a7243/attachment.bin>


More information about the llvm-commits mailing list