A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://clang.llvm.org/doxygen/SVals_8cpp_source.html below:

clang: lib/StaticAnalyzer/Core/SVals.cpp Source File

28#include "llvm/Support/Casting.h" 29#include "llvm/Support/Compiler.h" 30#include "llvm/Support/ErrorHandling.h" 31#include "llvm/Support/raw_ostream.h" 35using namespace clang

;

47 if

(std::optional<loc::MemRegionVal>

X

= getAs<loc::MemRegionVal>()) {

50 if

(

const auto

*FD = dyn_cast<FunctionDecl>(CTR->getDecl()))

54 if

(

auto X

= getAs<nonloc::PointerToMember>()) {

55 if

(

const auto

*MD = dyn_cast_or_null<CXXMethodDecl>(

X

->getDecl()))

73

: dyn_cast<SymbolicRegion>(R->StripCasts()))

74 return

SymR->getSymbol();

81

std::optional<loc::MemRegionVal>

X

= getAs<loc::MemRegionVal>();

88 while

(

const auto

*SR = dyn_cast<SubRegion>(R)) {

89 if

(

const auto

*SymR = dyn_cast<SymbolicRegion>(SR))

90 return

SymR->getSymbol();

92

R = SR->getSuperRegion();

106 if

(std::optional<nonloc::SymbolVal>

X

= getAs<nonloc::SymbolVal>())

107 return X

->getSymbol();

113 if

(

auto

CI = getAs<nonloc::ConcreteInt>())

114 return

CI->getValue().get();

115 if

(

auto

CI = getAs<loc::ConcreteInt>())

116 return

CI->getValue().get();

121 if

(std::optional<loc::MemRegionVal>

X

= getAs<loc::MemRegionVal>())

122 return X

->getRegion();

124 if

(std::optional<nonloc::LocAsInteger>

X

= getAs<nonloc::LocAsInteger>())

125 return X

->getLoc().getAsRegion();

131class

TypeRetrievingVisitor

137

TypeRetrievingVisitor(

const ASTContext

&Context) : Context(Context) {}

145 template

<

class

ConcreteInt>

QualType

VisitConcreteInt(ConcreteInt CI) {

146 const

llvm::APSInt &

Value

= CI.getValue();

147 if

(1 ==

Value

.getBitWidth())

153 if

(NestedType.

isNull

())

182

TypeRetrievingVisitor TRV{Context};

183 return

TRV.Visit(*

this

);

199 return

getPTMData().isNull();

203 const auto

PTMD = this->getPTMData();

208 if

(

const auto

*NDP = dyn_cast<const NamedDecl *>(PTMD))

211

ND = cast<const PointerToMemberData *>(PTMD)->getDeclaratorDecl();

221 return

getValue()->begin();

225 return

getValue()->end();

230 if

(isa<const NamedDecl *>(PTMD))

232 return

cast<const PointerToMemberData *>(PTMD)->begin();

237 if

(isa<const NamedDecl *>(PTMD))

239 return

cast<const PointerToMemberData *>(PTMD)->end();

247 return

getAs<nonloc::ConcreteInt>() || getAs<loc::ConcreteInt>();

251 if

(std::optional<loc::ConcreteInt> LV = getAs<loc::ConcreteInt>())

252 return

*LV->getValue().get() == I;

253 if

(std::optional<nonloc::ConcreteInt> NV = getAs<nonloc::ConcreteInt>())

254 return

*NV->getValue().get() == I;

259 return

isConstant(0);

268#define BASIC_SVAL(Id, Parent) \ 271#define LOC_SVAL(Id, Parent) \ 272 case Loc##Id##Kind: \ 274#define NONLOC_SVAL(Id, Parent) \ 275 case NonLoc##Id##Kind: \ 277#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.def" 280

llvm_unreachable(

"Unkown kind!"

);

283

LLVM_DUMP_METHOD

void SVal::dump

()

const

{ dumpToStream(llvm::errs()); }

287

llvm::raw_string_ostream TempOut(Buf);

289

dumpToStream(TempOut);

304

castAs<NonLoc>().dumpToStream(os);

308

castAs<Loc>().dumpToStream(os);

311

llvm_unreachable(

"Unhandled SVal kind!"

);

316 case

nonloc::ConcreteIntKind: {

318

os <<

Value

<<

' '

<< (

Value

->isSigned() ?

'S'

:

'U'

)

319

<<

Value

->getBitWidth() <<

'b'

;

322 case

nonloc::SymbolValKind:

323

os << castAs<nonloc::SymbolVal>().getSymbol();

326 case

nonloc::LocAsIntegerKind: {

328

os <<

C

.getLoc() <<

" [as "

<<

C

.getNumBits() <<

" bit integer]"

;

331 case

nonloc::CompoundValKind: {

333

os <<

"compoundVal{"

;

335 for

(

const auto

&I :

C

) {

337

os <<

' '

; first =

false

;

347 case

nonloc::LazyCompoundValKind: {

349

os <<

"lazyCompoundVal{"

<<

const_cast<void

*

>

(

C

.getStore())

350

<<

','

<<

C

.getRegion()

354 case

nonloc::PointerToMemberKind: {

355

os <<

"pointerToMember{"

;

357

castAs<nonloc::PointerToMember>();

361 for

(

const auto

&I : CastRes) {

363

os <<

' '

; first =

false

;

375

assert(

false

&&

"Pretty-printed not implemented for this NonLoc."

);

382 case

loc::ConcreteIntKind:

383

os << castAs<loc::ConcreteInt>().getValue()->getZExtValue() <<

" (Loc)"

;

385 case

loc::GotoLabelKind:

386

os <<

"&&"

<< castAs<loc::GotoLabel>().getLabel()->getName();

388 case

loc::MemRegionValKind:

389

os << '&' << castAs<loc::MemRegionVal>().getRegion()->getString();

392

llvm_unreachable(

"Pretty-printing not implemented for this Loc."

);

Defines the clang::ASTContext interface.

static const MemRegion * getRegion(const CallEvent &Call, const MutexDescriptor &Descriptor, bool IsLock)

static Decl::Kind getKind(const Decl *D)

Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....

Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.

C Language Family Type Representation.

Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...

QualType getIntTypeForBitwidth(unsigned DestWidth, unsigned Signed) const

getIntTypeForBitwidth - sets integer QualTy according to specified details: bitwidth,...

Represents a function declaration or definition.

This represents a decl that may have a name.

std::string getQualifiedNameAsString() const

A (possibly-)qualified type.

bool isNull() const

Return true if this QualType doesn't point to a type yet.

bool isSignedIntegerType() const

Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char,...

A safe wrapper around APSInt objects allocated and owned by BasicValueFactory.

AllocaRegion - A region that represents an untyped blob of bytes created by a call to 'alloca'.

FullSValVisitor - a convenient mixed visitor for all three: SVal, SymExpr and MemRegion subclasses.

FunctionCodeRegion - A region that represents code texts of function.

void dumpToStream(raw_ostream &Out) const

static bool classof(SVal V)

MemRegion - The root abstract class for all memory regions.

LLVM_ATTRIBUTE_RETURNS_NONNULL const MemRegion * StripCasts(bool StripBaseAndDerivedCasts=true) const

const SymbolicRegion * getSymbolicBase() const

If this is a symbolic region, returns the region.

const RegionTy * getAs() const

static bool classof(SVal V)

void dumpToStream(raw_ostream &Out) const

bool isZeroConstant() const

void dumpToStream(raw_ostream &OS) const

SymbolRef getAsSymbol(bool IncludeBaseRegions=false) const

If this SVal wraps a symbol return that SymbolRef.

const FunctionDecl * getAsFunctionDecl() const

getAsFunctionDecl - If this SVal is a MemRegionVal and wraps a CodeTextRegion wrapping a FunctionDecl...

void printJson(raw_ostream &Out, bool AddQuotes) const

printJson - Pretty-prints in JSON format.

StringRef getKindStr() const

QualType getType(const ASTContext &) const

Try to get a reasonable type for the given value.

const llvm::APSInt * getAsInteger() const

If this SVal is loc::ConcreteInt or nonloc::ConcreteInt, return a pointer to APSInt which is held in ...

SymbolRef getAsLocSymbol(bool IncludeBaseRegions=false) const

If this SVal is a location and wraps a symbol, return that SymbolRef.

const MemRegion * getAsRegion() const

SymbolRef getLocSymbolInBase() const

Get the symbol in the SVal or its base region.

virtual QualType getType() const =0

SymbolicRegion - A special, "non-concrete" region.

SymbolRef getSymbol() const

It might return null.

TypedRegion - An abstract class representing regions that are typed.

virtual QualType getLocationType() const =0

TypedValueRegion - An abstract class representing regions having a typed value.

virtual QualType getValueType() const =0

LLVM_ATTRIBUTE_RETURNS_NONNULL const MemRegion * stripCasts(bool StripBaseCasts=true) const

Get the underlining region and strip casts.

LLVM_ATTRIBUTE_RETURNS_NONNULL const MemRegion * getRegion() const

Get the underlining region.

The simplest example of a concrete compound value is nonloc::CompoundVal, which represents a concrete...

LLVM_ATTRIBUTE_RETURNS_NONNULL const CompoundValData * getValue() const

llvm::ImmutableList< SVal >::iterator iterator

While nonloc::CompoundVal covers a few simple use cases, nonloc::LazyCompoundVal is a more performant...

LLVM_ATTRIBUTE_RETURNS_NONNULL const TypedValueRegion * getRegion() const

This function itself is immaterial.

const void * getStore() const

It might return null.

unsigned getNumBits() const

Value representing pointer-to-member.

bool isNullMemberPointer() const

llvm::PointerUnion< const NamedDecl *, const PointerToMemberData * > PTMDataType

llvm::ImmutableList< const CXXBaseSpecifier * >::iterator iterator

const NamedDecl * getDecl() const

Represents symbolic expression that isn't a location.

LLVM_ATTRIBUTE_RETURNS_NONNULL SymbolRef getSymbol() const

The JSON file list parser is used to communicate input to InstallAPI.

std::string JsonFormat(StringRef RawSR, bool AddQuotes)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4