Skip to content

[flang] Ignore -f[no-]realloc-lhs. #120320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this now show up in clang --help and online guide? Is that what we want?
Is CLOption for Windows?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this now show up in clang --help and online guide? Is that what we want? Is CLOption for Windows?

Good point! Yes, clang --help now shows it, and I think we do not want this. I will check how I can resolve this. Any advices are welcome.

Yes, CLOption is for Windows driver.

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'
Loading