Introducing a plugin API and a simple HelloWorld Plugin example.
This patch adds the -load and -plugin flags to frontend driver and
the code around using custom frontend actions from within a plugin
shared library object.
It also adds to the Driver-help test to check the help option with the
updated driver flags.
Additionally, the patch creates a plugin-example test to check the
HelloWorld plugin example runs correctly. As part of this, a new CMake
flag (FLANG_BUILD_EXAMPLES) is added to allow the example to be built
and for the test to run.
This Plugin API has only been tested on Linux.
Could you add the following at the top of this file:
This will make sure that the examples are not build with e.g. ninja when FLANG_BUILD_EXAMPLES is Off.
In Clang, CMake also contains
I think that set(EXCLUDE_FROM_ALL ON) should be sufficient though (see CMake docs for EXCLUDE_FROM_ALL).
Note that in LLVM, there is add_llvm_example_library. It would be nice to use that, be we'd need to make sure that LLVM_BUILD_EXAMPLES is set correctly. But that's not required just now and could be added later.