[all-commits] [llvm/llvm-project] c3821b: [flang] Add -fpass-plugin option to flang

Tarun Prabhu via All-commits all-commits at lists.llvm.org
Thu Nov 10 07:08:19 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c3821b8d2aacd1d7c0281db1b8db011e1158cf4d
      https://github.com/llvm/llvm-project/commit/c3821b8d2aacd1d7c0281db1b8db011e1158cf4d
  Author: Tarun Prabhu <tarun at lanl.gov>
  Date:   2022-11-10 (Thu, 10 Nov 2022)

  Changed paths:
    M clang/include/clang/Driver/Options.td
    M clang/lib/Driver/ToolChains/Flang.cpp
    M clang/lib/Driver/ToolChains/Flang.h
    M flang/docs/FlangDriver.md
    M flang/docs/ReleaseNotes.md
    M flang/include/flang/Frontend/CodeGenOptions.h
    M flang/lib/Frontend/CompilerInvocation.cpp
    M flang/lib/Frontend/FrontendActions.cpp
    M flang/test/CMakeLists.txt
    M flang/test/Driver/driver-help-hidden.f90
    M flang/test/Driver/driver-help.f90
    M flang/test/Driver/frontend-forwarding.f90
    A flang/test/Driver/pass-plugin-not-found.f90
    A flang/test/Driver/pass-plugin.f90

  Log Message:
  -----------
  [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




More information about the All-commits mailing list