aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2014-07-17 18:46:27 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2014-07-17 18:46:27 +0000
commit24cad9930709a6448c4b23194ac06bf233ed18a6 (patch)
treecb1e644f0b7cf05585dd740d25d720bfa662f32e /clang/lib/CodeGen/CodeGenFunction.h
parent0fc52d4e85f71d68fd44159435cfc3be56b80c5c (diff)
downloadllvm-24cad9930709a6448c4b23194ac06bf233ed18a6.zip
llvm-24cad9930709a6448c4b23194ac06bf233ed18a6.tar.gz
llvm-24cad9930709a6448c4b23194ac06bf233ed18a6.tar.bz2
[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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index d6675f3..f7a9168 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -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;