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) {
66 : Value(D, unsigned(StubKind)) {}
70 CanonGD.Value.setPointer(Value.getPointer()->getCanonicalDecl());
71 CanonGD.Value.setInt(Value.getInt());
72 CanonGD.MultiVersionIndex = MultiVersionIndex;
80 assert(isa<CXXConstructorDecl>(getDecl()) &&
"Decl is not a ctor!");
85 assert(isa<CXXDestructorDecl>(getDecl()) &&
"Decl is not a dtor!");
90 assert(isa<VarDecl>(getDecl()) &&
91 cast<VarDecl>(getDecl())->hasGlobalStorage() &&
92 "Decl is not a global variable!");
97 assert(isa<FunctionDecl>(getDecl()) &&
98 !isa<CXXConstructorDecl>(getDecl()) &&
99 !isa<CXXDestructorDecl>(getDecl()) &&
100 "Decl is not a plain FunctionDecl!");
101 return MultiVersionIndex;
105 return LHS.Value == RHS.Value &&
106 LHS.MultiVersionIndex == RHS.MultiVersionIndex;
113 GD.Value.setFromOpaqueValue(P);
119 Result.Value.setPointer(D);
124 assert(isa<CXXConstructorDecl>(getDecl()));
126 Result.Value.setInt(Type);
131 assert(isa<CXXDestructorDecl>(getDecl()));
133 Result.Value.setInt(Type);
138 assert(isa<FunctionDecl>(getDecl()) &&
139 !isa<CXXConstructorDecl>(getDecl()) &&
140 !isa<CXXDestructorDecl>(getDecl()) &&
141 "Decl is not a plain FunctionDecl!");
143 Result.MultiVersionIndex = Index;
174 #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 OMPDeclareMapperDecl *D)
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).
This represents '#pragma omp declare mapper ...' directive.
friend bool operator==(const GlobalDecl &LHS, const GlobalDecl &RHS)