[PATCH] Reimplement -fsanitize-recover family of flags.

Alexey Samsonov vonosmas at gmail.com
Mon Nov 17 18:13:58 PST 2014


Hi rsmith,

Introduce the following `-fsanitize-recover` flags:
* -fsanitize-recover: Enable recovery for all checks enabled by `-fsanitize=` which support it.
* -fno-sanitize-recover: Disable recovery for all checks.
* -fsanitize-recover=<list>: Enable recovery for all selected checks or group of checks. It is
  forbidden to list unrecoverable sanitizers here (that is, "address", "unreachable", "return").
* -fno-sanitize-recover=<list>: Disable recovery for selected checks or group of checks.
These flags are parsed left to right, and mask of "recoverable" sanitizer is updated accordingly,
much like what we do for `-fsanitize=` flags.
`-fsanitize=` and `-fsanitize-recover=` flag families are independent.

CodeGen change: If there is a single UBSan handler function, responsible for implementing multiple
checks, which have different recoverable setting, then we emit two handler calls instead of one:
the first one for the set of "unrecoverable" checks, another one - for set of "recoverable"
checks. If all checks implemented by a handler have the same recoverability setting, then the
generated code will be the same.

http://reviews.llvm.org/D6302

Files:
  projects/compiler-rt/test/ubsan/TestCases/Integer/no-recover.cpp
  projects/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-virtual-base.cpp
  tools/clang/include/clang/Driver/Options.td
  tools/clang/include/clang/Driver/SanitizerArgs.h
  tools/clang/include/clang/Frontend/CodeGenOptions.def
  tools/clang/include/clang/Frontend/CodeGenOptions.h
  tools/clang/lib/CodeGen/CGExpr.cpp
  tools/clang/lib/Driver/SanitizerArgs.cpp
  tools/clang/lib/Frontend/CompilerInvocation.cpp
  tools/clang/test/CodeGen/catch-undef-behavior.c
  tools/clang/test/CodeGen/compound-assign-overflow.c
  tools/clang/test/CodeGen/sanitize-recover.c
  tools/clang/test/CodeGen/ubsan-type-blacklist.cpp
  tools/clang/test/CodeGenCXX/catch-undef-behavior.cpp
  tools/clang/test/Driver/fsanitize.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6302.16313.patch
Type: text/x-patch
Size: 28629 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141118/db3d1cf1/attachment.bin>


More information about the cfe-commits mailing list