Option handling (support) of -fsanitize=use-after-scope

Hello.

I've been working on use-after-scope sanitizer enablement in the GCC compiler ([1]) and
as I've read following submit request ([2]), the LLVM compiler started to utilize following option:
-mllvm -asan-use-after-scope=1

My initial attempt was to introduce a new option value for -fsanitize option (which would make both LLVM and GCC
option compatible). Following the current behavior of the LLVM, I would have to add a new --param which would
lead to a divergence. Is the suggested approach alterable for LLVM community?

I would also suggest following default behavior:
- If -fsanitize=address or -fsanitize=kernel-address is enabled, the use-after-scope sanitization should be enabled
- Similarly, providing -fuse-after-scope should enable address sanitization (either use-space or kernel-space)

Thank you for feedback,
Martin

[1] Martin LiÅka - [PATCH, RFC] Introduce -fsanitize=use-after-scope
[2] http://reviews.llvm.org/D19347

Cc-ed Google folks.

Hello.

I’ve been working on use-after-scope sanitizer enablement in the GCC compiler ([1]) and
as I’ve read following submit request ([2]), the LLVM compiler started to utilize following option:
-mllvm -asan-use-after-scope=1

My initial attempt was to introduce a new option value for -fsanitize option (which would make both LLVM and GCC
option compatible). Following the current behavior of the LLVM, I would have to add a new --param which would
lead to a divergence. Is the suggested approach alterable for LLVM community?

I would also suggest following default behavior:

  • If -fsanitize=address or -fsanitize=kernel-address is enabled, the use-after-scope sanitization should be enabled

This is the plan, but after feature is ready to be enabled by default.

  • Similarly, providing -fuse-after-scope should enable address sanitization (either use-space or kernel-space)

We’d like to go with:
-fsanitize-address-use-after-scope
-fno-sanitize-address-use-after-scope
for consistency with -fsanitize-memory-use-after-dtor from MemorySanitizer