[all-commits] [llvm/llvm-project] 83a069: [flang][driver] Update the visibility of Clang opt...

Andrzej WarzyƄski via All-commits all-commits at lists.llvm.org
Thu Aug 17 12:13:08 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 83a06997c69a17def2f58fd556c094b8f1060b89
  Author: Andrzej Warzynski <andrzej.warzynski at arm.com>
  Date:   2023-08-17 (Thu, 17 Aug 2023)

  Changed paths:
    M clang/include/clang/Driver/Options.td
    M clang/lib/Driver/Driver.cpp
    M clang/test/Driver/flang/flang.f90
    M clang/test/Driver/flang/flang_ucase.F90
    M flang/test/Driver/driver-help-hidden.f90
    M flang/test/Driver/driver-help.f90
    M flang/test/Driver/fast_math.f90

  Log Message:
  [flang][driver] Update the visibility of Clang options in Flang

Prior to D157151, there was no mechanism to "disable" unsupported Clang
options in Flang. While the "help" text (`flang-new -help`) was indeed
configured not to display such options, the Flang compiler driver would
happily consume such options and only issue a warning when there was no
logic to parse it:
flang-new -fno-experimental-relative-c++-abi-vtables file.f90
flang-new: warning: argument unused during compilation: '-fno-experimental-relative-c++-abi-vtables'

D157151 introduces visibility flags. In particular, all Clang options
gain a visibility flag (`ClangOption`) that can be excluded when in
Flang driver mode. This way the above invocation will lead to:

flang-new: error: unknown argument '-fno-experimental-relative-c++-abi-vtables'; did you mean '-Xclang -fno-experimental-relative-c++-abi-vtables'?

This won't work unless all options/flags supported by Flang have their
visibility flags updated accordingly, hence the changes in Options.td.
Moving forward, this change will allow Flang better control over the
supported options.

Depends on D157151

Differential Revision: https://reviews.llvm.org/D157837

More information about the All-commits mailing list