class MemRegion

Declaration

class MemRegion : public Node { /* full declaration omitted */ };

Description

MemRegion - The root abstract class for all memory regions.

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:95

Inherits from: FoldingSetBase::Node

Member Variables

private const clang::ento::MemRegion::Kind kind
private Optional<clang::ento::RegionOffset> cachedOffset

Method Overview

Inherited from FoldingSetBase::Node:

Methods

MemRegion(clang::ento::MemRegion::Kind k)

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:108

Parameters

clang::ento::MemRegion::Kind k

virtual void Profile(
    llvm::FoldingSetNodeID& ID) const

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:114

Parameters

llvm::FoldingSetNodeID& ID

const clang::ento::MemRegion* StripCasts(
    bool StripBaseAndDerivedCasts = true) const

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:132

Parameters

bool StripBaseAndDerivedCasts = true

virtual bool canPrintPretty() const

Description

Returns true if this region can be printed in a user-friendly way.

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:158

virtual bool canPrintPrettyAsExpr() const

Description

Returns true if this region's textual representation can be used as part of a larger expression.

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:165

template <typename RegionTy>
const RegionTy* castAs() const

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:177

Templates

RegionTy

void dump() const

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:155

virtual void dumpToStream(
    llvm::raw_ostream& os) const

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:153

Parameters

llvm::raw_ostream& os

template <typename RegionTy>
const RegionTy* getAs() const

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:175

Templates

RegionTy

clang::ento::RegionOffset getAsOffset() const

Description

Compute the offset within the top level memory object.

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:148

const clang::ento::MemRegion* getBaseRegion()
    const

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:120

clang::ASTContext& getContext() const

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:112

std::string getDescriptiveName(
    bool UseQuotes = true) const

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:189

Parameters

bool UseQuotes = true
Set if the name should be quoted.

Returns

variable name for memory region

clang::ento::MemRegion::Kind getKind() const

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:173

virtual clang::ento::MemRegionManager&
getMemRegionManager() const

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:116

const clang::ento::MemSpaceRegion*
getMemorySpace() const

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:118

const clang::ento::MemRegion*
getMostDerivedObjectRegion() const

Description

Recursively retrieve the region of the most derived class instance of regions of C++ base class instances.

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:125

std::string getString() const

Description

Get a string representation of a region for debug use.

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:151

const clang::ento::SymbolicRegion*
getSymbolicBase() const

Description

If this is a symbolic region, returns the region. Otherwise, goes up the base chain looking for the first symbolic base region. It might return null.

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:137

bool hasGlobalsOrParametersStorage() const

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:139

bool hasStackNonParametersStorage() const

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:143

bool hasStackParametersStorage() const

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:145

bool hasStackStorage() const

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:141

virtual bool isBoundable() const

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:179

virtual bool isSubRegionOf(
    const clang::ento::MemRegion* R) const

Description

Check if the region is a subregion of the given region. Each region is a subregion of itself.

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:129

Parameters

const clang::ento::MemRegion* R

virtual void printPretty(
    llvm::raw_ostream& os) const

Description

Print the region for use in diagnostics.

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:161

Parameters

llvm::raw_ostream& os

virtual void printPrettyAsExpr(
    llvm::raw_ostream& os) const

Description

Print the region as expression. When this region represents a subexpression, the method is for printing an expression containing it.

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:171

Parameters

llvm::raw_ostream& os

clang::SourceRange sourceRange() const

Description

Retrieve source range from memory region. The range retrieval is based on the decl obtained from the memory region. For a VarRegion the range of the base region is returned. For a FieldRegion the range of the field is returned. If no declaration is found, an empty source range is returned. The client is responsible for checking if the returned range is valid.

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:199

Returns

source range for declaration retrieved from memory region

virtual ~MemRegion()

Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:109