16#ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_PROGRAMSTATETRAIT_H
17#define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_PROGRAMSTATETRAIT_H
19#include "llvm/ADT/ImmutableList.h"
20#include "llvm/ADT/ImmutableMap.h"
21#include "llvm/ADT/ImmutableSet.h"
22#include "llvm/Support/Allocator.h"
34#define REGISTER_TRAIT_WITH_PROGRAMSTATE(Name, Type) \
37 using Name##Ty = Type; \
42 struct ProgramStateTrait<Name> : public ProgramStatePartialTrait<Name##Ty> { \
43 static void *GDMIndex() { \
55 #define REGISTER_FACTORY_WITH_PROGRAMSTATE(Type) \
59 struct ProgramStateTrait<Type> \
60 : public ProgramStatePartialTrait<Type> { \
61 static void *GDMIndex() { static int Index; return &Index; } \
73 #define CLANG_ENTO_PROGRAMSTATE_MAP(Key, Value) llvm::ImmutableMap<Key, Value>
87 #define REGISTER_MAP_WITH_PROGRAMSTATE(Name, Key, Value) \
88 REGISTER_TRAIT_WITH_PROGRAMSTATE(Name, \
89 CLANG_ENTO_PROGRAMSTATE_MAP(Key, Value))
95 #define REGISTER_MAP_FACTORY_WITH_PROGRAMSTATE(Name, Key, Value) \
96 using Name = llvm::ImmutableMap<Key, Value>; \
97 REGISTER_FACTORY_WITH_PROGRAMSTATE(Name)
112 #define REGISTER_SET_WITH_PROGRAMSTATE(Name, Elem) \
113 REGISTER_TRAIT_WITH_PROGRAMSTATE(Name, llvm::ImmutableSet<Elem>)
119 #define REGISTER_SET_FACTORY_WITH_PROGRAMSTATE(Name, Elem) \
120 using Name = llvm::ImmutableSet<Elem>; \
121 REGISTER_FACTORY_WITH_PROGRAMSTATE(Name)
135 #define REGISTER_LIST_WITH_PROGRAMSTATE(Name, Elem) \
136 REGISTER_TRAIT_WITH_PROGRAMSTATE(Name, llvm::ImmutableList<Elem>)
142 #define REGISTER_LIST_FACTORY_WITH_PROGRAMSTATE(Name, Elem) \
143 using Name = llvm::ImmutableList<Elem>; \
144 REGISTER_FACTORY_WITH_PROGRAMSTATE(Name)
148 template <
typename Key,
typename Data,
typename Info>
157 return p ?
data_type((
typename data_type::TreeTy *) *p)
171 return F.add(B, K,
E);
175 return F.remove(B, K);
179 return B.contains(K);
183 return *((
typename data_type::Factory *) p);
187 return new typename data_type::Factory(Alloc);
191 delete (
typename data_type::Factory *) Ctx;
196 template <
typename Key,
typename Info>
203 return p ?
data_type((
typename data_type::TreeTy *) *p)
216 return F.remove(B, K);
220 return B.contains(K);
224 return *((
typename data_type::Factory *) p);
228 return new typename data_type::Factory(Alloc);
232 delete (
typename data_type::Factory *) Ctx;
237 template <
typename T>
248 return L.contains(K);
252 return p ?
data_type((
const llvm::ImmutableListImpl<T> *) *p)
257 return const_cast<llvm::ImmutableListImpl<T> *
>(
D.getInternalPointer());
261 return *((
typename data_type::Factory *) p);
265 return new typename data_type::Factory(Alloc);
269 delete (
typename data_type::Factory *) Ctx;
280 template <
typename T>
282 std::enable_if_t<std::is_integral<T>::value>>
286 template <
typename T>
291 template <
typename T>
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T
Diagnostic wrappers for TextAPI types for error reporting.
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
static T MakeData(void *const *P)
static void * MakeVoidPtr(T D)
static void * MakeVoidPtr(data_type D)
typename data_type::Factory & context_type
static data_type Add(data_type L, key_type K, context_type F)
static context_type MakeContext(void *p)
static bool Contains(data_type L, key_type K)
llvm::ImmutableList< T > data_type
static void * CreateContext(llvm::BumpPtrAllocator &Alloc)
static void DeleteContext(void *Ctx)
static data_type MakeData(void *const *p)
const value_type * lookup_type
static data_type Set(data_type B, key_type K, value_type E, context_type F)
static data_type MakeData(void *const *p)
static context_type MakeContext(void *p)
typename data_type::Factory & context_type
static lookup_type Lookup(data_type B, key_type K)
static void DeleteContext(void *Ctx)
static data_type Remove(data_type B, key_type K, context_type F)
static bool Contains(data_type B, key_type K)
static void * CreateContext(llvm::BumpPtrAllocator &Alloc)
llvm::ImmutableMap< Key, Data, Info > data_type
static void * MakeVoidPtr(data_type B)
static data_type MakeData(void *const *p)
static data_type Remove(data_type B, key_type K, context_type F)
static void * MakeVoidPtr(data_type B)
static data_type Add(data_type B, key_type K, context_type F)
static void DeleteContext(void *Ctx)
static context_type MakeContext(void *p)
static bool Contains(data_type B, key_type K)
typename data_type::Factory & context_type
static void * CreateContext(llvm::BumpPtrAllocator &Alloc)
llvm::ImmutableSet< Key, Info > data_type