Skip to content

Commit 5d8d3e0

Browse files
committed
[flang] Ignore -f[no-]realloc-lhs.
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.
1 parent 65d2177 commit 5d8d3e0

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3465,7 +3465,7 @@ defm diagnostics_show_line_numbers : BoolFOption<"diagnostics-show-line-numbers"
34653465
PosFlag<SetTrue>>;
34663466
def fno_realloc_lhs : Flag<["-"], "fno-realloc-lhs">, Group<f_Group>,
34673467
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">,
3468-
Visibility<[FlangOption, FC1Option]>;
3468+
Visibility<[ClangOption, CLOption, FlangOption, FC1Option]>;
34693469
def fno_stack_protector : Flag<["-"], "fno-stack-protector">, Group<f_Group>,
34703470
HelpText<"Disable the use of stack protectors">;
34713471
def fno_strict_aliasing : Flag<["-"], "fno-strict-aliasing">, Group<f_Group>,
@@ -4300,7 +4300,7 @@ defm stack_size_section : BoolFOption<"stack-size-section",
43004300
"Emit section containing metadata on function stack sizes">,
43014301
NegFlag<SetFalse>>;
43024302
def frealloc_lhs : Flag<["-"], "frealloc-lhs">, Group<f_Group>,
4303-
Visibility<[FlangOption, FC1Option]>,
4303+
Visibility<[ClangOption, CLOption, FlangOption, FC1Option]>,
43044304
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">;
43054305
def fstack_usage : Flag<["-"], "fstack-usage">, Group<f_Group>,
43064306
HelpText<"Emit .su file containing information on function stack sizes">;

clang/test/Driver/frealloc-lhs.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// RUN: %clang -Wunused-command-line-argument -frealloc-lhs -### %s 2> %t
2+
// RUN: FileCheck < %t %s --check-prefix=REALLOCLHS
3+
// RUN: %clang -Wunused-command-line-argument -fno-realloc-lhs -### %s 2> %t
4+
// RUN: FileCheck < %t %s --check-prefix=NOREALLOCLHS
5+
6+
// CHECK: argument unused during compilation: '-frealloc-lhs'
7+
// CHECK: argument unused during compilation: '-fno-realloc-lhs'

0 commit comments

Comments
 (0)