#include "clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SValVisitor.h"
#include <optional>
usingnamespaceclang;
usingnamespaceento;
namespace {
class SimpleSValBuilder : public SValBuilder { … };
}
SValBuilder *ento::createSimpleSValBuilder(llvm::BumpPtrAllocator &alloc,
ASTContext &context,
ProgramStateManager &stateMgr) { … }
static bool isNegationValuePreserving(const llvm::APSInt &Value,
APSIntType ResultType) { … }
SVal SimpleSValBuilder::MakeSymIntVal(const SymExpr *LHS,
BinaryOperator::Opcode op,
const llvm::APSInt &RHS,
QualType resultTy) { … }
static bool isInRelation(BinaryOperator::Opcode Rel, SymbolRef Sym,
llvm::APSInt Bound, ProgramStateRef State) { … }
static bool isWithinConstantOverflowBounds(SymbolRef Sym,
ProgramStateRef State) { … }
static bool isWithinConstantOverflowBounds(llvm::APSInt I) { … }
static std::pair<SymbolRef, llvm::APSInt>
decomposeSymbol(SymbolRef Sym, BasicValueFactory &BV) { … }
static NonLoc doRearrangeUnchecked(ProgramStateRef State,
BinaryOperator::Opcode Op,
SymbolRef LSym, llvm::APSInt LInt,
SymbolRef RSym, llvm::APSInt RInt) { … }
static bool shouldRearrange(ProgramStateRef State, BinaryOperator::Opcode Op,
SymbolRef Sym, llvm::APSInt Int, QualType Ty) { … }
static std::optional<NonLoc> tryRearrange(ProgramStateRef State,
BinaryOperator::Opcode Op, NonLoc Lhs,
NonLoc Rhs, QualType ResultTy) { … }
SVal SimpleSValBuilder::evalBinOpNN(ProgramStateRef state,
BinaryOperator::Opcode op,
NonLoc lhs, NonLoc rhs,
QualType resultTy) { … }
static SVal evalBinOpFieldRegionFieldRegion(const FieldRegion *LeftFR,
const FieldRegion *RightFR,
BinaryOperator::Opcode op,
QualType resultTy,
SimpleSValBuilder &SVB) { … }
static void assertEqualBitWidths(ProgramStateRef State, Loc RhsLoc,
Loc LhsLoc) { … }
SVal SimpleSValBuilder::evalBinOpLL(ProgramStateRef state,
BinaryOperator::Opcode op,
Loc lhs, Loc rhs,
QualType resultTy) { … }
SVal SimpleSValBuilder::evalBinOpLN(ProgramStateRef state,
BinaryOperator::Opcode op, Loc lhs,
NonLoc rhs, QualType resultTy) { … }
const llvm::APSInt *SimpleSValBuilder::getConstValue(ProgramStateRef state,
SVal V) { … }
const llvm::APSInt *SimpleSValBuilder::getConcreteValue(SVal V) { … }
const llvm::APSInt *SimpleSValBuilder::getKnownValue(ProgramStateRef state,
SVal V) { … }
const llvm::APSInt *SimpleSValBuilder::getMinValue(ProgramStateRef state,
SVal V) { … }
const llvm::APSInt *SimpleSValBuilder::getMaxValue(ProgramStateRef state,
SVal V) { … }
SVal SimpleSValBuilder::simplifyUntilFixpoint(ProgramStateRef State, SVal Val) { … }
SVal SimpleSValBuilder::simplifySVal(ProgramStateRef State, SVal V) { … }
SVal SimpleSValBuilder::simplifySValOnce(ProgramStateRef State, SVal V) { … }