aboutsummaryrefslogtreecommitdiff
path: root/lib/Checker
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Checker')
-rw-r--r--lib/Checker/CheckerHelpers.cpp5
-rw-r--r--lib/Checker/GRExprEngine.cpp16
-rw-r--r--lib/Checker/IdempotentOperationChecker.cpp3
3 files changed, 1 insertions, 23 deletions
diff --git a/lib/Checker/CheckerHelpers.cpp b/lib/Checker/CheckerHelpers.cpp
index e3cb36b00c..ece69435ca 100644
--- a/lib/Checker/CheckerHelpers.cpp
+++ b/lib/Checker/CheckerHelpers.cpp
@@ -67,11 +67,6 @@ bool clang::containsStaticLocal(const Stmt *S) {
// Recursively find any substatements containing __builtin_offsetof
bool clang::containsBuiltinOffsetOf(const Stmt *S) {
- const UnaryOperator *UO = dyn_cast<UnaryOperator>(S);
-
- if (UO && UO->getOpcode() == UnaryOperator::OffsetOf)
- return true;
-
if (isa<OffsetOfExpr>(S))
return true;
diff --git a/lib/Checker/GRExprEngine.cpp b/lib/Checker/GRExprEngine.cpp
index 1f6c266e3a..98d2bf1b08 100644
--- a/lib/Checker/GRExprEngine.cpp
+++ b/lib/Checker/GRExprEngine.cpp
@@ -2910,22 +2910,6 @@ void GRExprEngine::VisitUnaryOperator(const UnaryOperator* U,
return;
}
-
- case UnaryOperator::OffsetOf: {
- Expr::EvalResult Res;
- if (U->Evaluate(Res, getContext()) && Res.Val.isInt()) {
- const APSInt &IV = Res.Val.getInt();
- assert(IV.getBitWidth() == getContext().getTypeSize(U->getType()));
- assert(U->getType()->isIntegerType());
- assert(IV.isSigned() == U->getType()->isSignedIntegerType());
- SVal X = ValMgr.makeIntVal(IV);
- MakeNode(Dst, U, Pred, GetState(Pred)->BindExpr(U, X));
- return;
- }
- // FIXME: Handle the case where __builtin_offsetof is not a constant.
- Dst.Add(Pred);
- return;
- }
case UnaryOperator::Plus: assert(!asLValue); // FALL-THROUGH.
case UnaryOperator::Extension: {
diff --git a/lib/Checker/IdempotentOperationChecker.cpp b/lib/Checker/IdempotentOperationChecker.cpp
index 9866c6096e..74f4a62ccc 100644
--- a/lib/Checker/IdempotentOperationChecker.cpp
+++ b/lib/Checker/IdempotentOperationChecker.cpp
@@ -540,10 +540,9 @@ bool IdempotentOperationChecker::CanVary(const Expr *Ex, ASTContext &Ctx) {
}
case Stmt::UnaryOperatorClass: {
const UnaryOperator *U = cast<const UnaryOperator>(Ex);
- // Handle two trivial cases first
+ // Handle trivial case first
switch (U->getOpcode()) {
case UnaryOperator::Extension:
- case UnaryOperator::OffsetOf:
return false;
default:
return CanVary(U->getSubExpr(), Ctx);