clang  11.0.0git
Public Types | Public Member Functions | List of all members
clang::ento::RangeSet Class Reference

RangeSet contains a set of ranges. More...

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

Public Types

typedef PrimRangeSet::Factory Factory
 
typedef PrimRangeSet::iterator iterator
 

Public Member Functions

 RangeSet (PrimRangeSet RS)
 
RangeSet addRange (Factory &F, const RangeSet &RS)
 Create a new set with all ranges of this set and RS. More...
 
iterator begin () const
 
iterator end () const
 
bool isEmpty () const
 
 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 contrained to equal a specific integer constant then this method returns that value. More...
 
const llvm::APSIntgetMinValue () const
 Get a minimal value covered by the ranges in the set. More...
 
const llvm::APSIntgetMaxValue () const
 Get a maximal value covered by the ranges in the set. More...
 
RangeSet Intersect (BasicValueFactory &BV, Factory &F, llvm::APSInt Lower, llvm::APSInt Upper) const
 
RangeSet Intersect (BasicValueFactory &BV, Factory &F, const RangeSet &Other) const
 
RangeSet Negate (BasicValueFactory &BV, Factory &F) const
 
void print (raw_ostream &os) const
 
bool operator== (const RangeSet &other) const
 

Detailed Description

RangeSet contains a set of ranges.

If the set is empty, then there the value of a symbol is overly constrained and there are no possible values for that symbol.

Definition at line 67 of file RangedConstraintManager.h.

Member Typedef Documentation

◆ Factory

typedef PrimRangeSet::Factory clang::ento::RangeSet::Factory

Definition at line 73 of file RangedConstraintManager.h.

◆ iterator

typedef PrimRangeSet::iterator clang::ento::RangeSet::iterator

Definition at line 74 of file RangedConstraintManager.h.

Constructor & Destructor Documentation

◆ RangeSet() [1/3]

clang::ento::RangeSet::RangeSet ( PrimRangeSet  RS)
inline

Definition at line 76 of file RangedConstraintManager.h.

◆ RangeSet() [2/3]

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

◆ RangeSet() [3/3]

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

Member Function Documentation

◆ addRange()

RangeSet clang::ento::RangeSet::addRange ( Factory F,
const RangeSet RS 
)
inline

Create a new set with all ranges of this set and RS.

Possible intersections are not checked here.

Definition at line 80 of file RangedConstraintManager.h.

References clang::transformer::range().

Referenced by clang::ento::CreateRangeConstraintManager().

◆ begin()

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

Definition at line 87 of file RangedConstraintManager.h.

Referenced by Intersect().

◆ end()

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

Definition at line 88 of file RangedConstraintManager.h.

Referenced by Intersect().

◆ getConcreteValue()

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

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

Otherwise, it returns NULL.

Definition at line 106 of file RangedConstraintManager.h.

References print().

Referenced by clang::ento::CreateRangeConstraintManager().

◆ getMaxValue()

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

◆ getMinValue()

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

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

Definition at line 143 of file RangeConstraintManager.cpp.

◆ Intersect() [1/2]

RangeSet RangeSet::Intersect ( BasicValueFactory BV,
Factory F,
llvm::APSInt  Lower,
llvm::APSInt  Upper 
) const

◆ Intersect() [2/2]

RangeSet RangeSet::Intersect ( BasicValueFactory BV,
Factory F,
const RangeSet Other 
) const

Definition at line 276 of file RangeConstraintManager.cpp.

References begin(), and end().

◆ isEmpty()

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

Definition at line 90 of file RangedConstraintManager.h.

Referenced by clang::ento::CreateRangeConstraintManager().

◆ Negate()

RangeSet RangeSet::Negate ( BasicValueFactory BV,
Factory F 
) const

◆ operator==()

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

Definition at line 132 of file RangedConstraintManager.h.

◆ print()

void RangeSet::print ( raw_ostream &  os) const

Definition at line 367 of file RangeConstraintManager.cpp.

References clang::ento::SymExpr::getType(), and State.

◆ Profile()

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


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