summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorFilipe Cabecinhas <me@filcab.net>2015-08-11 04:19:28 +0000
committerFilipe Cabecinhas <me@filcab.net>2015-08-11 04:19:28 +0000
commit7af183d841fc1c81e6c01d469a7b24da42425606 (patch)
tree2cacf46a3d40e770277702b7fe5932ec89bc242d /clang/lib/CodeGen/CGExpr.cpp
parent7317de6c15751b6a4d963021a5b4410c7c877981 (diff)
downloadbcm5719-llvm-7af183d841fc1c81e6c01d469a7b24da42425606.tar.gz
bcm5719-llvm-7af183d841fc1c81e6c01d469a7b24da42425606.zip
Propagate SourceLocations through to get a Loc on float_cast_overflow
Summary: float_cast_overflow is the only UBSan check without a source location attached. This patch propagates SourceLocations where necessary to get them to the EmitCheck() call. Reviewers: rsmith, ABataev, rjmccall Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11757 llvm-svn: 244568
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 0ee144cb68d..a0d004d315c 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -96,10 +96,12 @@ llvm::Value *CodeGenFunction::EvaluateExprAsBool(const Expr *E) {
}
QualType BoolTy = getContext().BoolTy;
+ SourceLocation Loc = E->getExprLoc();
if (!E->getType()->isAnyComplexType())
- return EmitScalarConversion(EmitScalarExpr(E), E->getType(), BoolTy);
+ return EmitScalarConversion(EmitScalarExpr(E), E->getType(), BoolTy, Loc);
- return EmitComplexToScalarConversion(EmitComplexExpr(E), E->getType(),BoolTy);
+ return EmitComplexToScalarConversion(EmitComplexExpr(E), E->getType(), BoolTy,
+ Loc);
}
/// EmitIgnoredExpr - Emit code to compute the specified expression,
OpenPOWER on IntegriCloud