summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Expr.cpp
diff options
context:
space:
mode:
authorAndrew Kaylor <andrew.kaylor@intel.com>2017-09-20 18:06:44 +0000
committerAndrew Kaylor <andrew.kaylor@intel.com>2017-09-20 18:06:44 +0000
commitb9be53634c872979cad369808313b0aad143fed9 (patch)
tree0add4349ff10c8d68807053a6c43ff5258fae06b /clang/lib/AST/Expr.cpp
parent249dc1497964696944f343353daf31d5e4a9ddec (diff)
downloadbcm5719-llvm-b9be53634c872979cad369808313b0aad143fed9.tar.gz
bcm5719-llvm-b9be53634c872979cad369808313b0aad143fed9.zip
Remove offset size check in nullptr arithmetic handling
Differential Revision: https://reviews.llvm.org/D37042 llvm-svn: 313784
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
-rw-r--r--clang/lib/AST/Expr.cpp7
1 files changed, 0 insertions, 7 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index f04a78f609a..aab89d392dc 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -1837,17 +1837,14 @@ bool BinaryOperator::isNullPointerArithmeticExtension(ASTContext &Ctx,
// Check that we have one pointer and one integer operand.
Expr *PExp;
- Expr *IExp;
if (LHS->getType()->isPointerType()) {
if (!RHS->getType()->isIntegerType())
return false;
PExp = LHS;
- IExp = RHS;
} else if (RHS->getType()->isPointerType()) {
if (!LHS->getType()->isIntegerType())
return false;
PExp = RHS;
- IExp = LHS;
} else {
return false;
}
@@ -1862,10 +1859,6 @@ bool BinaryOperator::isNullPointerArithmeticExtension(ASTContext &Ctx,
if (!PTy || !PTy->getPointeeType()->isCharType())
return false;
- // Check that the integer type is pointer-sized.
- if (Ctx.getTypeSize(IExp->getType()) != Ctx.getTypeSize(PExp->getType()))
- return false;
-
return true;
}
InitListExpr::InitListExpr(const ASTContext &C, SourceLocation lbraceloc,
OpenPOWER on IntegriCloud