Reimplement -fsanitize-recover family of flags.
Introduce the following -fsanitize-recover flags: - -fsanitize-recover=<list>: Enable recovery for selected checks or group of checks. It is forbidden to explicitly list unrecoverable sanitizers here (that is, "address", "unreachable", "return"). - -fno-sanitize-recover=<list>: Disable recovery for selected checks or group of checks. - -f(no-)?sanitize-recover is now a synonym for -f(no-)?sanitize-recover=undefined,integer and will soon be deprecated. 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225719 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- docs/UsersManual.rst 11 additions, 4 deletionsdocs/UsersManual.rst
- include/clang/Driver/Options.td 10 additions, 4 deletionsinclude/clang/Driver/Options.td
- include/clang/Driver/SanitizerArgs.h 1 addition, 1 deletioninclude/clang/Driver/SanitizerArgs.h
- include/clang/Frontend/CodeGenOptions.def 0 additions, 3 deletionsinclude/clang/Frontend/CodeGenOptions.def
- include/clang/Frontend/CodeGenOptions.h 5 additions, 0 deletionsinclude/clang/Frontend/CodeGenOptions.h
- lib/CodeGen/CGExpr.cpp 85 additions, 38 deletionslib/CodeGen/CGExpr.cpp
- lib/Driver/SanitizerArgs.cpp 45 additions, 7 deletionslib/Driver/SanitizerArgs.cpp
- lib/Frontend/CompilerInvocation.cpp 23 additions, 13 deletionslib/Frontend/CompilerInvocation.cpp
- test/CodeGen/catch-undef-behavior.c 3 additions, 3 deletionstest/CodeGen/catch-undef-behavior.c
- test/CodeGen/compound-assign-overflow.c 1 addition, 1 deletiontest/CodeGen/compound-assign-overflow.c
- test/CodeGen/sanitize-recover.c 25 additions, 3 deletionstest/CodeGen/sanitize-recover.c
- test/CodeGen/ubsan-type-blacklist.cpp 2 additions, 2 deletionstest/CodeGen/ubsan-type-blacklist.cpp
- test/CodeGenCXX/catch-undef-behavior.cpp 3 additions, 3 deletionstest/CodeGenCXX/catch-undef-behavior.cpp
- test/Driver/fsanitize.c 13 additions, 4 deletionstest/Driver/fsanitize.c
Loading
Please register or sign in to comment