diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h --- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h +++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h @@ -338,11 +338,6 @@ return *static_cast(Data); } - // Transfer functions for unary operations on ConcreteInts. - ConcreteInt evalComplement(SValBuilder &svalBuilder) const; - - ConcreteInt evalMinus(SValBuilder &svalBuilder) const; - static bool classof(SVal V) { return V.getBaseKind() == NonLocKind && V.getSubKind() == ConcreteIntKind; } diff --git a/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp b/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp --- a/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp +++ b/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp @@ -441,13 +441,13 @@ return UnknownVal(); } -SVal SValBuilder::evalMinus(NonLoc val) { - switch (val.getSubKind()) { +SVal SValBuilder::evalMinus(NonLoc X) { + switch (X.getSubKind()) { case nonloc::ConcreteIntKind: - return val.castAs().evalMinus(*this); + return makeIntVal(-X.castAs().getValue()); case nonloc::SymbolValKind: - return makeNonLoc(val.castAs().getSymbol(), UO_Minus, - val.getType(Context)); + return makeNonLoc(X.castAs().getSymbol(), UO_Minus, + X.getType(Context)); default: return UnknownVal(); } @@ -456,7 +456,7 @@ SVal SValBuilder::evalComplement(NonLoc X) { switch (X.getSubKind()) { case nonloc::ConcreteIntKind: - return X.castAs().evalComplement(*this); + return makeIntVal(~X.castAs().getValue()); case nonloc::SymbolValKind: return makeNonLoc(X.castAs().getSymbol(), UO_Not, X.getType(Context)); diff --git a/clang/lib/StaticAnalyzer/Core/SVals.cpp b/clang/lib/StaticAnalyzer/Core/SVals.cpp --- a/clang/lib/StaticAnalyzer/Core/SVals.cpp +++ b/clang/lib/StaticAnalyzer/Core/SVals.cpp @@ -252,20 +252,6 @@ return isConstant(0); } -//===----------------------------------------------------------------------===// -// Transfer function dispatch for Non-Locs. -//===----------------------------------------------------------------------===// - -nonloc::ConcreteInt -nonloc::ConcreteInt::evalComplement(SValBuilder &svalBuilder) const { - return svalBuilder.makeIntVal(~getValue()); -} - -nonloc::ConcreteInt -nonloc::ConcreteInt::evalMinus(SValBuilder &svalBuilder) const { - return svalBuilder.makeIntVal(-getValue()); -} - //===----------------------------------------------------------------------===// // Pretty-Printing. //===----------------------------------------------------------------------===//