Skip to content

Commit 61d9c1f

Browse files
committed
Add more reset changes
1 parent 88ce7ab commit 61d9c1f

File tree

5 files changed

+22
-13
lines changed

5 files changed

+22
-13
lines changed

clang/docs/UsersManual.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2280,9 +2280,9 @@ are listed below.
22802280
.. option:: -f[no-]sanitize-type-outline-instrumentation
22812281

22822282
Controls how type sanitizer code is generated. If enabled will always use
2283-
a function call instead of inlining the code. Turning this option on may
2284-
reduce the binary size and compilation overhead, but might result in a worse
2285-
run-time performance.
2283+
a function call instead of inlining the code. Turning this option off may
2284+
result in better run-time performance, but will increase binary size and
2285+
compilation overhead.
22862286

22872287
See :doc: `TypeSanitizer` for more details.
22882288

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 TysanOutlineInstrumentation = false;
70+
bool TysanOutlineInstrumentation = true;
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2464,7 +2464,7 @@ def fsanitize_type_outline_instrumentation : Flag<["-"], "fsanitize-type-outline
24642464
HelpText<"Always generate function calls for type sanitizer instrumentation">;
24652465
def fno_sanitize_type_outline_instrumentation : Flag<["-"], "fno-sanitize-type-outline-instrumentation">,
24662466
Group<f_clang_Group>,
2467-
HelpText<"Use default code inlining logic for the type sanitizer">;
2467+
HelpText<"Use code inlining logic for the type sanitizer">;
24682468
defm sanitize_stable_abi
24692469
: OptInCC1FFlag<"sanitize-stable-abi", "Stable ", "Conventional ",
24702470
"ABI instrumentation for sanitizer runtime. Default: Conventional">;

clang/lib/Driver/SanitizerArgs.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,11 +1507,7 @@ void SanitizerArgs::addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,
15071507
CmdArgs.push_back("-asan-instrumentation-with-call-threshold=0");
15081508
}
15091509

1510-
if (TysanOutlineInstrumentation) {
1511-
CmdArgs.push_back("-mllvm");
1512-
CmdArgs.push_back("-tysan-outline-instrumentation");
1513-
}
1514-
else{
1510+
if (!TysanOutlineInstrumentation) {
15151511
CmdArgs.push_back("-mllvm");
15161512
CmdArgs.push_back("-tysan-outline-instrumentation=false");
15171513
}
Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
11
// UNSUPPORTED: target={{.*}}-windows-{{.*}}
22

3+
// RUN: %clang -S -fsanitize=type -emit-llvm -o - -fsanitize=type %s \
4+
// RUN: | FileCheck %s --check-prefixes=CHECK-NO-OUTLINE
35
// RUN: %clang -S -fsanitize=type -emit-llvm -o - -fsanitize=type %s \
46
// RUN: -fsanitize-type-outline-instrumentation \
57
// RUN: | FileCheck %s --check-prefixes=CHECK-OUTLINE
8+
69
// RUN: %clang -S -fsanitize=type -emit-llvm -o - -fsanitize=type %s \
7-
// RUN: -fno-sanitize-type-outline-instrumentation \
8-
// RUN: | FileCheck %s --check-prefixes=CHECK-NO-OUTLINE
10+
// RUN: -fsanitize-type-outline-instrumentation \
11+
// RUN: -fsanitize-type-verify-outlined-instrumentation \
12+
// RUN: | FileCheck %s --check-prefixes=CHECK-OUTLINE
13+
// RUN: %clang -S -fsanitize=type -emit-llvm -o - -fsanitize=type %s \
14+
// RUN: -fsanitize-type-verify-outlined-instrumentation \
15+
// RUN: | FileCheck %s --check-prefixes=CHECK-OUTLINE
916

10-
// CHECK-OUTLINE: call{{.*}}@__tysan_instrument_mem_inst
17+
// CHECK-LABEL: @alias
18+
// CHECK: __tysan_app_memory_mask
19+
// CHECK: __tysan_shadow_memory_address
1120
// CHECK-NO-OUTLINE-NOT: call{{.*}}@__tysan_instrument_mem_inst
21+
// CHECK-NO-OUTLINE-NOT: call{{.*}}@__tysan_instrument_with_shadow_update
22+
// CHECK-OUTLINE: call{{.*}}@__tysan_instrument_mem_inst
23+
// CHECK-OUTLINE: call{{.*}}@__tysan_instrument_with_shadow_update
1224

1325
float alias(int *ptr){
1426
float *aliasedPtr = (float *)ptr;
27+
*aliasedPtr *= 2.0f;
1528
return *aliasedPtr;
1629
}

0 commit comments

Comments
 (0)