clang 20.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
clang::ento::RangeSet Class Reference

persistent set of non-overlapping ranges. More...

#include "clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h"

Classes

class  Factory
 

Public Types

using const_iterator = ImplType::const_iterator
 

Public Member Functions

const_iterator begin () const
 
const_iterator end () const
 
size_t size () const
 
bool isEmpty () const
 
 RangeSet (const RangeSet &)=default
 
RangeSetoperator= (const RangeSet &)=default
 
 RangeSet (RangeSet &&)=default
 
RangeSetoperator= (RangeSet &&)=default
 
 ~RangeSet ()=default
 
 RangeSet (Factory &F, const llvm::APSInt &From, const llvm::APSInt &To)
 Construct a new RangeSet representing '{ [From, To] }'.
 
 RangeSet (Factory &F, const llvm::APSInt &Point)
 Construct a new RangeSet representing the given point as a range.
 
void Profile (llvm::FoldingSetNodeID &ID) const
 Profile - Generates a hash profile of this RangeSet for use by FoldingSet.
 
const llvm::APSInt * getConcreteValue () const
 getConcreteValue - If a symbol is constrained to equal a specific integer constant then this method returns that value.
 
const llvm::APSInt & getMinValue () const
 Get the minimal value covered by the ranges in the set.
 
const llvm::APSInt & getMaxValue () const
 Get the maximal value covered by the ranges in the set.
 
bool isUnsigned () const
 
uint32_t getBitWidth () const
 
APSIntType getAPSIntType () const
 
bool contains (llvm::APSInt Point) const
 Test whether the given point is contained by any of the ranges.
 
bool containsZero () const
 
bool encodesFalseRange () const
 Test if the range is the [0,0] range.
 
bool encodesTrueRange () const
 Test if the range doesn't contain zero.
 
void dump (raw_ostream &OS) const
 
void dump () const
 
bool operator== (const RangeSet &Other) const
 
bool operator!= (const RangeSet &Other) const
 

Static Public Member Functions

static void Profile (llvm::FoldingSetNodeID &ID, const RangeSet &RS)
 

Friends

class Factory
 

Detailed Description

persistent set of non-overlapping ranges.

New RangeSet objects can be ONLY produced by RangeSet::Factory object, which also supports the most common operations performed on range sets.

Empty set corresponds to an overly constrained symbol meaning that there are no possible values for that symbol.

Definition at line 71 of file RangedConstraintManager.h.

Member Typedef Documentation

◆ const_iterator

using clang::ento::RangeSet::const_iterator = ImplType::const_iterator

Definition at line 113 of file RangedConstraintManager.h.

Constructor & Destructor Documentation

◆ RangeSet() [1/4]

clang::ento::RangeSet::RangeSet ( const RangeSet )
default

◆ RangeSet() [2/4]

clang::ento::RangeSet::RangeSet ( RangeSet &&  )
default

◆ ~RangeSet()

clang::ento::RangeSet::~RangeSet ( )
default

◆ RangeSet() [3/4]

clang::ento::RangeSet::RangeSet ( Factory F,
const llvm::APSInt &  From,
const llvm::APSInt &  To 
)
inline

Construct a new RangeSet representing '{ [From, To] }'.

Definition at line 314 of file RangedConstraintManager.h.

◆ RangeSet() [4/4]

clang::ento::RangeSet::RangeSet ( Factory F,
const llvm::APSInt &  Point 
)
inline

Construct a new RangeSet representing the given point as a range.

Definition at line 318 of file RangedConstraintManager.h.

Member Function Documentation

◆ begin()

const_iterator clang::ento::RangeSet::begin ( ) const
inline

◆ contains()

bool clang::ento::RangeSet::contains ( llvm::APSInt  Point) const
inline

Test whether the given point is contained by any of the ranges.

Complexity: O(logN) where N = size(this)

Definition at line 353 of file RangedConstraintManager.h.

Referenced by containsZero(), and clang::ento::RangeSet::Factory::deletePoint().

◆ containsZero()

bool clang::ento::RangeSet::containsZero ( ) const
inline

Definition at line 355 of file RangedConstraintManager.h.

References contains(), getMinValue(), and clang::T.

Referenced by encodesTrueRange().

◆ dump() [1/2]

LLVM_DUMP_METHOD void RangeSet::dump ( ) const

Definition at line 874 of file RangeConstraintManager.cpp.

References dump().

Referenced by clang::ento::Range::dump(), and dump().

◆ dump() [2/2]

LLVM_DUMP_METHOD void RangeSet::dump ( raw_ostream &  OS) const

Definition at line 869 of file RangeConstraintManager.cpp.

References clang::ento::Range::dump(), and clang::ento::OS.

◆ encodesFalseRange()

bool clang::ento::RangeSet::encodesFalseRange ( ) const
inline

Test if the range is the [0,0] range.

Complexity: O(1)

Definition at line 363 of file RangedConstraintManager.h.

References getConcreteValue().

Referenced by reAssume().

◆ encodesTrueRange()

bool clang::ento::RangeSet::encodesTrueRange ( ) const
inline

Test if the range doesn't contain zero.

Complexity: O(logN) where N = size(this)

Definition at line 372 of file RangedConstraintManager.h.

References containsZero().

Referenced by reAssume().

◆ end()

const_iterator clang::ento::RangeSet::end ( ) const
inline

◆ getAPSIntType()

APSIntType clang::ento::RangeSet::getAPSIntType ( ) const

Definition at line 367 of file RangeConstraintManager.cpp.

References begin(), and isEmpty().

Referenced by clang::ento::RangeSet::Factory::castTo().

◆ getBitWidth()

uint32_t clang::ento::RangeSet::getBitWidth ( ) const

Definition at line 362 of file RangeConstraintManager.cpp.

References begin(), and isEmpty().

Referenced by clang::ento::RangeSet::Factory::castTo().

◆ getConcreteValue()

const llvm::APSInt * clang::ento::RangeSet::getConcreteValue ( ) const
inline

getConcreteValue - If a symbol is constrained to equal a specific integer constant then this method returns that value.

Otherwise, it returns NULL.

Definition at line 332 of file RangedConstraintManager.h.

References begin().

Referenced by encodesFalseRange().

◆ getMaxValue()

const llvm::APSInt & RangeSet::getMaxValue ( ) const

Get the maximal value covered by the ranges in the set.

Complexity: O(1)

Definition at line 352 of file RangeConstraintManager.cpp.

References end(), and isEmpty().

Referenced by clang::ento::RangeSet::Factory::intersect(), and reAssume().

◆ getMinValue()

const llvm::APSInt & RangeSet::getMinValue ( ) const

Get the minimal value covered by the ranges in the set.

Complexity: O(1)

Definition at line 347 of file RangeConstraintManager.cpp.

References begin(), and isEmpty().

Referenced by containsZero(), clang::ento::RangeSet::Factory::intersect(), clang::ento::RangeSet::Factory::negate(), and reAssume().

◆ isEmpty()

bool clang::ento::RangeSet::isEmpty ( ) const
inline

◆ isUnsigned()

bool clang::ento::RangeSet::isUnsigned ( ) const

Definition at line 357 of file RangeConstraintManager.cpp.

References begin(), and isEmpty().

Referenced by clang::ento::RangeSet::Factory::castTo().

◆ operator!=()

bool clang::ento::RangeSet::operator!= ( const RangeSet Other) const
inline

Definition at line 378 of file RangedConstraintManager.h.

References clang::Other.

◆ operator=() [1/2]

RangeSet & clang::ento::RangeSet::operator= ( const RangeSet )
default

◆ operator=() [2/2]

RangeSet & clang::ento::RangeSet::operator= ( RangeSet &&  )
default

◆ operator==()

bool clang::ento::RangeSet::operator== ( const RangeSet Other) const
inline

Definition at line 377 of file RangedConstraintManager.h.

References clang::Other.

◆ Profile() [1/2]

void clang::ento::RangeSet::Profile ( llvm::FoldingSetNodeID &  ID) const
inline

Profile - Generates a hash profile of this RangeSet for use by FoldingSet.

Definition at line 327 of file RangedConstraintManager.h.

References ID, and Profile().

Referenced by Profile().

◆ Profile() [2/2]

static void clang::ento::RangeSet::Profile ( llvm::FoldingSetNodeID &  ID,
const RangeSet RS 
)
inlinestatic

Definition at line 321 of file RangedConstraintManager.h.

References ID.

◆ size()

size_t clang::ento::RangeSet::size ( ) const
inline

Friends And Related Function Documentation

◆ Factory

friend class Factory
friend

Definition at line 401 of file RangedConstraintManager.h.


The documentation for this class was generated from the following files: