[flang][driver] Add print function name Plugin example
authorStuart Ellis <stuart.ellis@arm.com>
Thu, 19 Aug 2021 08:07:45 +0000 (08:07 +0000)
committerAndrzej Warzynski <andrzej.warzynski@arm.com>
Thu, 19 Aug 2021 08:25:34 +0000 (08:25 +0000)
commit520e5db26a4a9fcb418d9ef2da813155038caade
treebb6ca94eccc44f40385bd48cc063c5477cb1702e
parent8e8b70aa8479e44c5a9a09ea832857d51f3faa6d
[flang][driver] Add print function name Plugin example

Replacing Hello World example Plugin with one that counts and prints the names of
functions and subroutines.
This involves changing the `PluginParseTreeAction` Plugin base class to
inherit from `PrescanAndSemaAction` class to get access to the Parse Tree
so that the Plugin can walk it.
Additionally, there are tests of this new Plugin to check it prints the correct
things in different circumstances.

Depends on: D106137

Reviewed By: awarzynski

Differential Revision: https://reviews.llvm.org/D107089
flang/examples/CMakeLists.txt
flang/examples/HelloWorld/HelloWorldPlugin.cpp [deleted file]
flang/examples/PrintFlangFunctionNames/CMakeLists.txt [moved from flang/examples/HelloWorld/CMakeLists.txt with 72% similarity]
flang/examples/PrintFlangFunctionNames/PrintFlangFunctionNames.cpp [new file with mode: 0644]
flang/include/flang/Frontend/FrontendActions.h
flang/test/CMakeLists.txt
flang/test/Driver/plugin-example.f90 [deleted file]
flang/test/Driver/plugin-invalid-name.f90 [new file with mode: 0644]
flang/test/Examples/print-fns-calls.f90 [new file with mode: 0644]
flang/test/Examples/print-fns-definitions.f90 [new file with mode: 0644]
flang/test/Examples/print-fns-interfaces.f90 [new file with mode: 0644]