[flang] Add -fpass-plugin option to flang
This patch adds the -fpass-plugin option to flang which dynamically loads LLVM passes from the shared object passed as the argument to the flag. The behavior of the option is designed to replicate that of the same option in clang and thus has the same capabilities and limitations. Features: Multiple instances of -fpass-plugin=path-to-file can be specified and each of the files will be loaded in that order. The flag can be passed to both flang-new and flang-new -fc1. The flag will be listed when the -help flag is passed to both flang-new and flang-new -fc1. It will also be listed when the --help-hidden flag is passed. Limitations: Dynamically loaded plugins are not supported in clang on Windows and are not supported in flang either. Addenda: Some minor stylistic changes are made in the files that were modified to enable this functionality. Those changes make the naming of functions more consistent, but do not change any functionality that is not directly related to enabling -fpass-plugin. Differential Revision: https://reviews.llvm.org/D129156
Loading
Please sign in to comment