clang 20.0.0git
Namespaces | Typedefs | Functions
RegionStore.cpp File Reference
#include "clang/AST/Attr.h"
#include "clang/AST/CharUnits.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Analysis/Analyses/LiveVariables.h"
#include "clang/Analysis/AnalysisDeclContext.h"
#include "clang/Basic/JsonSupport.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h"
#include "llvm/ADT/ImmutableMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <optional>
#include <utility>

Go to the source code of this file.

Namespaces

namespace  llvm
 Diagnostic wrappers for TextAPI types for error reporting.
 

Typedefs

typedef llvm::ImmutableMap< BindingKey, SValClusterBindings
 
typedef llvm::ImmutableMapRef< BindingKey, SValClusterBindingsRef
 
typedef std::pair< BindingKey, SValBindingPair
 
typedef llvm::ImmutableMap< const MemRegion *, ClusterBindingsRegionBindings
 
typedef const RegionBindingsRef & RegionBindingsConstRef
 
typedef SmallVector< const FieldDecl *, 8 > FieldVector
 

Functions

static raw_ostream & llvm::operator<< (raw_ostream &Out, BindingKey K)
 
static bool isUnionField (const FieldRegion *FR)
 
static void getSymbolicOffsetFields (BindingKey K, FieldVector &Fields)
 
static bool isCompatibleWithFields (BindingKey K, const FieldVector &Fields)
 
static void collectSubRegionBindings (SmallVectorImpl< BindingPair > &Bindings, SValBuilder &SVB, const ClusterBindings &Cluster, const SubRegion *Top, BindingKey TopKey, bool IncludeAllDefaultBindings)
 Collects all bindings in Cluster that may refer to bindings within Top.
 
static void collectSubRegionBindings (SmallVectorImpl< BindingPair > &Bindings, SValBuilder &SVB, const ClusterBindings &Cluster, const SubRegion *Top, bool IncludeAllDefaultBindings)
 
static QualType getUnderlyingType (const SubRegion *R)
 
static std::optional< nonloc::LazyCompoundValgetExistingLazyBinding (SValBuilder &SVB, RegionBindingsConstRef B, const SubRegion *R, bool AllowSubregionBindings)
 Checks to see if store B has a lazy binding for region R.
 
static SmallVector< uint64_t, 2 > getConstantArrayExtents (const ConstantArrayType *CAT)
 This is a helper function for getConstantValFromConstArrayInitializer.
 
static std::pair< SmallVector< SVal, 2 >, const MemRegion * > getElementRegionOffsetsWithBase (const ElementRegion *ER)
 This is a helper function for getConstantValFromConstArrayInitializer.
 
static std::optional< SValconvertOffsetsFromSvalToUnsigneds (const SmallVector< SVal, 2 > &SrcOffsets, const SmallVector< uint64_t, 2 > ArrayExtents, SmallVector< uint64_t, 2 > &DstOffsets)
 
static std::optional< SValgetDerivedSymbolForBinding (RegionBindingsConstRef B, const TypedValueRegion *BaseRegion, const TypedValueRegion *SubReg, const ASTContext &Ctx, SValBuilder &SVB)
 

Typedef Documentation

◆ BindingPair

typedef std::pair<BindingKey, SVal> BindingPair

◆ ClusterBindings

typedef llvm::ImmutableMap<BindingKey, SVal> ClusterBindings

◆ ClusterBindingsRef

typedef llvm::ImmutableMapRef<BindingKey, SVal> ClusterBindingsRef

◆ FieldVector

typedef SmallVector<const FieldDecl *, 8> FieldVector

◆ RegionBindings

typedef llvm::ImmutableMap<const MemRegion *, ClusterBindings> RegionBindings

◆ RegionBindingsConstRef

typedef const RegionBindingsRef& RegionBindingsConstRef

Function Documentation

◆ collectSubRegionBindings() [1/2]

static void collectSubRegionBindings ( SmallVectorImpl< BindingPair > &  Bindings,
SValBuilder SVB,
const ClusterBindings Cluster,
const SubRegion Top,
BindingKey  TopKey,
bool  IncludeAllDefaultBindings 
)
static

Collects all bindings in Cluster that may refer to bindings within Top.

Each binding is a pair whose first is the key (a BindingKey) and whose second is the value (an SVal).

The IncludeAllDefaultBindings parameter specifies whether to include default bindings that may extend beyond Top itself, e.g. if Top is an aggregate within a larger aggregate with a default binding.

Examples
/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/StaticAnalyzer/Core/RegionStore.cpp.

Definition at line 912 of file RegionStore.cpp.

References clang::ento::SVal::getAs(), clang::ASTContext::getCharWidth(), clang::ento::SValBuilder::getContext(), clang::ento::SubRegion::getMemRegionManager(), clang::ento::MemRegionManager::getStaticSize(), getSymbolicOffsetFields(), isCompatibleWithFields(), and clang::ento::SubRegion::isSubRegionOf().

Referenced by