diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2014-07-17 18:46:27 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2014-07-17 18:46:27 +0000 |
commit | 24cad9930709a6448c4b23194ac06bf233ed18a6 (patch) | |
tree | cb1e644f0b7cf05585dd740d25d720bfa662f32e /clang/lib/CodeGen/CGBuiltin.cpp | |
parent | 0fc52d4e85f71d68fd44159435cfc3be56b80c5c (diff) | |
download | bcm5719-llvm-24cad9930709a6448c4b23194ac06bf233ed18a6.tar.gz bcm5719-llvm-24cad9930709a6448c4b23194ac06bf233ed18a6.zip |
[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/CGBuiltin.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGBuiltin.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index 4bdc87e2d42..4f68b347dbf 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -447,11 +447,12 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD, return RValue::get(Builder.CreateCall(F)); } case Builtin::BI__builtin_unreachable: { - if (SanOpts->Unreachable) + if (SanOpts->Unreachable) { + SanitizerScope SanScope(this); EmitCheck(Builder.getFalse(), "builtin_unreachable", EmitCheckSourceLocation(E->getExprLoc()), ArrayRef<llvm::Value *>(), CRK_Unrecoverable); - else + } else Builder.CreateUnreachable(); // We do need to preserve an insertion point. |