15 #ifndef LLVM_CLANG_LIB_AST_LINKAGE_H 16 #define LLVM_CLANG_LIB_AST_LINKAGE_H 21 #include "llvm/ADT/DenseMap.h" 22 #include "llvm/ADT/Optional.h" 82 using QueryType = std::pair<const NamedDecl *, unsigned>;
83 llvm::SmallDenseMap<QueryType, LinkageInfo, 8> CachedLinkageInfo;
86 return std::make_pair(ND, Kind.
toBits());
91 auto Iter = CachedLinkageInfo.find(makeCacheKey(ND, Kind));
92 if (Iter == CachedLinkageInfo.end())
98 CachedLinkageInfo[makeCacheKey(ND, Kind)] = Info;
121 bool IgnoreVarTypeLinkage);
125 bool IgnoreVarTypeLinkage);
141 bool IgnoreVarTypeLinkage =
false);
147 return computeTypeLinkageInfo(T.
getTypePtr());
154 return getTypeLinkageAndVisibility(T.
getTypePtr());
An instance of this class is created to represent a function declaration or definition.
LVComputationKind(NamedDecl::ExplicitVisibilityKind EK)
A (possibly-)qualified type.
C Language Family Type Representation.
Decl - This represents one declaration (or definition), e.g.
The base class of the type hierarchy.
ExplicitVisibilityKind
Kinds of explicit visibility.
Represents a variable template specialization, which refers to a variable template with a given set o...
LinkageInfo getTypeLinkageAndVisibility(QualType T)
Stores a list of template parameters for a TemplateDecl and its derived classes.
unsigned ExplicitKind
The kind of entity whose visibility is ultimately being computed; visibility computations for types a...
Represents a class template specialization, which refers to a class template with a given set of temp...
Provides information about a function template specialization, which is a FunctionDecl that has been ...
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
LinkageInfo computeTypeLinkageInfo(QualType T)
unsigned IgnoreExplicitVisibility
Whether explicit visibility attributes should be ignored.
bool isTypeVisibility() const
const FunctionProtoType * T
unsigned IgnoreAllVisibility
Whether all visibility should be ignored.
bool isValueVisibility() const
The result type of a method or function.
Dataflow Directional Tag Classes.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Do an LV computation for, ultimately, a non-type declaration.
Do an LV computation for, ultimately, a type.
NamedDecl::ExplicitVisibilityKind getExplicitVisibilityKind() const
A template argument list.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
NamedDecl - This represents a decl with a name.
static LVComputationKind forLinkageOnly()
Do an LV computation when we only care about the linkage.