aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorKees Cook <kees@kernel.org>2025-05-07 05:41:24 -0700
committerGitHub <noreply@github.com>2025-05-07 05:41:24 -0700
commitc7b2d98c934c9578dd880370905b5abafdeccbe3 (patch)
tree27882cc8ca888aeb5ce6e118b9f2cc6f4ed2233b /clang/lib/Frontend/InitPreprocessor.cpp
parent17b2b6ddef4b1dc74a4b459d06510c25fa883329 (diff)
downloadllvm-c7b2d98c934c9578dd880370905b5abafdeccbe3.zip
llvm-c7b2d98c934c9578dd880370905b5abafdeccbe3.tar.gz
llvm-c7b2d98c934c9578dd880370905b5abafdeccbe3.tar.bz2
[sancov] Introduce optional callback for stack-depth tracking (#138323)
Normally -fsanitize-coverage=stack-depth inserts inline arithmetic to update thread_local __sancov_lowest_stack. To support stack depth tracking in the Linux kernel, which does not implement traditional thread_local storage, provide the option to call a function instead. This matches the existing "stackleak" implementation that is supported in Linux via a GCC plugin. To make this coverage more performant, a minimum estimated stack depth can be chosen to enable the callback mode, skipping instrumentation of functions with smaller stacks. With -fsanitize-coverage-stack-depth-callback-min set greater than 0, the __sanitize_cov_stack_depth() callback will be injected when the estimated stack depth is greater than or equal to the given minimum.
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
0 files changed, 0 insertions, 0 deletions