14#ifndef LLVM_CLANG_LIB_AST_LINKAGE_H
15#define LLVM_CLANG_LIB_AST_LINKAGE_H
21#include "llvm/ADT/DenseMap.h"
22#include "llvm/ADT/PointerIntPair.h"
60 Result.IgnoreExplicitVisibility =
true;
61 Result.IgnoreAllVisibility =
true;
88 llvm::SmallDenseMap<QueryType, LinkageInfo, 8> CachedLinkageInfo;
91 return QueryType(ND, Kind.toBits());
94 std::optional<LinkageInfo> lookup(
const NamedDecl *ND,
96 auto Iter = CachedLinkageInfo.find(makeCacheKey(ND, Kind));
97 if (
Iter == CachedLinkageInfo.end())
103 CachedLinkageInfo[makeCacheKey(ND, Kind)] = Info;
126 bool IgnoreVarTypeLinkage);
130 bool IgnoreVarTypeLinkage);
148 bool IgnoreVarTypeLinkage =
false);
Forward declaration of all AST node types.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
C Language Family Type Representation.
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Represents a class template specialization, which refers to a class template with a given set of temp...
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Decl - This represents one declaration (or definition), e.g.
Represents a function declaration or definition.
Provides information about a function template specialization, which is a FunctionDecl that has been ...
LinkageInfo computeTypeLinkageInfo(const Type *T)
LinkageInfo getTypeLinkageAndVisibility(const Type *T)
LinkageInfo computeLVForDecl(const NamedDecl *D, LVComputationKind computation, bool IgnoreVarTypeLinkage=false)
LinkageInfo computeTypeLinkageInfo(QualType T)
LinkageInfo getLVForDecl(const NamedDecl *D, LVComputationKind computation)
getLVForDecl - Get the linkage and visibility for the given declaration.
LinkageInfo getDeclLinkageAndVisibility(const NamedDecl *D)
LinkageInfo getTypeLinkageAndVisibility(QualType T)
This represents a decl that may have a name.
ExplicitVisibilityKind
Kinds of explicit visibility.
@ VisibilityForValue
Do an LV computation for, ultimately, a non-type declaration.
@ VisibilityForType
Do an LV computation for, ultimately, a type.
A (possibly-)qualified type.
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
A template argument list.
Stores a list of template parameters for a TemplateDecl and its derived classes.
The base class of the type hierarchy.
Represents a variable template specialization, which refers to a variable template with a given set o...
@ Result
The result type of a method or function.
bool isTypeVisibility() const
unsigned ExplicitKind
The kind of entity whose visibility is ultimately being computed; visibility computations for types a...
unsigned IgnoreExplicitVisibility
Whether explicit visibility attributes should be ignored.
LVComputationKind(NamedDecl::ExplicitVisibilityKind EK)
@ NumLVComputationKindBits
unsigned IgnoreAllVisibility
Whether all visibility should be ignored.
NamedDecl::ExplicitVisibilityKind getExplicitVisibilityKind() const
static LVComputationKind forLinkageOnly()
Do an LV computation when we only care about the linkage.
bool isValueVisibility() const