15 #ifndef LLVM_CLANG_AST_GLOBALDECL_H 16 #define LLVM_CLANG_AST_GLOBALDECL_H 23 #include "llvm/ADT/DenseMapInfo.h" 24 #include "llvm/ADT/PointerIntPair.h" 25 #include "llvm/Support/Casting.h" 26 #include "llvm/Support/type_traits.h" 36 llvm::PointerIntPair<const Decl *, 2>
Value;
37 unsigned MultiVersionIndex = 0;
39 void Init(
const Decl *D) {
40 assert(!isa<CXXConstructorDecl>(D) &&
"Use other ctor with ctor decls!");
41 assert(!isa<CXXDestructorDecl>(D) &&
"Use other ctor with dtor decls!");
50 : MultiVersionIndex(MVIndex) {
62 CanonGD.Value.setPointer(Value.getPointer()->getCanonicalDecl());
63 CanonGD.Value.setInt(Value.getInt());
64 CanonGD.MultiVersionIndex = MultiVersionIndex;
72 assert(isa<CXXConstructorDecl>(
getDecl()) &&
"Decl is not a ctor!");
77 assert(isa<CXXDestructorDecl>(
getDecl()) &&
"Decl is not a dtor!");
82 assert(isa<FunctionDecl>(
getDecl()) &&
83 !isa<CXXConstructorDecl>(
getDecl()) &&
84 !isa<CXXDestructorDecl>(
getDecl()) &&
85 "Decl is not a plain FunctionDecl!");
86 return MultiVersionIndex;
90 return LHS.Value == RHS.Value &&
91 LHS.MultiVersionIndex == RHS.MultiVersionIndex;
98 GD.Value.setFromOpaqueValue(P);
104 Result.Value.setPointer(D);
109 assert(isa<FunctionDecl>(
getDecl()) &&
110 !isa<CXXConstructorDecl>(
getDecl()) &&
111 !isa<CXXDestructorDecl>(
getDecl()) &&
112 "Decl is not a plain FunctionDecl!");
114 Result.MultiVersionIndex = Index;
147 static const bool value =
true;
152 #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
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
static clang::GlobalDecl getEmptyKey()
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)
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)
CXXDtorType
C++ destructor types.
Pepresents 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()
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)