Skip to content

Commit

Permalink
[flang] Ignore -f[no-]realloc-lhs.
Browse files Browse the repository at this point in the history
After llvm#120165 clang started complaining about unknown
option -f[no-]realloc-lhs. This change fixes it to ignore
the option like it used to be.
  • Loading branch information
vzakhari committed Dec 17, 2024
1 parent 65d2177 commit 5d8d3e0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -3465,7 +3465,7 @@ defm diagnostics_show_line_numbers : BoolFOption<"diagnostics-show-line-numbers"
PosFlag<SetTrue>>;
def fno_realloc_lhs : Flag<["-"], "fno-realloc-lhs">, Group<f_Group>,
HelpText<"An allocatable left-hand side of an intrinsic assignment is assumed to be allocated and match the shape/type of the right-hand side">,
Visibility<[FlangOption, FC1Option]>;
Visibility<[ClangOption, CLOption, FlangOption, FC1Option]>;
def fno_stack_protector : Flag<["-"], "fno-stack-protector">, Group<f_Group>,
HelpText<"Disable the use of stack protectors">;
def fno_strict_aliasing : Flag<["-"], "fno-strict-aliasing">, Group<f_Group>,
Expand Down Expand Up @@ -4300,7 +4300,7 @@ defm stack_size_section : BoolFOption<"stack-size-section",
"Emit section containing metadata on function stack sizes">,
NegFlag<SetFalse>>;
def frealloc_lhs : Flag<["-"], "frealloc-lhs">, Group<f_Group>,
Visibility<[FlangOption, FC1Option]>,
Visibility<[ClangOption, CLOption, FlangOption, FC1Option]>,
HelpText<"If an allocatable left-hand side of an intrinsic assignment is unallocated or its shape/type does not match the right-hand side, then it is automatically (re)allocated">;
def fstack_usage : Flag<["-"], "fstack-usage">, Group<f_Group>,
HelpText<"Emit .su file containing information on function stack sizes">;
Expand Down
7 changes: 7 additions & 0 deletions clang/test/Driver/frealloc-lhs.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// RUN: %clang -Wunused-command-line-argument -frealloc-lhs -### %s 2> %t
// RUN: FileCheck < %t %s --check-prefix=REALLOCLHS
// RUN: %clang -Wunused-command-line-argument -fno-realloc-lhs -### %s 2> %t
// RUN: FileCheck < %t %s --check-prefix=NOREALLOCLHS

// CHECK: argument unused during compilation: '-frealloc-lhs'
// CHECK: argument unused during compilation: '-fno-realloc-lhs'

0 comments on commit 5d8d3e0

Please sign in to comment.