14 #ifndef LLVM_CLANG_AST_GLOBALDECL_H 15 #define LLVM_CLANG_AST_GLOBALDECL_H 22 #include "llvm/ADT/DenseMapInfo.h" 23 #include "llvm/ADT/PointerIntPair.h" 24 #include "llvm/Support/Casting.h" 25 #include "llvm/Support/type_traits.h" 41 llvm::PointerIntPair<const Decl *, 2>
Value;
42 unsigned MultiVersionIndex = 0;
44 void Init(
const Decl *D) {
45 assert(!isa<CXXConstructorDecl>(D) &&
"Use other ctor with ctor decls!");
46 assert(!isa<CXXDestructorDecl>(D) &&
"Use other ctor with dtor decls!");
55 : MultiVersionIndex(MVIndex) {
65 : Value(D, unsigned(StubKind)) {}
69 CanonGD.Value.setPointer(Value.getPointer()->getCanonicalDecl());
70 CanonGD.Value.setInt(Value.getInt());
71 CanonGD.MultiVersionIndex = MultiVersionIndex;
79 assert(isa<CXXConstructorDecl>(getDecl()) &&
"Decl is not a ctor!");
84 assert(isa<CXXDestructorDecl>(getDecl()) &&
"Decl is not a dtor!");
89 assert(isa<VarDecl>(getDecl()) &&
90 cast<VarDecl>(getDecl())->hasGlobalStorage() &&
91 "Decl is not a global variable!");
96 assert(isa<FunctionDecl>(getDecl()) &&
97 !isa<CXXConstructorDecl>(getDecl()) &&
98 !isa<CXXDestructorDecl>(getDecl()) &&
99 "Decl is not a plain FunctionDecl!");
100 return MultiVersionIndex;
104 return LHS.Value == RHS.Value &&
105 LHS.MultiVersionIndex == RHS.MultiVersionIndex;
112 GD.Value.setFromOpaqueValue(P);
118 Result.Value.setPointer(D);
123 assert(isa<CXXConstructorDecl>(getDecl()));
125 Result.Value.setInt(Type);
130 assert(isa<CXXDestructorDecl>(getDecl()));
132 Result.Value.setInt(Type);
137 assert(isa<FunctionDecl>(getDecl()) &&
138 !isa<CXXConstructorDecl>(getDecl()) &&
139 !isa<CXXDestructorDecl>(getDecl()) &&
140 "Decl is not a plain FunctionDecl!");
142 Result.MultiVersionIndex = Index;
173 #endif // LLVM_CLANG_AST_GLOBALDECL_H Represents a function declaration or definition.
GlobalDecl getWithDecl(const Decl *D)
GlobalDecl(const VarDecl *D)
GlobalDecl getWithMultiVersionIndex(unsigned Index)
CXXDtorType getDtorType() const
Specialize PointerLikeTypeTraits to allow LazyGenerationalUpdatePtr to be placed into a PointerUnion...
static clang::GlobalDecl getEmptyKey()
GlobalDecl(const VarDecl *D, DynamicInitKind StubKind)
Decl - This represents one declaration (or definition), e.g.
GlobalDecl getCanonicalDecl() const
The base class of the type hierarchy.
Represents a C++ constructor within a class.
static GlobalDecl getFromOpaquePtr(void *P)
GlobalDecl getWithCtorType(CXXCtorType Type)
Represents a variable declaration or definition.
ObjCMethodDecl - Represents an instance or class method declaration.
static bool isEqual(clang::GlobalDecl LHS, clang::GlobalDecl RHS)
void * getAsOpaquePtr() const
static unsigned getHashValue(clang::GlobalDecl GD)
GlobalDecl(const CXXDestructorDecl *D, CXXDtorType Type)
GlobalDecl(const CapturedDecl *D)
GlobalDecl(const CXXConstructorDecl *D, CXXCtorType Type)
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
CXXCtorType getCtorType() const
Enums/classes describing ABI related information about constructors, destructors and thunks...
GlobalDecl(const OMPDeclareReductionDecl *D)
Represents the body of a CapturedStmt, and serves as its DeclContext.
GlobalDecl(const FunctionDecl *D, unsigned MVIndex=0)
GlobalDecl getWithDtorType(CXXDtorType Type)
CXXDtorType
C++ destructor types.
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Represents a C++ destructor within a class.
The result type of a method or function.
GlobalDecl - represents a global declaration.
static clang::GlobalDecl getTombstoneKey()
DynamicInitKind getDynamicInitKind() const
This represents '#pragma omp declare reduction ...' directive.
const Decl * getDecl() const
GlobalDecl(const ObjCMethodDecl *D)
This file defines OpenMP nodes for declarative directives.
CXXCtorType
C++ constructor types.
Dataflow Directional Tag Classes.
unsigned getMultiVersionIndex() const
GlobalDecl(const BlockDecl *D)
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
friend bool operator==(const GlobalDecl &LHS, const GlobalDecl &RHS)