[flang-commits] [PATCH] D129156: Add -fpass-plugin option to Flang

Tarun Prabhu via Phabricator via flang-commits flang-commits at lists.llvm.org
Tue Jul 5 11:06:21 PDT 2022


tarunprabhu created this revision.
tarunprabhu added reviewers: klausler, awarzynski.
tarunprabhu added a project: Flang.
Herald added subscribers: jdoerfert, mgorny.
Herald added a reviewer: sscalpone.
Herald added a project: All.
tarunprabhu requested review of this revision.
Herald added a subscriber: MaskRay.

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.

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.

- A simple LLVM pass has been included to test this functionality.


https://reviews.llvm.org/D129156

Files:
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/ToolChains/Flang.cpp
  flang/examples/CMakeLists.txt
  flang/include/flang/Frontend/CodeGenOptions.h
  flang/lib/Frontend/CompilerInvocation.cpp
  flang/lib/Frontend/FrontendActions.cpp
  flang/test/Driver/driver-help-hidden.f90
  flang/test/Driver/driver-help.f90
  flang/test/Examples/print-fns-definitions.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129156.442357.patch
Type: text/x-patch
Size: 8645 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220705/97c8877a/attachment.bin>


More information about the flang-commits mailing list