Added Type-based blacklisting for sanitizers (SanitizerBlacklist::isBlacklistedType). On top of this, also added type-based blacklisting for UBsan's vptr.
Diff Detail
Event Timeline
lib/CodeGen/CGExpr.cpp | ||
---|---|---|
539 | Nit: please upload the diffs with more context. This can be done with e.g. "arc" commandline tool (see http://llvm.org/docs/Phabricator.html). This change is probably fine, though, as it's local. | |
544 | Now you shouldn't have generic "isIn(StringRef)" machinery in SanitizerBlacklist. Instead, it would be better to extend SanitizerBlacklist (which is now moved to lib/CodeGen/SanitizerBlacklist.h) with function like "isBlacklistedType(StringRef MangledTypeName)" and use it here. |
Modified to be compatible with r212643, and thus dropping the dependency with http://reviews.llvm.org/D4406.
LGTM modulo nit below. Let me know if I should commit this for you. Test in Clang is fine, but I would also add an "end-to-end" test case in compiler-rt ubsan lit test-suite. This can of course be done separately. Thanks!
test/CodeGen/ubsan-type-blacklist.cpp | ||
---|---|---|
20 ↗ | (On Diff #11274) | I'd use less restrictive pattern for TYPE-NOT, smth. like TYPE-NOT: @__ubsan_handle_dynamic_type_cache_miss |
Nit: please upload the diffs with more context. This can be done with e.g. "arc" commandline tool (see http://llvm.org/docs/Phabricator.html). This change is probably fine, though, as it's local.