[UBSan] Add !nosanitize metadata to the code generated by UBSan.

This is used to mark the instructions emitted by Clang to implement
variety of UBSan checks. Generally, we don't want to instrument these
instructions with another sanitizers (like ASan).

Reviewed in http://reviews.llvm.org/D4544

llvm-svn: 213291
This commit is contained in:
Alexey Samsonov
2014-07-17 18:46:27 +00:00
parent 0fc52d4e85
commit 24cad99307
6 changed files with 66 additions and 20 deletions

View File

@@ -247,6 +247,17 @@ public:
/// \brief Sanitizer options to use for this function.
const SanitizerOptions *SanOpts;
/// \brief True if CodeGen currently emits code implementing sanitizer checks.
bool IsSanitizerScope;
/// \brief RAII object to set/unset CodeGenFunction::IsSanitizerScope.
class SanitizerScope {
CodeGenFunction *CGF;
public:
SanitizerScope(CodeGenFunction *CGF);
~SanitizerScope();
};
/// In ARC, whether we should autorelease the return value.
bool AutoreleaseResult;