#include "clang/StaticAnalyzer/Core/PathSensitive/DynamicType.h"
#include "clang/Basic/JsonSupport.h"
#include "clang/Basic/LLVM.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SymExpr.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
REGISTER_MAP_WITH_PROGRAMSTATE(…) …
REGISTER_SET_FACTORY_WITH_PROGRAMSTATE(…)
REGISTER_MAP_WITH_PROGRAMSTATE(…) …
REGISTER_MAP_WITH_PROGRAMSTATE(…) …
namespace clang {
namespace ento {
DynamicTypeInfo getDynamicTypeInfo(ProgramStateRef State, const MemRegion *MR) { … }
const DynamicTypeInfo *getRawDynamicTypeInfo(ProgramStateRef State,
const MemRegion *MR) { … }
static void unbox(QualType &Ty) { … }
const DynamicCastInfo *getDynamicCastInfo(ProgramStateRef State,
const MemRegion *MR,
QualType CastFromTy,
QualType CastToTy) { … }
DynamicTypeInfo getClassObjectDynamicTypeInfo(ProgramStateRef State,
SymbolRef Sym) { … }
ProgramStateRef setDynamicTypeInfo(ProgramStateRef State, const MemRegion *MR,
DynamicTypeInfo NewTy) { … }
ProgramStateRef setDynamicTypeInfo(ProgramStateRef State, const MemRegion *MR,
QualType NewTy, bool CanBeSubClassed) { … }
ProgramStateRef setDynamicTypeAndCastInfo(ProgramStateRef State,
const MemRegion *MR,
QualType CastFromTy,
QualType CastToTy,
bool CastSucceeds) { … }
ProgramStateRef setClassObjectDynamicTypeInfo(ProgramStateRef State,
SymbolRef Sym,
DynamicTypeInfo NewTy) { … }
ProgramStateRef setClassObjectDynamicTypeInfo(ProgramStateRef State,
SymbolRef Sym, QualType NewTy,
bool CanBeSubClassed) { … }
static bool isLive(SymbolReaper &SR, const MemRegion *MR) { … }
static bool isLive(SymbolReaper &SR, SymbolRef Sym) { … }
template <typename MapTy>
static ProgramStateRef removeDeadImpl(ProgramStateRef State, SymbolReaper &SR) { … }
ProgramStateRef removeDeadTypes(ProgramStateRef State, SymbolReaper &SR) { … }
ProgramStateRef removeDeadCasts(ProgramStateRef State, SymbolReaper &SR) { … }
ProgramStateRef removeDeadClassObjectTypes(ProgramStateRef State,
SymbolReaper &SR) { … }
static raw_ostream &printJson(const MemRegion *Region, raw_ostream &Out,
const char *NL, unsigned int Space, bool IsDot) { … }
static raw_ostream &printJson(const SymExpr *Symbol, raw_ostream &Out,
const char *NL, unsigned int Space, bool IsDot) { … }
static raw_ostream &printJson(const DynamicTypeInfo &DTI, raw_ostream &Out,
const char *NL, unsigned int Space, bool IsDot) { … }
static raw_ostream &printJson(const DynamicCastInfo &DCI, raw_ostream &Out,
const char *NL, unsigned int Space, bool IsDot) { … }
template <class T, class U>
static raw_ostream &printJson(const std::pair<T, U> &Pair, raw_ostream &Out,
const char *NL, unsigned int Space, bool IsDot) { … }
template <class ContainerTy>
static raw_ostream &printJsonContainer(const ContainerTy &Container,
raw_ostream &Out, const char *NL,
unsigned int Space, bool IsDot) { … }
static raw_ostream &printJson(const CastSet &Set, raw_ostream &Out,
const char *NL, unsigned int Space, bool IsDot) { … }
template <class MapTy>
static void printJsonImpl(raw_ostream &Out, ProgramStateRef State,
const char *Name, const char *NL, unsigned int Space,
bool IsDot, bool PrintEvenIfEmpty = true) { … }
static void printDynamicTypesJson(raw_ostream &Out, ProgramStateRef State,
const char *NL, unsigned int Space,
bool IsDot) { … }
static void printDynamicCastsJson(raw_ostream &Out, ProgramStateRef State,
const char *NL, unsigned int Space,
bool IsDot) { … }
static void printClassObjectDynamicTypesJson(raw_ostream &Out,
ProgramStateRef State,
const char *NL, unsigned int Space,
bool IsDot) { … }
void printDynamicTypeInfoJson(raw_ostream &Out, ProgramStateRef State,
const char *NL, unsigned int Space, bool IsDot) { … }
}
}