9#ifndef LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_ANALYSES_ENTITYPOINTERLEVEL_ENTITYPOINTERLEVEL_H
10#define LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_ANALYSES_ENTITYPOINTERLEVEL_ENTITYPOINTERLEVEL_H
15#include "llvm/ADT/STLFunctionalExtras.h"
38class EntityPointerLevel {
40 unsigned PointerLevel;
42 friend class EntityPointerLevelTranslator;
44 friend EntityPointerLevel buildEntityPointerLevel(EntityId,
unsigned);
46 EntityPointerLevel(std::pair<EntityId, unsigned> Pair)
47 : Entity(Pair.first), PointerLevel(Pair.second) {}
50 EntityId getEntity()
const {
return Entity; }
51 unsigned getPointerLevel()
const {
return PointerLevel; }
53 bool operator==(
const EntityPointerLevel &Other)
const {
54 return std::tie(Entity, PointerLevel) ==
58 bool operator!=(
const EntityPointerLevel &Other)
const {
59 return !(*
this ==
Other);
62 bool operator<(
const EntityPointerLevel &Other)
const {
63 return std::tie(Entity, PointerLevel) <
70 using is_transparent = void;
71 bool operator()(
const EntityPointerLevel &L,
72 const EntityPointerLevel &R)
const {
75 bool operator()(
const EntityId &L,
const EntityPointerLevel &R)
const {
76 return L <
R.getEntity();
78 bool operator()(
const EntityPointerLevel &L,
const EntityId &R)
const {
79 return L.getEntity() <
R;
84using EntityPointerLevelSet =
85 std::set<EntityPointerLevel, EntityPointerLevel::Comparator>;
96llvm::Expected<EntityPointerLevelSet> translateEntityPointerLevel(
97 const Expr *E, ASTContext &Ctx,
102EntityPointerLevel buildEntityPointerLevel(
EntityId,
unsigned);
111llvm::Expected<EntityPointerLevel>
112createEntityPointerLevel(
const NamedDecl *ND,
114 bool IsFunRet =
false);
Lightweight opaque handle representing an entity in an EntityIdTable.
Uniquely identifies an entity in a program.
bool operator!=(const CommonEntityInfo &LHS, const CommonEntityInfo &RHS)
EntityPointerLevel incrementPointerLevel(const EntityPointerLevel &E)
An EntityPointerLevel is associated with a level of the declared pointer/array type of an entity.
bool operator==(const ValueType &a, const ValueType &b)
bool operator<(DeclarationName LHS, DeclarationName RHS)
Ordering on two declaration names.
@ Other
Other implicit parameter.