This is an archive of the discontinued LLVM Phabricator instance.

[flang][driver] Add support for `-fdebug-dump-symbols-sources`
ClosedPublic

Authored by awarzynski on Mar 8 2021, 9:05 AM.

Details

Summary

Note that the original spelling in f18 is -fget-symbols-sources. The
new driver will only support the new spelling, which is also added to
f18 as an alias for the existing one.

Tests are updated to use the new spelling and to use %flang_fc1
instead of %f18. This way both the new and the current driver are
tested.

As:

  • both -fsyntax-only and -fdebug-dump-symbols-sources are action flags, and
  • the new driver will only consider the right-most action flag,

RUN lines in tests are updated so that the tests work with both
f18 (requires both flags) and flang-new (only considers the last
action flag).

Diff Detail

Event Timeline

awarzynski created this revision.Mar 8 2021, 9:05 AM
awarzynski requested review of this revision.Mar 8 2021, 9:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 8 2021, 9:05 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

-fget-symbols-sources is not a debug option, it's intended for integrating with IDEs like vscode. So I think the original name is better. Unlike the "dump" options it actually is an action and not something that is intended to produce debug output on the way to doing something else.

Switch back from -fdebug-dump-symbols-sources to -fget-symbols-sources

-fget-symbols-sources is not a debug option, it's intended for integrating with IDEs like vscode. So I think the original name is better. Unlike the "dump" options it actually is an action and not something that is intended to produce debug output on the way to doing something else.

Makes sense, updated. Would this option be used to extract debug/code-navigation info? Is there an equivalent in clang or gfortran? Just curious.

On a separate note, all these debug options are _actions_. We may want to fine-tune it at some point.

Would this option be used to extract debug/code-navigation info?

Yes, it's something related to mapping between symbols and source locations.

Is there an equivalent in clang or gfortran?

Not that I know of.

-fget-symbols-sources is not a debug option, it's intended for integrating with IDEs like vscode. So I think the original name is better. Unlike the "dump" options it actually is an action and not something that is intended to produce debug output on the way to doing something else.

A drive-through comment.
Do we plan to use a compiler option to integrate with IDEs? I was thinking the integration will be through another interface and not through the compiler driver and that the fget-symbols-sources is a temporary option to test the functionality. clangd which supports IDEs is a separate tool.
https://github.com/llvm/llvm-project/tree/main/clang-tools-extra/clangd

kiranchandramohan added inline comments.
flang/include/flang/Frontend/FrontendOptions.h
63

Nit: the -> then

This revision is now accepted and ready to land.Mar 17 2021, 12:27 PM
This revision was landed with ongoing or failed builds.Mar 18 2021, 7:13 AM
This revision was automatically updated to reflect the committed changes.