llvm/clang/lib/StaticAnalyzer/Core/ProgramState.cpp

//= ProgramState.cpp - Path-Sensitive "State" for tracking values --*- C++ -*--=
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
//  This file implements ProgramState and ProgramStateManager.
//
//===----------------------------------------------------------------------===//

#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
#include "clang/Analysis/CFG.h"
#include "clang/Basic/JsonSupport.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/DynamicType.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h"
#include "llvm/Support/raw_ostream.h"
#include <optional>

usingnamespaceclang;
usingnamespaceento;

namespace clang { namespace  ento {
/// Increments the number of times this state is referenced.

void ProgramStateRetain(const ProgramState *state) {}

/// Decrement the number of times this state is referenced.
void ProgramStateRelease(const ProgramState *state) {}
}}

ProgramState::ProgramState(ProgramStateManager *mgr, const Environment& env,
                 StoreRef st, GenericDataMap gdm)
  :{}

ProgramState::ProgramState(const ProgramState &RHS)
    :{}

ProgramState::~ProgramState() {}

int64_t ProgramState::getID() const {}

ProgramStateManager::ProgramStateManager(ASTContext &Ctx,
                                         StoreManagerCreator CreateSMgr,
                                         ConstraintManagerCreator CreateCMgr,
                                         llvm::BumpPtrAllocator &alloc,
                                         ExprEngine *ExprEng)
  :{}


ProgramStateManager::~ProgramStateManager() {}

ProgramStateRef ProgramStateManager::removeDeadBindingsFromEnvironmentAndStore(
    ProgramStateRef state, const StackFrameContext *LCtx,
    SymbolReaper &SymReaper) {}

ProgramStateRef ProgramState::bindLoc(Loc LV,
                                      SVal V,
                                      const LocationContext *LCtx,
                                      bool notifyChanges) const {}

ProgramStateRef
ProgramState::bindDefaultInitial(SVal loc, SVal V,
                                 const LocationContext *LCtx) const {}

ProgramStateRef
ProgramState::bindDefaultZero(SVal loc, const LocationContext *LCtx) const {}

RegionList;
ValueList;

ProgramStateRef
ProgramState::invalidateRegions(RegionList Regions,
                             const Expr *E, unsigned Count,
                             const LocationContext *LCtx,
                             bool CausedByPointerEscape,
                             InvalidatedSymbols *IS,
                             const CallEvent *Call,
                             RegionAndSymbolInvalidationTraits *ITraits) const {}

ProgramStateRef
ProgramState::invalidateRegions(ValueList Values,
                             const Expr *E, unsigned Count,
                             const LocationContext *LCtx,
                             bool CausedByPointerEscape,
                             InvalidatedSymbols *IS,
                             const CallEvent *Call,
                             RegionAndSymbolInvalidationTraits *ITraits) const {}

ProgramStateRef ProgramState::killBinding(Loc LV) const {}

/// SymbolicRegions are expected to be wrapped by an ElementRegion as a
/// canonical representation. As a canonical representation, SymbolicRegions
/// should be wrapped by ElementRegions before getting a FieldRegion.
/// See f8643a9b31c4029942f67d4534c9139b45173504 why.
SVal ProgramState::wrapSymbolicRegion(SVal Val) const {}

ProgramStateRef
ProgramState::enterStackFrame(const CallEvent &Call,
                              const StackFrameContext *CalleeCtx) const {}

SVal ProgramState::getSelfSVal(const LocationContext *LCtx) const {}

SVal ProgramState::getSValAsScalarOrLoc(const MemRegion *R) const {}

SVal ProgramState::getSVal(Loc location, QualType T) const {}

ProgramStateRef ProgramState::BindExpr(const Stmt *S,
                                           const LocationContext *LCtx,
                                           SVal V, bool Invalidate) const{}

[[nodiscard]] std::pair<ProgramStateRef, ProgramStateRef>
ProgramState::assumeInBoundDual(DefinedOrUnknownSVal Idx,
                                DefinedOrUnknownSVal UpperBound,
                                QualType indexTy) const {}

ProgramStateRef ProgramState::assumeInBound(DefinedOrUnknownSVal Idx,
                                            DefinedOrUnknownSVal UpperBound,
                                            bool Assumption,
                                            QualType indexTy) const {}

ConditionTruthVal ProgramState::isNonNull(SVal V) const {}

ConditionTruthVal ProgramState::areEqual(SVal Lhs, SVal Rhs) const {}

ConditionTruthVal ProgramState::isNull(SVal V) const {}

ProgramStateRef ProgramStateManager::getInitialState(const LocationContext *InitLoc) {}

ProgramStateRef ProgramStateManager::getPersistentStateWithGDM(
                                                     ProgramStateRef FromState,
                                                     ProgramStateRef GDMState) {}

ProgramStateRef ProgramStateManager::getPersistentState(ProgramState &State) {}

ProgramStateRef ProgramState::makeWithStore(const StoreRef &store) const {}

ProgramStateRef ProgramState::cloneAsPosteriorlyOverconstrained() const {}

void ProgramState::setStore(const StoreRef &newStore) {}

SVal ProgramState::getLValue(const FieldDecl *D, SVal Base) const {}

SVal ProgramState::getLValue(const IndirectFieldDecl *D, SVal Base) const {}

//===----------------------------------------------------------------------===//
//  State pretty-printing.
//===----------------------------------------------------------------------===//

void ProgramState::printJson(raw_ostream &Out, const LocationContext *LCtx,
                             const char *NL, unsigned int Space,
                             bool IsDot) const {}

void ProgramState::printDOT(raw_ostream &Out, const LocationContext *LCtx,
                            unsigned int Space) const {}

LLVM_DUMP_METHOD void ProgramState::dump() const {}

AnalysisManager& ProgramState::getAnalysisManager() const {}

//===----------------------------------------------------------------------===//
// Generic Data Map.
//===----------------------------------------------------------------------===//

void *const* ProgramState::FindGDM(void *K) const {}

void*
ProgramStateManager::FindGDMContext(void *K,
                               void *(*CreateContext)(llvm::BumpPtrAllocator&),
                               void (*DeleteContext)(void*)) {}

ProgramStateRef ProgramStateManager::addGDM(ProgramStateRef St, void *Key, void *Data){}

ProgramStateRef ProgramStateManager::removeGDM(ProgramStateRef state, void *Key) {}

bool ScanReachableSymbols::scan(nonloc::LazyCompoundVal val) {}

bool ScanReachableSymbols::scan(nonloc::CompoundVal val) {}

bool ScanReachableSymbols::scan(const SymExpr *sym) {}

bool ScanReachableSymbols::scan(SVal val) {}

bool ScanReachableSymbols::scan(const MemRegion *R) {}

bool ProgramState::scanReachableSymbols(SVal val, SymbolVisitor& visitor) const {}

bool ProgramState::scanReachableSymbols(
    llvm::iterator_range<region_iterator> Reachable,
    SymbolVisitor &visitor) const {}