Skip to content

Commit f0f59e3

Browse files
nicotstellar
authored andcommitted
[clang] Expose -f(no-)strict-overflow as a clang-cl option (llvm#126512)
Also move the -fno-strict-overflow option definition next to the -fstrict-overflow one while here. Also add test coverage for f(no-)wrapv-pointer being a clang-cl option. (cherry picked from commit 71adb05)
1 parent ed762db commit f0f59e3

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3505,8 +3505,6 @@ def fno_strict_aliasing : Flag<["-"], "fno-strict-aliasing">, Group<f_Group>,
35053505
def fstruct_path_tbaa : Flag<["-"], "fstruct-path-tbaa">, Group<f_Group>;
35063506
def fno_struct_path_tbaa : Flag<["-"], "fno-struct-path-tbaa">, Group<f_Group>;
35073507
def fno_strict_enums : Flag<["-"], "fno-strict-enums">, Group<f_Group>;
3508-
def fno_strict_overflow : Flag<["-"], "fno-strict-overflow">, Group<f_Group>,
3509-
Visibility<[ClangOption, FlangOption]>;
35103508
defm init_global_zero : BoolOptionWithoutMarshalling<"f", "init-global-zero",
35113509
PosFlag<SetTrue, [], [FlangOption, FC1Option],
35123510
"Zero initialize globals without default initialization (default)">,
@@ -4023,7 +4021,9 @@ defm strict_vtable_pointers : BoolFOption<"strict-vtable-pointers",
40234021
" overwriting polymorphic C++ objects">,
40244022
NegFlag<SetFalse>>;
40254023
def fstrict_overflow : Flag<["-"], "fstrict-overflow">, Group<f_Group>,
4026-
Visibility<[ClangOption, FlangOption]>;
4024+
Visibility<[ClangOption, CLOption, FlangOption]>;
4025+
def fno_strict_overflow : Flag<["-"], "fno-strict-overflow">, Group<f_Group>,
4026+
Visibility<[ClangOption, CLOption, FlangOption]>;
40274027
def fpointer_tbaa : Flag<["-"], "fpointer-tbaa">, Group<f_Group>;
40284028
def fdriver_only : Flag<["-"], "fdriver-only">, Flags<[NoXarchOption]>,
40294029
Visibility<[ClangOption, CLOption, DXCOption]>,

clang/test/Driver/cl-options.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,9 +738,13 @@
738738
// RUN: -fno-modules-search-all \
739739
// RUN: -fimplicit-modules \
740740
// RUN: -fno-implicit-modules \
741+
// RUN: -fstrict-overflow \
742+
// RUN: -fno-strict-overflow \
741743
// RUN: -ftrivial-auto-var-init=zero \
742744
// RUN: -fwrapv \
743745
// RUN: -fno-wrapv \
746+
// RUN: -fwrapv-pointer \
747+
// RUN: -fno-wrapv-pointer \
744748
// RUN: --version \
745749
// RUN: -Werror /Zs -- %s 2>&1
746750

0 commit comments

Comments
 (0)