clang  6.0.0svn
Functions
RangeConstraintManager.cpp File Reference
#include "RangedConstraintManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/ImmutableSet.h"
#include "llvm/Support/raw_ostream.h"
Include dependency graph for RangeConstraintManager.cpp:

Go to the source code of this file.

Functions

 REGISTER_TRAIT_WITH_PROGRAMSTATE (ConstraintRange, CLANG_ENTO_PROGRAMSTATE_MAP(SymbolRef, RangeSet)) namespace
 
static RangeSet assumeNonZero (BasicValueFactory &BV, RangeSet::Factory &F, SymbolRef Sym, RangeSet Domain)
 Return a range set subtracting zero from Domain. More...
 
static RangeSet applyBitwiseConstraints (BasicValueFactory &BV, RangeSet::Factory &F, RangeSet Input, const SymIntExpr *SIE)
 Apply implicit constraints for bitwise OR- and AND-. More...
 

Function Documentation

◆ applyBitwiseConstraints()

static RangeSet applyBitwiseConstraints ( BasicValueFactory BV,
RangeSet::Factory &  F,
RangeSet  Input,
const SymIntExpr SIE 
)
static

Apply implicit constraints for bitwise OR- and AND-.

For unsigned types, bitwise OR with a constant always returns a value greater-or-equal than the constant, and bitwise AND returns a value less-or-equal then the constant.

Pattern matches the expression Sym against those rule, and applies the required constraints. Input Previously established expression range set

Definition at line 482 of file RangeConstraintManager.cpp.

◆ assumeNonZero()

static RangeSet assumeNonZero ( BasicValueFactory BV,
RangeSet::Factory &  F,
SymbolRef  Sym,
RangeSet  Domain 
)
static

Return a range set subtracting zero from Domain.

Definition at line 464 of file RangeConstraintManager.cpp.

References clang::ento::BasicValueFactory::getAPSIntType(), clang::ento::SymExpr::getType(), and clang::ento::APSIntType::getZeroValue().

◆ REGISTER_TRAIT_WITH_PROGRAMSTATE()

REGISTER_TRAIT_WITH_PROGRAMSTATE ( ConstraintRange  ,
CLANG_ENTO_PROGRAMSTATE_MAP(SymbolRef, RangeSet)   
)

Definition at line 280 of file RangeConstraintManager.cpp.

References State, and X.