clang  14.0.0git
Classes | Macros | Functions
RangeConstraintManager.cpp File Reference
#include "clang/Basic/JsonSupport.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SValVisitor.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/ImmutableSet.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <iterator>
#include "clang/StaticAnalyzer/Core/PathSensitive/Symbols.def"
Include dependency graph for RangeConstraintManager.cpp:

Go to the source code of this file.

Classes

class  OperatorRelationsTable
 

Macros

#define DISPATCH(CLASS)   return assign##CLASS##Impl(cast<CLASS>(Sym), Constraint)
 
#define ASSIGN(CLASS, TO, SYM, CONSTRAINT)
 
#define SYMBOL(Id, Parent)
 
#define DEFAULT_ASSIGN(Id)
 
#define CONSTRAINT_DISPATCH(Id)
 
#define SYMBOL(Id, Parent)
 
#define ABSTRACT_SYMBOL(Id, Parent)   SYMBOL(Id, Parent)
 

Functions

static std::string toString (const SymbolRef &Sym)
 
static std::string toString (ProgramStateRef State, EquivalenceClass Class)
 

Macro Definition Documentation

◆ ABSTRACT_SYMBOL

#define ABSTRACT_SYMBOL (   Id,
  Parent 
)    SYMBOL(Id, Parent)

Definition at line 1465 of file RangeConstraintManager.cpp.

◆ ASSIGN

#define ASSIGN (   CLASS,
  TO,
  SYM,
  CONSTRAINT 
)
Value:
if (!static_cast<Derived *>(this)->assign##CLASS##To##TO(SYM, CONSTRAINT)) \
return false

Definition at line 1418 of file RangeConstraintManager.cpp.

◆ CONSTRAINT_DISPATCH

#define CONSTRAINT_DISPATCH (   Id)
Value:
if (const llvm::APSInt *Const = Constraint.getConcreteValue()) { \
ASSIGN(Id, Const, Sym, *Const); \
} \
if (Constraint.size() == 1) { \
ASSIGN(Id, Range, Sym, *Constraint.begin()); \
} \
ASSIGN(Id, RangeSet, Sym, Constraint)

Definition at line 1447 of file RangeConstraintManager.cpp.

◆ DEFAULT_ASSIGN

#define DEFAULT_ASSIGN (   Id)
Value:
bool assign##Id##To##RangeSet(const Id *Sym, RangeSet Constraint) { \
return true; \
} \
bool assign##Id##To##Range(const Id *Sym, Range Constraint) { return true; } \
bool assign##Id##To##Const(const Id *Sym, Const Constraint) { return true; }

Definition at line 1436 of file RangeConstraintManager.cpp.

◆ DISPATCH

#define DISPATCH (   CLASS)    return assign##CLASS##Impl(cast<CLASS>(Sym), Constraint)

Definition at line 1416 of file RangeConstraintManager.cpp.

◆ SYMBOL [1/2]

#define SYMBOL (   Id,
  Parent 
)
Value:
case SymExpr::Id##Kind: \
DISPATCH(Id);

Definition at line 1459 of file RangeConstraintManager.cpp.

◆ SYMBOL [2/2]

#define SYMBOL (   Id,
  Parent 
)
Value:
bool assign##Id##Impl(const Id *Sym, RangeSet Constraint) { \
CONSTRAINT_DISPATCH(Id); \
DISPATCH(Parent); \
} \
DEFAULT_ASSIGN(Id)

Definition at line 1459 of file RangeConstraintManager.cpp.

Function Documentation

◆ toString() [1/2]

static std::string toString ( const SymbolRef &  Sym)
static

Definition at line 2656 of file RangeConstraintManager.cpp.

References string().

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

◆ toString() [2/2]

static std::string toString ( ProgramStateRef  State,
EquivalenceClass  Class 
)
static

Definition at line 2709 of file RangeConstraintManager.cpp.

References State, string(), and toString().

APSInt
llvm::APSInt APSInt
Definition: ByteCodeEmitter.cpp:19
Id
int Id
Definition: ASTDiff.cpp:191
clang::interp::Const
bool Const(InterpState &S, CodePtr OpPC, const T &Arg)
Definition: Interp.h:296
clang::transformer::EditKind::Range
@ Range
clang::ObjCPropertyAttribute::Kind
Kind
Definition: DeclObjCCommon.h:22
Parent
NodeId Parent
Definition: ASTDiff.cpp:192