summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorFilipe Cabecinhas <me@filcab.net>2016-12-12 16:18:40 +0000
committerFilipe Cabecinhas <me@filcab.net>2016-12-12 16:18:40 +0000
commit322ecd901b52650fcd0ec091a9a01c3483b6f57d (patch)
treee1c69a0b80aab8db547b01700d7211b6f6a31770 /clang/lib/CodeGen/CodeGenFunction.cpp
parenta64d4dc22fe1b40a8aa0fa83789878862fb19696 (diff)
downloadbcm5719-llvm-322ecd901b52650fcd0ec091a9a01c3483b6f57d.tar.gz
bcm5719-llvm-322ecd901b52650fcd0ec091a9a01c3483b6f57d.zip
[clang] Version support for UBSan handlers
This adds a way for us to version any UBSan handler by itself. The patch overrides D21289 for a better implementation (we're able to rev up a single handler). After this, then we can land a slight modification of D19667+D19668. We probably don't want to keep all the versions in compiler-rt (maybe we want to deprecate on one release and remove the old handler on the next one?), but with this patch we will loudly fail to compile when mixing incompatible handler calls, instead of silently compiling and then providing bad error messages. Reviewers: kcc, samsonov, rsmith, vsk Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D21695 llvm-svn: 289444
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 1507e8e073f..de2537dce7f 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -1149,8 +1149,8 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn,
SanitizerScope SanScope(this);
llvm::Value *IsFalse = Builder.getFalse();
EmitCheck(std::make_pair(IsFalse, SanitizerKind::Return),
- "missing_return", EmitCheckSourceLocation(FD->getLocation()),
- None);
+ SanitizerHandler::MissingReturn,
+ EmitCheckSourceLocation(FD->getLocation()), None);
} else if (CGM.getCodeGenOpts().OptimizationLevel == 0) {
EmitTrapCall(llvm::Intrinsic::trap);
}
@@ -1858,7 +1858,7 @@ void CodeGenFunction::EmitVariablyModifiedType(QualType type) {
};
EmitCheck(std::make_pair(Builder.CreateICmpSGT(Size, Zero),
SanitizerKind::VLABound),
- "vla_bound_not_positive", StaticArgs, Size);
+ SanitizerHandler::VLABoundNotPositive, StaticArgs, Size);
}
// Always zexting here would be wrong if it weren't
OpenPOWER on IntegriCloud