#include #include #include "clang/StaticAnalyzer/Core/PathSensitive/Symbols.def"">

clang: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp File Reference (original) (raw)

#include "[clang/Basic/JsonSupport.h](JsonSupport%5F8h%5Fsource.html)"
#include "[clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h](APSIntType%5F8h%5Fsource.html)"
#include "[clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h](ProgramState%5F8h%5Fsource.html)"
#include "[clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h](ProgramStateTrait%5F8h%5Fsource.html)"
#include "[clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h](RangedConstraintManager%5F8h%5Fsource.html)"
#include "[clang/StaticAnalyzer/Core/PathSensitive/SValVisitor.h](SValVisitor%5F8h%5Fsource.html)"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/ImmutableSet.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <iterator>
#include <optional>
#include "clang/StaticAnalyzer/Core/PathSensitive/Symbols.def"

Go to the source code of this file.

Macros
#define DISPATCH(CLASS) return assign##CLASS##Impl(cast(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
template
static void swapIterators (T &First, T &FirstEnd, T &Second, T &SecondEnd)
static ProgramStateRef reAssume (ProgramStateRef State, const RangeSet *Constraint, SVal TheValue)
static std::string toString (const SymbolRef &Sym)
static std::string toString (ProgramStateRef State, EquivalenceClass Class)

ABSTRACT_SYMBOL

ASSIGN

| #define ASSIGN | ( | | CLASS, | | -------------- | - | | ------ | | | TO, | | | | | | SYM, | | | | | | CONSTRAINT | | | | | ) | | | |

Value:

if (!static_cast<Derived *>(this)->assign##CLASS##To##TO(SYM, CONSTRAINT)) \

return false

Definition at line 2004 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()); \

} \

persistent set of non-overlapping ranges.

A Range represents the closed range [from, to].

Definition at line 2033 of file RangeConstraintManager.cpp.

DEFAULT_ASSIGN

| #define DEFAULT_ASSIGN | ( | | Id | ) | | ----------------------- | - | | ----------------------------------------------------------- | - |

Value:

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; }

bool Const(InterpState &S, CodePtr OpPC, const T &Arg)

Definition at line 2022 of file RangeConstraintManager.cpp.

DISPATCH

| #define DISPATCH | ( | | CLASS | ) | return assign##CLASS##Impl(cast(Sym), Constraint) | | ---------------- | - | | ----- | - | --------------------------------------------------------------------------------------------------------------------- |

SYMBOL [1/2]

SYMBOL [2/2]

reAssume()

swapIterators()

template

static void swapIterators ( T & First, T & FirstEnd, T & Second, T & SecondEnd ) static

toString() [1/2]

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

toString() [2/2]

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