Skip to content

Commit adac920

Browse files
committed
[𝘀𝗽𝗿] changes introduced through rebase
Created using spr 1.3.7 [skip ci]
1 parent 676ae65 commit adac920

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ CODEGENOPT(SanitizeMemoryUseAfterDtor, 1, 0, Benign) ///< Enable use-after-delet
270270
CODEGENOPT(SanitizeCfiCrossDso, 1, 0, Benign) ///< Enable cross-dso support in CFI.
271271
CODEGENOPT(SanitizeMinimalRuntime, 1, 0, Benign) ///< Use "_minimal" sanitizer runtime for
272272
///< diagnostics.
273-
CODEGENOPT(SanitizePreserveRuntime, 1, 0, Benign) ///< Use "_preserve" sanitizer runtime for
273+
CODEGENOPT(SanitizeHandlerPreserveAllRegs, 1, 0, Benign) ///< Use "_preserve" sanitizer runtime for
274274
///< diagnostics.
275275
CODEGENOPT(SanitizeCfiICallGeneralizePointers, 1, 0, Benign) ///< Generalize pointer types in
276276
///< CFI icall function signatures

clang/include/clang/Driver/SanitizerArgs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class SanitizerArgs {
6767
bool TsanFuncEntryExit = true;
6868
bool TsanAtomics = true;
6969
bool MinimalRuntime = false;
70-
bool PreserveRuntime = false;
70+
bool HandlerPreserveAllRegs = false;
7171
// True if cross-dso CFI support if provided by the system (i.e. Android).
7272
bool ImplicitCfiRuntime = false;
7373
bool NeedsMemProfRt = false;

clang/include/clang/Options/Options.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2656,9 +2656,9 @@ defm sanitize_minimal_runtime : BoolOption<"f", "sanitize-minimal-runtime",
26562656
PosFlag<SetTrue>,
26572657
NegFlag<SetFalse>>,
26582658
Group<f_clang_Group>;
2659-
defm sanitize_preserve_runtime
2660-
: BoolOption<"f", "sanitize-preserve-runtime",
2661-
CodeGenOpts<"SanitizePreserveRuntime">, DefaultFalse,
2659+
defm sanitize_handler_preserve_all_regs_experimental
2660+
: BoolOption<"f", "sanitize-handler-preserve-all-regs-experimental",
2661+
CodeGenOpts<"SanitizeHandlerPreserveAllRegs">, DefaultFalse,
26622662
PosFlag<SetTrue>, NegFlag<SetFalse>>,
26632663
Group<f_clang_Group>;
26642664
def fsanitize_link_runtime : Flag<["-"], "fsanitize-link-runtime">,

clang/lib/Driver/SanitizerArgs.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,10 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC,
423423
MinimalRuntime =
424424
Args.hasFlag(options::OPT_fsanitize_minimal_runtime,
425425
options::OPT_fno_sanitize_minimal_runtime, MinimalRuntime);
426-
PreserveRuntime =
427-
Args.hasFlag(options::OPT_fsanitize_preserve_runtime,
428-
options::OPT_fno_sanitize_preserve_runtime, PreserveRuntime);
426+
HandlerPreserveAllRegs = Args.hasFlag(
427+
options::OPT_fsanitize_handler_preserve_all_regs_experimental,
428+
options::OPT_fno_sanitize_handler_preserve_all_regs_experimental,
429+
HandlerPreserveAllRegs);
429430

430431
// The object size sanitizer should not be enabled at -O0.
431432
Arg *OptLevel = Args.getLastArg(options::OPT_O_Group);
@@ -1472,8 +1473,8 @@ void SanitizerArgs::addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,
14721473
if (MinimalRuntime)
14731474
CmdArgs.push_back("-fsanitize-minimal-runtime");
14741475

1475-
if (PreserveRuntime)
1476-
CmdArgs.push_back("-fsanitize-preserve-runtime");
1476+
if (HandlerPreserveAllRegs)
1477+
CmdArgs.push_back("-fsanitize-handler-preserve-all-regs-experimental");
14771478

14781479
if (AsanFieldPadding)
14791480
CmdArgs.push_back(Args.MakeArgString("-fsanitize-address-field-padding=" +

clang/test/Driver/fsanitize.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -984,10 +984,10 @@
984984
// CHECK-UBSAN-MINIMAL: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|shift-base|shift-exponent|unreachable|return|vla-bound|alignment|null|pointer-overflow|float-cast-overflow|array-bounds|enum|bool|builtin|returns-nonnull-attribute|nonnull-attribute|function),?){18}"}}
985985
// CHECK-UBSAN-MINIMAL: "-fsanitize-minimal-runtime"
986986

987-
// RUN: %clang --target=x86_64-linux-gnu -fsanitize=undefined -fsanitize-minimal-runtime -fsanitize-preserve-runtime %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UBSAN-MINIMAL-PRESERVE
987+
// RUN: %clang --target=x86_64-linux-gnu -fsanitize=undefined -fsanitize-minimal-runtime -fsanitize-handler-preserve-all-regs-experimental %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UBSAN-MINIMAL-PRESERVE
988988
// CHECK-UBSAN-MINIMAL-PRESERVE: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|shift-base|shift-exponent|unreachable|return|vla-bound|alignment|null|pointer-overflow|float-cast-overflow|array-bounds|enum|bool|builtin|returns-nonnull-attribute|nonnull-attribute|function),?){18}"}}
989989
// CHECK-UBSAN-MINIMAL-PRESERVE: "-fsanitize-minimal-runtime"
990-
// CHECK-UBSAN-MINIMAL-PRESERVE: "-fsanitize-preserve-runtime"
990+
// CHECK-UBSAN-MINIMAL-PRESERVE: "-fsanitize-handler-preserve-all-regs-experimental"
991991

992992
// RUN: %clang --target=x86_64-linux-gnu -fsanitize=integer -fsanitize-trap=integer %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-INTSAN-TRAP
993993
// CHECK-INTSAN-TRAP: "-fsanitize-trap=integer-divide-by-zero,shift-base,shift-exponent,signed-integer-overflow,unsigned-integer-overflow,unsigned-shift-base,implicit-unsigned-integer-truncation,implicit-signed-integer-truncation,implicit-integer-sign-change"

0 commit comments

Comments
 (0)