llvm/clang/lib
Tong Zhang 17ce89fa80 [SanitizerBounds] Add support for NoSanitizeBounds function
Currently adding attribute no_sanitize("bounds") isn't disabling
-fsanitize=local-bounds (also enabled in -fsanitize=bounds). The Clang
frontend handles fsanitize=array-bounds which can already be disabled by
no_sanitize("bounds"). However, instrumentation added by the
BoundsChecking pass in the middle-end cannot be disabled by the
attribute.

The fix is very similar to D102772 that added the ability to selectively
disable sanitizer pass on certain functions.

In this patch, if no_sanitize("bounds") is provided, an additional
function attribute (NoSanitizeBounds) is attached to IR to let the
BoundsChecking pass know we want to disable local-bounds checking. In
order to support this feature, the IR is extended (similar to D102772)
to make Clang able to preserve the information and let BoundsChecking
pass know bounds checking is disabled for certain function.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D119816
2022-03-01 18:47:02 +01:00
..
Analysis [clang][dataflow] Add SAT solver interface and implementation 2022-02-25 14:46:52 +00:00
APINotes
ARCMigrate [clang] Use true/false instead of 1/0 (NFC) 2022-01-09 00:19:47 -08:00
AST [Clang] Remove redundant init-parens in AST print 2022-02-28 19:31:16 -06:00
ASTMatchers Add isConstinit matcher 2022-01-24 08:35:42 -05:00
Basic [NFC][Clang][AArch64] Clean up AArch64TargetInfo::hasFeature 2022-02-28 14:25:12 +00:00
CodeGen [SanitizerBounds] Add support for NoSanitizeBounds function 2022-03-01 18:47:02 +01:00
CrossTU Revert "[analyzer][ctu] Fix wrong 'multiple definitions' errors caused by space characters in lookup names when parsing the ctu index file" 2021-12-16 20:46:51 -05:00
DirectoryWatcher
Driver [Clang] Add -funstable flag to enable unstable and experimental features 2022-03-01 12:35:20 +00:00
Edit [clang] Use true/false instead of 1/0 (NFC) 2022-01-09 00:19:47 -08:00
Format [NFC][Lexer] Make Lexer::LangOpts const reference 2022-02-28 15:42:19 +01:00
Frontend [clang] Improve laziness of resolving module map headers. 2022-03-01 15:56:23 +01:00
FrontendTool [clang] Add an extract-api driver option 2022-01-26 11:31:12 -08:00
Headers [NVPTX] Fix nvvm.match.sync*.i64 intrinsics return type (i64 -> i32) 2022-03-01 12:26:16 +02:00
Index
IndexSerialization
Interpreter [C++20][Modules][1/8] Track valid import state. 2022-02-21 09:09:37 +00:00
Lex [clang] Improve laziness of resolving module map headers. 2022-03-01 15:56:23 +01:00
Parse [c++2b] Implement P0849R8 auto(x) 2022-02-28 19:21:08 -06:00
Rewrite Add assert on End iteration distance to Rewriter::getRewrittenText. 2022-01-25 17:26:13 +00:00
Sema [NFC]Promote addInstantiatedParametersToScope to a private Sema function 2022-03-01 08:31:51 -08:00
Serialization [clang] Improve laziness of resolving module map headers. 2022-03-01 15:56:23 +01:00
StaticAnalyzer [NFC][analyzer] Allow CallDescriptions to be matched with CallExprs 2022-03-01 17:13:04 +01:00
Testing
Tooling [NFC] Don't pass temporary LangOptions to Lexer 2022-02-28 20:43:28 +01:00
CMakeLists.txt