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

#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] }'. More...
 
 RangeSet (Factory &F, const llvm::APSInt &Point)
 Construct a new RangeSet representing the given point as a range. More...
 
void Profile (llvm::FoldingSetNodeID &ID) const
 Profile - Generates a hash profile of this RangeSet for use by FoldingSet. More...
 
const llvm::APSIntgetConcreteValue () const
 getConcreteValue - If a symbol is constrained to equal a specific integer constant then this method returns that value. More...
 
const llvm::APSIntgetMinValue () const
 Get the minimal value covered by the ranges in the set. More...
 
const llvm::APSIntgetMaxValue () const
 Get the maximal value covered by the ranges in the set. More...
 
bool contains (llvm::APSInt Point) const
 Test whether the given point is contained by any of the ranges. More...
 
bool containsZero () const
 
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 248 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 252 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 283 of file RangedConstraintManager.h.

Referenced by containsZero().

◆ containsZero()

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

Definition at line 285 of file RangedConstraintManager.h.

References contains(), and getMinValue().

◆ dump() [1/2]

LLVM_DUMP_METHOD void RangeSet::dump ( ) const

Definition at line 507 of file RangeConstraintManager.cpp.

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

◆ dump() [2/2]

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

Definition at line 502 of file RangeConstraintManager.cpp.

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

◆ end()

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

◆ 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 266 of file RangedConstraintManager.h.

References begin().

◆ getMaxValue()

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

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

Complexity: O(1)

Definition at line 170 of file RangeConstraintManager.cpp.

References end(), and isEmpty().

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

◆ getMinValue()

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

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

Complexity: O(1)

Definition at line 165 of file RangeConstraintManager.cpp.

References begin(), and isEmpty().

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

◆ isEmpty()

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

◆ operator!=()

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

Definition at line 294 of file RangedConstraintManager.h.

◆ 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 293 of file RangedConstraintManager.h.

◆ 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 261 of file RangedConstraintManager.h.

References Profile().

Referenced by Profile().

◆ Profile() [2/2]

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

Definition at line 255 of file RangedConstraintManager.h.

◆ size()

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

Friends And Related Function Documentation

◆ Factory

friend class Factory
friend

Definition at line 317 of file RangedConstraintManager.h.


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