From 7a2d6dea73b594a42b83ed48bd19bd232c29f2b8 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Fri, 27 May 2022 10:07:06 +0200 Subject: [PATCH] [analyzer][NFC] Inline ExprEngine::evalComplement Reviewed By: martong Differential Revision: https://reviews.llvm.org/D126124 --- .../clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h | 4 ---- clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h index fe558fc21bc89..c79cd7716aa7f 100644 --- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h +++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h @@ -590,10 +590,6 @@ class ExprEngine { return X.isValid() ? svalBuilder.evalMinus(X.castAs()) : X; } - SVal evalComplement(SVal X) { - return X.isValid() ? svalBuilder.evalComplement(X.castAs()) : X; - } - ProgramStateRef handleLValueBitCast(ProgramStateRef state, const Expr *Ex, const LocationContext *LCtx, QualType T, QualType ExTy, const CastExpr *CastE, diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp index 21fd46e308f3f..470a56cfab479 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp @@ -1029,7 +1029,8 @@ void ExprEngine::VisitUnaryOperator(const UnaryOperator* U, ExplodedNode *Pred, llvm_unreachable("Invalid Opcode."); case UO_Not: // FIXME: Do we need to handle promotions? - state = state->BindExpr(U, LCtx, evalComplement(V.castAs())); + state = state->BindExpr( + U, LCtx, svalBuilder.evalComplement(V.castAs())); break; case UO_Minus: // FIXME: Do we need to handle promotions?