38#include "llvm/ADT/PointerIntPair.h"
39#include "llvm/ADT/StringRef.h"
40#include "llvm/Support/ErrorHandling.h"
41#include "llvm/Support/MathExtras.h"
42#include "llvm/Support/VersionTuple.h"
43#include "llvm/Support/raw_ostream.h"
57#define DECL(DERIVED, BASE) static int n##DERIVED##s = 0;
58#define ABSTRACT_DECL(DECL)
59#include "clang/AST/DeclNodes.inc"
61#define DECL(DERIVED, BASE) \
62 static_assert(alignof(Decl) >= alignof(DERIVED##Decl), \
63 "Alignment sufficient after objects prepended to " #DERIVED);
64#define ABSTRACT_DECL(DECL)
65#include "clang/AST/DeclNodes.inc"
67void *Decl::operator
new(std::size_t Size,
const ASTContext &Context,
71 static_assert(
sizeof(uint64_t) >=
alignof(
Decl),
"Decl won't be misaligned");
72 void *Start = Context.Allocate(Size +
Extra + 8);
73 void *
Result = (
char*)Start + 8;
75 uint64_t *PrefixPtr = (uint64_t *)
Result - 1;
77 *PrefixPtr = ID.getRawValue();
82 assert((*PrefixPtr < llvm::maskTrailingOnes<uint64_t>(48)) &&
83 "Current Implementation limits the number of module files to not "
84 "exceed 2^16. Contact Clang Developers to remove the limitation.");
89void *Decl::operator
new(std::size_t Size,
const ASTContext &Ctx,
91 assert(!Parent || &Parent->getParentASTContext() == &Ctx);
95 if (Ctx.getLangOpts().trackLocalOwningModule() || !Parent) {
99 llvm::offsetToAlignment(
sizeof(
Module *), llvm::Align(
alignof(
Decl)));
100 auto *Buffer =
reinterpret_cast<char *
>(
101 ::operator
new(ExtraAlign +
sizeof(
Module *) + Size +
Extra, Ctx));
102 Buffer += ExtraAlign;
104 Parent ?
cast<Decl>(Parent)->getOwningModule() :
nullptr;
105 return new (Buffer)
Module*(ParentModule) + 1;
107 return ::operator
new(Size +
Extra, Ctx);
114 uint64_t ID = *((
const uint64_t *)
this - 1);
115 return GlobalDeclID(ID & llvm::maskTrailingOnes<uint64_t>(48));
122 uint64_t ID = *((
const uint64_t *)
this - 1);
127 assert(
isFromASTFile() &&
"Only works on a deserialized declaration");
144 assert((ID < llvm::maskTrailingOnes<unsigned>(16)) &&
145 "Current Implementation limits the number of modules to not exceed "
146 "2^16. Contact Clang Developers to remove the limitation.");
147 uint64_t *IDAddress = (uint64_t *)
this - 1;
148 *IDAddress &= llvm::maskTrailingOnes<uint64_t>(48);
149 *IDAddress |= (uint64_t)ID << 48;
160Module *Decl::getOwningModuleSlow()
const {
171 default: llvm_unreachable(
"Declaration not in DeclNodes.inc!");
172#define DECL(DERIVED, BASE) case DERIVED: return #DERIVED;
173#define ABSTRACT_DECL(DECL)
174#include "clang/AST/DeclNodes.inc"
194 if (
auto *DD = dyn_cast<DecompositionDecl>(
this)) {
195 for (
auto *Binding : DD->bindings()) {
196 Binding->setInvalidDecl();
203#define DECL(DERIVED, BASE) case Decl::DERIVED: return true;
204#define ABSTRACT_DECL(DECL)
205#include "clang/AST/DeclNodes.inc"
212#define DECL(DERIVED, BASE) case Decl::DERIVED: return #DERIVED;
213#define ABSTRACT_DECL(DECL)
214#include "clang/AST/DeclNodes.inc"
216 llvm_unreachable(
"Declaration context not in DeclNodes.inc!");
219bool Decl::StatisticsEnabled =
false;
221 StatisticsEnabled =
true;
225 llvm::errs() <<
"\n*** Decl Stats:\n";
228#define DECL(DERIVED, BASE) totalDecls += n##DERIVED##s;
229#define ABSTRACT_DECL(DECL)
230#include "clang/AST/DeclNodes.inc"
231 llvm::errs() <<
" " << totalDecls <<
" decls total.\n";
234#define DECL(DERIVED, BASE) \
235 if (n##DERIVED##s > 0) { \
236 totalBytes += (int)(n##DERIVED##s * sizeof(DERIVED##Decl)); \
237 llvm::errs() << " " << n##DERIVED##s << " " #DERIVED " decls, " \
238 << sizeof(DERIVED##Decl) << " each (" \
239 << n##DERIVED##s * sizeof(DERIVED##Decl) \
242#define ABSTRACT_DECL(DECL)
243#include "clang/AST/DeclNodes.inc"
245 llvm::errs() <<
"Total bytes = " << totalBytes <<
"\n";
250#define DECL(DERIVED, BASE) case DERIVED: ++n##DERIVED##s; break;
251#define ABSTRACT_DECL(DECL)
252#include "clang/AST/DeclNodes.inc"
257 if (
const auto *TTP = dyn_cast<TemplateTypeParmDecl>(
this))
258 return TTP->isParameterPack();
259 if (
const auto *NTTP = dyn_cast<NonTypeTemplateParmDecl>(
this))
260 return NTTP->isParameterPack();
261 if (
const auto *TTP = dyn_cast<TemplateTemplateParmDecl>(
this))
262 return TTP->isParameterPack();
267 if (
const auto *Var = dyn_cast<ValueDecl>(
this))
268 return Var->isParameterPack();
274 if (
auto *FD = dyn_cast<FunctionDecl>(
this))
276 if (
const auto *FTD = dyn_cast<FunctionTemplateDecl>(
this))
277 return FTD->getTemplatedDecl();
286 if (
auto *FD = dyn_cast<FunctionDecl>(
this))
287 return FD->getDescribedFunctionTemplate();
288 if (
auto *RD = dyn_cast<CXXRecordDecl>(
this))
289 return RD->getDescribedClassTemplate();
290 if (
auto *VD = dyn_cast<VarDecl>(
this))
291 return VD->getDescribedVarTemplate();
292 if (
auto *AD = dyn_cast<TypeAliasDecl>(
this))
293 return AD->getDescribedAliasTemplate();
300 return TD->getTemplateParameters();
301 if (
auto *CTPSD = dyn_cast<ClassTemplatePartialSpecializationDecl>(
this))
302 return CTPSD->getTemplateParameters();
303 if (
auto *VTPSD = dyn_cast<VarTemplatePartialSpecializationDecl>(
this))
304 return VTPSD->getTemplateParameters();
312 if (
auto *AsDC = dyn_cast<DeclContext>(
this))
313 return AsDC->isDependentContext();
321 if (
auto *DC = dyn_cast<DeclContext>(
this))
322 if (DC->isFileContext())
326 return TPL->getDepth() + 1;
331 auto *RD = dyn_cast<CXXRecordDecl>(
this);
332 if (RD && RD->isDependentLambda())
333 if (
Decl *Context = RD->getLambdaContextDecl())
334 return Context->getTemplateDepth();
345 if (DC->isFunctionOrMethod())
358 TheLoc = TheDecl->getLocation();
361 TheLoc.
print(OS, SM);
367 if (
const auto *DN = dyn_cast_or_null<NamedDecl>(TheDecl)) {
369 DN->printQualifiedName(OS);
393 getMultipleDC()->LexicalDC = DC;
407 "hidden declaration has no owning module");
412 if (SemaDC == LexicalDC) {
415 auto *MDC =
new (Ctx) Decl::MultipleDC();
416 MDC->SemanticDC = SemaDC;
417 MDC->LexicalDC = LexicalDC;
431 if (
const auto *CRD = dyn_cast<CXXRecordDecl>(LDC))
441 if (
const auto *ND = dyn_cast<NamespaceDecl>(DC))
442 if (ND->isAnonymousNamespace())
455 const auto *DC = dyn_cast<DeclContext>(
this);
456 return DC && DC->isFileContext();
462 bool IgnoreTemplateOrMacroSubstitution) {
469 llvm::APInt Size = CAT->getSize();
470 if (StrictFlexArraysLevel == FAMKind::IncompleteOnly)
477 if (StrictFlexArraysLevel == FAMKind::ZeroOrIncomplete && Size.uge(1))
480 if (StrictFlexArraysLevel == FAMKind::OneZeroOrIncomplete && Size.uge(2))
486 if (
const auto *OID = dyn_cast_if_present<ObjCIvarDecl>(D))
487 return OID->getNextIvar() ==
nullptr;
489 const auto *FD = dyn_cast_if_present<FieldDecl>(D);
496 llvm::APInt Size = CAT->getSize();
497 if (FD->getParent()->isUnion() && (Size.isZero() || Size.isOne()))
503 if (IgnoreTemplateOrMacroSubstitution) {
510 TInfo = TTL.getDecl()->getTypeSourceInfo();
515 if (
const Expr *SizeExpr =
516 dyn_cast_if_present<IntegerLiteral>(CTL.getSizeExpr());
528 return ++FI == FD->getParent()->field_end();
532 if (
auto *TUD = dyn_cast<TranslationUnitDecl>(
this))
536 assert(DC &&
"This decl is not contained in a translation unit!");
540 assert(DC &&
"This decl is not contained in a translation unit!");
568 for (; I != E; ++I) {
569 if (!I->isAlignmentErrorDependent())
570 Align = std::max(Align, I->getAlignment(Ctx));
594 if (
C.getASTMutationListener())
595 C.getASTMutationListener()->DeclarationMarkedUsed(
this);
605 for (
const auto *I :
redecls())
614 if (
auto *ID = dyn_cast<ObjCInterfaceDecl>(
this)) {
616 }
else if (
auto *PD = dyn_cast<ObjCProtocolDecl>(
this)) {
618 }
else if (
auto *TD = dyn_cast<TagDecl>(
this)) {
627 return dcd->getAttr<ExternalSourceSymbolAttr>();
652 StringRef RealizedPlatform = A->getPlatform()->getName();
653 if (!Context.getLangOpts().AppExt)
654 return RealizedPlatform;
655 size_t suffix = RealizedPlatform.rfind(
"_app_extension");
656 if (suffix != StringRef::npos)
657 return RealizedPlatform.slice(0, suffix);
658 return RealizedPlatform;
671 const AvailabilityAttr *A,
672 std::string *Message,
673 VersionTuple EnclosingVersion) {
674 if (EnclosingVersion.empty())
675 EnclosingVersion = Context.getTargetInfo().getPlatformMinVersion();
677 if (EnclosingVersion.empty())
680 StringRef ActualPlatform = A->getPlatform()->getName();
681 StringRef TargetPlatform = Context.getTargetInfo().getPlatformName();
687 StringRef PrettyPlatformName
688 = AvailabilityAttr::getPrettyPlatformName(ActualPlatform);
690 if (PrettyPlatformName.empty())
691 PrettyPlatformName = ActualPlatform;
693 std::string HintMessage;
694 if (!A->getMessage().empty()) {
696 HintMessage += A->getMessage();
700 if (A->getUnavailable()) {
703 llvm::raw_string_ostream Out(*Message);
704 Out <<
"not available on " << PrettyPlatformName
712 if (!A->getIntroduced().empty() &&
713 EnclosingVersion < A->getIntroduced()) {
715 auto &Triple = Context.getTargetInfo().getTriple();
716 StringRef TargetEnv = Triple.getEnvironmentName();
718 llvm::Triple::getEnvironmentTypeName(Triple.getEnvironment());
720 if (!IIEnv || (Triple.hasEnvironment() && IIEnv->
getName() == TargetEnv)) {
723 llvm::raw_string_ostream Out(*Message);
724 VersionTuple VTI(A->getIntroduced());
725 Out <<
"introduced in " << PrettyPlatformName <<
" " << VTI;
726 if (Triple.hasEnvironment())
727 Out <<
" " << EnvName;
735 llvm::raw_string_ostream Out(*Message);
736 Out <<
"not available on " << PrettyPlatformName;
737 if (Triple.hasEnvironment())
738 Out <<
" " << EnvName;
747 if (!A->getObsoleted().empty() && EnclosingVersion >= A->getObsoleted()) {
750 llvm::raw_string_ostream Out(*Message);
751 VersionTuple VTO(A->getObsoleted());
752 Out <<
"obsoleted in " << PrettyPlatformName <<
' '
753 << VTO << HintMessage;
760 if (!A->getDeprecated().empty() && EnclosingVersion >= A->getDeprecated()) {
763 llvm::raw_string_ostream Out(*Message);
764 VersionTuple VTD(A->getDeprecated());
765 Out <<
"first deprecated in " << PrettyPlatformName <<
' '
766 << VTD << HintMessage;
776 VersionTuple EnclosingVersion,
777 StringRef *RealizedPlatform)
const {
778 if (
auto *FTD = dyn_cast<FunctionTemplateDecl>(
this))
779 return FTD->getTemplatedDecl()->getAvailability(Message, EnclosingVersion,
783 std::string ResultMessage;
785 for (
const auto *A :
attrs()) {
786 if (
const auto *Deprecated = dyn_cast<DeprecatedAttr>(A)) {
791 ResultMessage = std::string(Deprecated->getMessage());
797 if (
const auto *Unavailable = dyn_cast<UnavailableAttr>(A)) {
799 *Message = std::string(Unavailable->getMessage());
803 if (
const auto *Availability = dyn_cast<AvailabilityAttr>(A)) {
805 Message, EnclosingVersion);
808 if (RealizedPlatform)
809 *RealizedPlatform = Availability->getPlatform()->getName();
816 ResultMessage.swap(*Message);
823 Message->swap(ResultMessage);
829 StringRef TargetPlatform = Context.getTargetInfo().getPlatformName();
830 for (
const auto *A :
attrs()) {
831 if (
const auto *Availability = dyn_cast<AvailabilityAttr>(A)) {
834 if (!Availability->getIntroduced().empty())
835 return Availability->getIntroduced();
842 IsDefinition =
false;
845 if (
const auto *Var = dyn_cast<VarDecl>(
this)) {
846 if (Var->isThisDeclarationADefinition()) {
853 if (
const auto *FD = dyn_cast<FunctionDecl>(
this)) {
879 if (
const auto *Availability = dyn_cast<AvailabilityAttr>(A)) {
892 case CXXDeductionGuide:
895 case ConstructorUsingShadow:
906 case HLSLRootSignature:
912 case NonTypeTemplateParm:
919 case ObjCCompatibleAlias:
925 case TemplateTypeParm:
929 case UnresolvedUsingTypename:
935 case UnresolvedUsingValue:
948 case ObjCAtDefsField:
965 case TemplateTemplateParm:
969 case UnresolvedUsingIfExists:
972 case OMPDeclareReduction:
975 case OMPDeclareMapper:
987 case ObjCPropertyImpl:
989 case PragmaDetectMismatch:
992 case OutlinedFunction:
993 case TranslationUnit:
997 case UnnamedGlobalConstant:
998 case TemplateParamObject:
1000 case UsingDirective:
1002 case ClassTemplateSpecialization:
1003 case ClassTemplatePartialSpecialization:
1004 case VarTemplateSpecialization:
1005 case VarTemplatePartialSpecialization:
1006 case ObjCImplementation:
1008 case ObjCCategoryImpl:
1010 case OMPThreadPrivate:
1011 case OMPGroupPrivate:
1014 case OMPCapturedExpr:
1016 case LifetimeExtendedTemporary:
1017 case RequiresExprBody:
1018 case ImplicitConceptSpecialization:
1019 case OpenACCDeclare:
1020 case OpenACCRoutine:
1025 llvm_unreachable(
"Invalid DeclKind!");
1029 assert(!HasAttrs &&
"Decl already contains attrs.");
1032 assert(AttrBlank.empty() &&
"HasAttrs was wrong?");
1039 if (!HasAttrs)
return;
1060 auto I = Attrs.begin(), E = Attrs.end();
1061 for (; I != E; ++I) {
1062 if (!(*I)->isInherited())
1069 assert(HasAttrs &&
"No attrs to get!");
1076#define DECL(NAME, BASE)
1077#define DECL_CONTEXT(NAME) \
1079 return static_cast<NAME##Decl *>(const_cast<DeclContext *>(D));
1080#include "clang/AST/DeclNodes.inc"
1082 llvm_unreachable(
"a decl that inherits DeclContext isn't handled");
1089#define DECL(NAME, BASE)
1090#define DECL_CONTEXT(NAME) \
1092 return static_cast<NAME##Decl *>(const_cast<Decl *>(D));
1093#include "clang/AST/DeclNodes.inc"
1095 llvm_unreachable(
"a decl that inherits DeclContext isn't handled");
1102 if (
const auto *FD = dyn_cast<FunctionDecl>(
this)) {
1105 return Definition->getSourceRange().getEnd();
1110 return Body->getSourceRange().getEnd();
1115bool Decl::AccessDeclContextCheck()
const {
1139 "Access specifier is AS_none inside a record decl");
1150 return isa_and_nonnull<ExportDecl>(DC);
1157 return M && M->isNamedModule() &&
1175 M = M->getTopLevelModule();
1176 if (!M->isNamedModule())
1185 if (!M || !M->isNamedModule())
1224 if (
const auto *D = dyn_cast<ValueDecl>(
this))
1226 else if (
const auto *D = dyn_cast<TypedefNameDecl>(
this))
1227 Ty = D->getUnderlyingType();
1252 if (
const auto *D = dyn_cast<ValueDecl>(
this))
1254 else if (
const auto *D = dyn_cast<TypedefNameDecl>(
this))
1255 Ty = D->getUnderlyingType();
1270 if (
getKind(D) == Decl::CXXMethod) {
1272 if (MD->getOverloadedOperator() == OO_Call &&
1273 MD->getParent()->isLambda())
1277 if (
auto *FD = dyn_cast<FunctionDecl>(D))
1279 if (
auto *MD = dyn_cast<ObjCMethodDecl>(D))
1281 if (
auto *BD = dyn_cast<BlockDecl>(D))
1283 if (
auto *CD = dyn_cast<CapturedDecl>(D))
1285 if (
auto *OFD = dyn_cast<OutlinedFunctionDecl>(D))
1291 return ::getNonClosureContext(
this);
1295 return ::getNonClosureContext(
this);
1306 setNeedToReconcileExternalVisibleStorage(
false);
1307 setHasLazyLocalLexicalLookups(
false);
1308 setHasLazyExternalLexicalLookups(
false);
1315#define DECL(NAME, BASE)
1316#define DECL_CONTEXT(NAME) case Decl::NAME:
1317#include "clang/AST/DeclNodes.inc"
1370 if (ND->isInline()) {
1371 return ND->getParent()->isStdNamespace();
1378 return II && II->
isStr(
"std");
1388 if (
const auto *
Record = dyn_cast<CXXRecordDecl>(
this)) {
1389 if (
Record->getDescribedClassTemplate())
1392 if (
Record->isDependentLambda())
1394 if (
Record->isNeverDependentLambda())
1398 if (
const auto *
Function = dyn_cast<FunctionDecl>(
this)) {
1399 if (
Function->getDescribedFunctionTemplate())
1424 while (DC->
getDeclKind() != Decl::TranslationUnit) {
1438 while (DC->
getDeclKind() != Decl::TranslationUnit) {
1477 assert(DC &&
"All transparent contexts should have a parent!");
1484 case Decl::ExternCContext:
1485 case Decl::LinkageSpec:
1487 case Decl::TopLevelStmt:
1489 case Decl::Captured:
1490 case Decl::OutlinedFunction:
1491 case Decl::OMPDeclareReduction:
1492 case Decl::OMPDeclareMapper:
1493 case Decl::RequiresExprBody:
1497 case Decl::HLSLBuffer:
1506 case Decl::TranslationUnit:
1508 case Decl::Namespace:
1511 case Decl::ObjCMethod:
1514 case Decl::ObjCInterface:
1515 if (
auto *OID = dyn_cast<ObjCInterfaceDecl>(
this))
1516 if (
auto *Def = OID->getDefinition())
1520 case Decl::ObjCProtocol:
1521 if (
auto *OPD = dyn_cast<ObjCProtocolDecl>(
this))
1522 if (
auto *Def = OPD->getDefinition())
1526 case Decl::ObjCCategory:
1529 case Decl::ObjCImplementation:
1530 case Decl::ObjCCategoryImpl:
1535 case Decl::ClassTemplatePartialSpecialization:
1536 case Decl::ClassTemplateSpecialization:
1537 case Decl::CXXRecord:
1545 getDeclKind() <= Decl::lastFunction &&
"Unknown DeclContext kind");
1550template <
typename T>
1553 for (
T *D =
Self->getMostRecentDecl(); D; D = D->getPreviousDecl())
1554 Contexts.push_back(D);
1556 std::reverse(Contexts.begin(), Contexts.end());
1564 if (Kind == Decl::TranslationUnit)
1566 else if (Kind == Decl::Namespace)
1569 Contexts.push_back(
this);
1572std::pair<Decl *, Decl *>
1574 bool FieldsAlreadyLoaded) {
1576 Decl *FirstNewDecl =
nullptr;
1577 Decl *PrevDecl =
nullptr;
1578 for (
auto *D : Decls) {
1590 return std::make_pair(FirstNewDecl, PrevDecl);
1596void DeclContext::reconcileExternalVisibleStorage()
const {
1597 assert(hasNeedToReconcileExternalVisibleStorage() &&
LookupPtr);
1598 setNeedToReconcileExternalVisibleStorage(
false);
1601 Lookup.second.setHasExternalDecls();
1608DeclContext::LoadLexicalDeclsFromExternalStorage()
const {
1618 Source->FindExternalLexicalDecls(
this, Decls);
1625 bool FieldsAlreadyLoaded =
false;
1626 if (
const auto *RD = dyn_cast<RecordDecl>(
this))
1627 FieldsAlreadyLoaded = RD->hasLoadedFieldsFromExternalStorage();
1631 Decl *ExternalFirst, *ExternalLast;
1632 std::tie(ExternalFirst, ExternalLast) =
1647 Map = DC->CreateStoredDeclsMap(Context);
1648 if (DC->hasNeedToReconcileExternalVisibleStorage())
1649 DC->reconcileExternalVisibleStorage();
1651 (*Map)[Name].removeExternalDecls();
1663 Map = DC->CreateStoredDeclsMap(Context);
1664 if (DC->hasNeedToReconcileExternalVisibleStorage())
1665 DC->reconcileExternalVisibleStorage();
1674 LoadLexicalDeclsFromExternalStorage();
1680 LoadLexicalDeclsFromExternalStorage();
1692 LoadLexicalDeclsFromExternalStorage();
1721 if (
auto *FD = dyn_cast<FunctionDecl>(D))
1722 if (FD->isFunctionTemplateSpecialization())
1737 "decl being removed from non-lexical context");
1739 "decl is not in decls list");
1748 for (
Decl *I =
FirstDecl;
true; I = I->NextInContextAndBits.getPointer()) {
1749 assert(I &&
"decl not found in linked list");
1750 if (I->NextInContextAndBits.getPointer() == D) {
1771 if (!ND->getDeclName())
1778 StoredDeclsMap::iterator Pos = Map->find(ND->getDeclName());
1779 assert(Pos != Map->end() &&
"no lookup entry for decl");
1786 }
while (DC->isTransparentContext() && (DC = DC->getParent()));
1792 "Decl inserted into wrong lexical context");
1794 "Decl already inserted into a DeclContext");
1797 LastDecl->NextInContextAndBits.setPointer(D);
1805 if (
auto *
Record = dyn_cast<CXXRecordDecl>(
this))
1811 if (
auto *Import = dyn_cast<ImportDecl>(D))
1819 if (
auto *ND = dyn_cast<NamedDecl>(D))
1820 ND->getDeclContext()->getPrimaryContext()->
1821 makeDeclVisibleInContextWithFlags(ND,
false,
true);
1827 if (
auto *ND = dyn_cast<NamedDecl>(D))
1828 ND->getDeclContext()->getPrimaryContext()->
1829 makeDeclVisibleInContextWithFlags(ND,
true,
true);
1842 if (!hasLazyLocalLexicalLookups() &&
1843 !hasLazyExternalLexicalLookups())
1849 if (hasLazyExternalLexicalLookups()) {
1850 setHasLazyExternalLexicalLookups(
false);
1851 for (
auto *DC : Contexts) {
1852 if (DC->hasExternalLexicalStorage()) {
1853 bool LoadedDecls = DC->LoadLexicalDeclsFromExternalStorage();
1854 setHasLazyLocalLexicalLookups(
1855 hasLazyLocalLexicalLookups() | LoadedDecls );
1859 if (!hasLazyLocalLexicalLookups())
1863 for (
auto *DC : Contexts)
1867 setHasLazyLocalLexicalLookups(
false);
1885 if (
auto *ND = dyn_cast<NamedDecl>(D))
1887 (!ND->isFromASTFile() ||
1890 makeDeclVisibleInContextImpl(ND,
Internal);
1895 if (
auto *InnerCtx = dyn_cast<DeclContext>(D))
1896 if (InnerCtx->isTransparentContext() || InnerCtx->isInlineNamespace())
1897 buildLookupImpl(InnerCtx,
Internal);
1914 "lookupImpl should only be called with primary DC!");
1916 "We shouldn't lookup in transparent DC.");
1926 assert(Source &&
"external visible storage but no external source?");
1928 if (hasNeedToReconcileExternalVisibleStorage())
1929 reconcileExternalVisibleStorage();
1933 if (hasLazyLocalLexicalLookups() ||
1934 hasLazyExternalLexicalLookups())
1942 std::pair<StoredDeclsMap::iterator, bool> R = Map->try_emplace(Name);
1943 if (!R.second && !R.first->second.hasExternalDecls())
1944 return R.first->second.getLookupResult();
1946 if (Source->FindExternalVisibleDeclsByName(
this, Name, OriginalLookupDC) ||
1949 StoredDeclsMap::iterator I = Map->find(Name);
1950 if (I != Map->end())
1951 return I->second.getLookupResult();
1959 if (hasLazyLocalLexicalLookups() ||
1960 hasLazyExternalLexicalLookups())
1966 StoredDeclsMap::iterator I = Map->find(Name);
1967 if (I == Map->end())
1970 return I->second.getLookupResult();
1980 if (PrimaryContext !=
this)
1983 loadLazyLocalLexicalLookups();
1988 StoredDeclsMap::iterator I = Map->find(Name);
1989 return I != Map->end() ? I->second.getLookupResult()
1996void DeclContext::loadLazyLocalLexicalLookups() {
1997 if (hasLazyLocalLexicalLookups()) {
2000 for (
auto *Context : Contexts)
2002 setHasLazyLocalLexicalLookups(
false);
2014 llvm::append_range(Results, LookupResults);
2015 if (!Results.empty())
2021 if (Name && !hasLazyLocalLexicalLookups() &&
2022 !hasLazyExternalLexicalLookups()) {
2024 StoredDeclsMap::iterator Pos = Map->find(Name);
2025 if (Pos != Map->end()) {
2026 Results.insert(Results.end(),
2027 Pos->second.getLookupResult().begin(),
2028 Pos->second.getLookupResult().end());
2038 for (
Decl *D =
FirstDecl; D; D = D->getNextDeclInContext()) {
2039 if (
auto *ND = dyn_cast<NamedDecl>(D))
2040 if (ND->getDeclName() == Name)
2041 Results.push_back(ND);
2053 bool SkipRecords =
getDeclKind() == Decl::Kind::Enum &&
2091 const auto *NS = dyn_cast<NamespaceDecl>(O);
2092 if (!NS || !NS->isInline())
2105 PrimaryDC->makeDeclVisibleInContextWithFlags(D,
false, PrimaryDC == DeclDC);
2115 ->makeDeclVisibleInContextWithFlags(D,
Internal, Recoverable);
2139 makeDeclVisibleInContextImpl(D,
Internal);
2141 setHasLazyLocalLexicalLookups(
true);
2148 makeDeclVisibleInContextWithFlags(D,
Internal, Recoverable);
2153 if (ASTMutationListener *L = DCAsDecl->getASTMutationListener())
2154 L->AddedVisibleDecl(
this, D);
2162 Map = CreateStoredDeclsMap(*
C);
2176 StoredDeclsList &DeclNameEntries = (*Map)[D->
getDeclName()];
2209 assert(!
LookupPtr &&
"context already has a decls map");
2211 "creating decls map on non-primary context");
2219 M->Previous =
C.LastSDM;
2220 C.LastSDM = llvm::PointerIntPair<StoredDeclsMap*,1>(M,
Dependent);
2225void ASTContext::ReleaseDeclContextMaps() {
2230 LastSDM.setPointer(
nullptr);
2236 llvm::PointerIntPair<StoredDeclsMap*,1>
Next = Map->Previous;
2243 Map =
Next.getPointer();
2252 &&
"cannot iterate dependent diagnostics of non-dependent context");
2255 Parent->CreateStoredDeclsMap(
C);
2268 DD->NextDiagnostic = Map->FirstDiagnostic;
2269 Map->FirstDiagnostic = DD;
2275 return ID & llvm::maskTrailingOnes<DeclID>(32);
Defines the clang::ASTContext interface.
#define BuiltinTemplate(BTName)
This file provides some common utility functions for processing Lambda related AST Constructs.
static bool shouldBeHidden(NamedDecl *D)
shouldBeHidden - Determine whether a declaration which was declared within its semantic context shoul...
static void collectAllContextsImpl(T *Self, SmallVectorImpl< DeclContext * > &Contexts)
static bool isLinkageSpecContext(const DeclContext *DC, LinkageSpecLanguageIDs ID)
static Decl::Kind getKind(const Decl *D)
static Decl * getNonClosureContext(T *D)
Starting at a given context (a Decl or DeclContext), look for a code context that is not a closure (a...
static AvailabilityResult CheckAvailability(ASTContext &Context, const AvailabilityAttr *A, std::string *Message, VersionTuple EnclosingVersion)
Determine the availability of the given declaration based on the target platform.
static StringRef getRealizedPlatform(const AvailabilityAttr *A, const ASTContext &Context)
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
This file defines OpenACC nodes for declarative directives.
This file defines OpenMP nodes for declarative directives.
Defines the C++ template declaration subclasses.
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
llvm::MachO::Record Record
Defines the clang::Module class, which describes a module in the source code.
Defines types useful for describing an Objective-C runtime.
Implements a partial diagnostic that can be emitted anwyhere in a DiagnosticBuilder stream.
Defines the clang::SourceLocation class and associated facilities.
static QualType getPointeeType(const MemRegion *R)
C Language Family Type Representation.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
const ConstantArrayType * getAsConstantArrayType(QualType T) const
ASTMutationListener * getASTMutationListener() const
Retrieve a pointer to the AST mutation listener associated with this AST context, if any.
const IncompleteArrayType * getAsIncompleteArrayType(QualType T) const
const LangOptions & getLangOpts() const
llvm::BumpPtrAllocator & getAllocator() const
void eraseDeclAttrs(const Decl *D)
Erase the attributes corresponding to the given declaration.
void addedLocalImportDecl(ImportDecl *Import)
Notify the AST context that a new import declaration has been parsed or implicitly created within thi...
ExternalASTSource * getExternalSource() const
Retrieve a pointer to the external AST source associated with this AST context, if any.
Module * getCurrentNamedModule() const
Get module under construction, nullptr if this is not a C++20 module.
AttrVec & getDeclAttrs(const Decl *D)
Retrieve the attributes for the given declaration.
An abstract interface that should be implemented by listeners that want to be notified when an AST en...
Attr - This represents one attribute.
Represents a block literal declaration, which is like an unnamed FunctionDecl.
decl_iterator - Iterates through the declarations stored within this context.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
DeclContext * getParent()
getParent - Returns the containing DeclContext.
udir_range using_directives() const
Returns iterator range [First, Last) of UsingDirectiveDecls stored within this context.
bool Equals(const DeclContext *DC) const
Determine whether this declaration context is equivalent to the declaration context DC.
bool isFileContext() const
void setHasExternalVisibleStorage(bool ES=true) const
State whether this DeclContext has external storage for declarations visible in this context.
void makeDeclVisibleInContext(NamedDecl *D)
Makes a declaration visible within this context.
DeclContextLookupResult lookup_result
static std::pair< Decl *, Decl * > BuildDeclChain(ArrayRef< Decl * > Decls, bool FieldsAlreadyLoaded)
Build up a chain of declarations.
bool isTransparentContext() const
isTransparentContext - Determines whether this context is a "transparent" context,...
Decl * getNonClosureAncestor()
Find the nearest non-closure ancestor of this context, i.e.
ASTContext & getParentASTContext() const
bool isExternCXXContext() const
Determines whether this context or some of its ancestors is a linkage specification context that spec...
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
bool InEnclosingNamespaceSetOf(const DeclContext *NS) const
Test if this context is part of the enclosing namespace set of the context NS, as defined in C++0x [n...
DeclContext * getLexicalParent()
getLexicalParent - Returns the containing lexical DeclContext.
lookup_result lookup(DeclarationName Name) const
lookup - Find the declarations (if any) with the given Name in this context.
bool isLookupContext() const
Test whether the context supports looking up names.
const BlockDecl * getInnermostBlockDecl() const
Return this DeclContext if it is a BlockDecl.
bool hasExternalVisibleStorage() const
Whether this DeclContext has external storage containing additional declarations that are visible in ...
const char * getDeclKindName() const
bool isTranslationUnit() const
void collectAllContexts(SmallVectorImpl< DeclContext * > &Contexts)
Collects all of the declaration contexts that are semantically connected to this declaration context.
DeclContext * getRedeclContext()
getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same ...
llvm::iterator_range< udir_iterator > udir_range
Decl * FirstDecl
FirstDecl - The first declaration stored within this declaration context.
DeclContext(Decl::Kind K)
void addDeclInternal(Decl *D)
Add the declaration D into this context, but suppress searches for external declarations with the sam...
bool containsDeclAndLoad(Decl *D) const
Checks whether a declaration is in this context.
void removeDecl(Decl *D)
Removes a declaration from this context.
void addDecl(Decl *D)
Add the declaration D into this context.
StoredDeclsMap * buildLookup()
Ensure the lookup structure is fully-built and return it.
bool hasValidDeclKind() const
bool isStdNamespace() const
lookup_result noload_lookup(DeclarationName Name)
Find the declarations with the given name that are visible within this context; don't attempt to retr...
static bool classof(const Decl *D)
bool containsDecl(Decl *D) const
Checks whether a declaration is in this context.
bool hasExternalLexicalStorage() const
Whether this DeclContext has external storage containing additional declarations that are lexically i...
void setUseQualifiedLookup(bool use=true) const
DeclContext * getEnclosingNamespaceContext()
Retrieve the nearest enclosing namespace context.
friend class ExternalASTSource
For reconcileExternalVisibleStorage, CreateStoredDeclsMap, hasNeedToReconcileExternalVisibleStorage.
Decl * LastDecl
LastDecl - The last declaration stored within this declaration context.
decl_range noload_decls() const
noload_decls_begin/end - Iterate over the declarations stored in this context that are currently load...
friend class DependentDiagnostic
For CreateStoredDeclsMap.
DeclContext * getPrimaryContext()
getPrimaryContext - There may be many different declarations of the same entity (including forward de...
RecordDecl * getOuterLexicalRecordContext()
Retrieve the outermost lexically enclosing record context.
bool isInlineNamespace() const
DeclContextBitfields DeclContextBits
bool isFunctionOrMethod() const
void setHasExternalLexicalStorage(bool ES=true) const
State whether this DeclContext has external storage for declarations lexically in this context.
DeclContext * getLookupParent()
Find the parent context of this context that will be used for unqualified name lookup.
StoredDeclsMap * LookupPtr
Pointer to the data structure used to lookup declarations within this context (or a DependentStoredDe...
bool isExternCContext() const
Determines whether this context or some of its ancestors is a linkage specification context that spec...
const LinkageSpecDecl * getExternCContext() const
Retrieve the nearest enclosing C linkage specification context.
bool Encloses(const DeclContext *DC) const
Determine whether this declaration context semantically encloses the declaration context DC.
void addHiddenDecl(Decl *D)
Add the declaration D to this context without modifying any lookup tables.
void localUncachedLookup(DeclarationName Name, SmallVectorImpl< NamedDecl * > &Results)
A simplistic name lookup mechanism that performs name lookup into this declaration context without co...
Decl::Kind getDeclKind() const
DeclContext * getNonTransparentContext()
decl_iterator decls_begin() const
bool LexicallyEncloses(const DeclContext *DC) const
Determine whether this declaration context lexically encloses the declaration context DC.
unsigned getLocalDeclIndex() const
Decl - This represents one declaration (or definition), e.g.
Decl * getMostRecentDecl()
Retrieve the most recent declaration that declares the same entity as this declaration (which may be ...
const DeclContext * getParentFunctionOrMethod(bool LexicalParent=false) const
If this decl is defined inside a function/method/block it returns the corresponding DeclContext,...
bool isInStdNamespace() const
bool isInCurrentModuleUnit() const
Whether this declaration comes from the same module unit being compiled.
TemplateDecl * getDescribedTemplate() const
If this is a declaration that describes some template, this method returns that template declaration.
bool isTemplateDecl() const
returns true if this declaration is a template
Module * getTopLevelOwningNamedModule() const
Get the top level owning named module that owns this declaration if any.
FriendObjectKind getFriendObjectKind() const
Determines whether this declaration is the object of a friend declaration and, if so,...
bool isModuleLocal() const
Whether this declaration was a local declaration to a C++20 named module.
bool isFromGlobalModule() const
Whether this declaration comes from global module.
static bool isFlexibleArrayMemberLike(const ASTContext &Context, const Decl *D, QualType Ty, LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel, bool IgnoreTemplateOrMacroSubstitution)
Whether it resembles a flexible array member.
ASTContext & getASTContext() const LLVM_READONLY
void setOwningModuleID(unsigned ID)
Set the owning module ID.
void setAttrs(const AttrVec &Attrs)
bool hasLocalOwningModuleStorage() const
bool isFunctionPointerType() const
bool isInNamedModule() const
Whether this declaration comes from a named module.
ExternalSourceSymbolAttr * getExternalSourceSymbolAttr() const
Looks on this and related declarations for an applicable external source symbol attribute.
bool isWeakImported() const
Determine whether this is a weak-imported symbol.
ModuleOwnershipKind getModuleOwnershipKind() const
Get the kind of module ownership for this declaration.
bool isParameterPack() const
Whether this declaration is a parameter pack.
ASTMutationListener * getASTMutationListener() const
unsigned getMaxAlignment() const
getMaxAlignment - return the maximum alignment specified by attributes on this decl,...
AvailabilityResult getAvailability(std::string *Message=nullptr, VersionTuple EnclosingVersion=VersionTuple(), StringRef *RealizedPlatform=nullptr) const
Determine the availability of the given declaration.
void setInvalidDecl(bool Invalid=true)
setInvalidDecl - Indicates the Decl had a semantic error.
Kind
Lists the kind of concrete classes of Decl.
static unsigned getIdentifierNamespaceForKind(Kind DK)
virtual Stmt * getBody() const
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
void markUsed(ASTContext &C)
Mark the declaration used, in the sense of odr-use.
bool isFileContextDecl() const
static Decl * castFromDeclContext(const DeclContext *)
Decl * getNextDeclInContext()
bool isTemplated() const
Determine whether this declaration is a templated entity (whether it is.
bool isInExportDeclContext() const
Whether this declaration was exported in a lexical context.
SourceLocation getBodyRBrace() const
getBodyRBrace - Gets the right brace of the body, if a body exists.
bool isReferenced() const
Whether any declaration of this entity was referenced.
const FunctionType * getFunctionType(bool BlocksToo=true) const
Looks through the Decl's underlying type to extract a FunctionType when possible.
bool isInAnotherModuleUnit() const
Whether this declaration comes from another module unit.
llvm::PointerIntPair< Decl *, 3, ModuleOwnershipKind > NextInContextAndBits
The next declaration within the same lexical DeclContext.
Module * getOwningModule() const
Get the module that owns this declaration (for visibility purposes).
unsigned getTemplateDepth() const
Determine the number of levels of template parameter surrounding this declaration.
bool isFromExplicitGlobalModule() const
Whether this declaration comes from explicit global module.
FunctionDecl * getAsFunction() LLVM_READONLY
Returns the function itself, or the templated function if this is a function template.
bool canBeWeakImported(bool &IsDefinition) const
Determines whether this symbol can be weak-imported, e.g., whether it would be well-formed to add the...
static DeclContext * castToDeclContext(const Decl *)
const TemplateParameterList * getDescribedTemplateParams() const
If this is a declaration that describes some template or partial specialization, this returns the cor...
bool isFromASTFile() const
Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...
bool isInLocalScopeForInstantiation() const
Determine whether a substitution into this declaration would occur as part of a substitution into a d...
const Attr * getDefiningAttr() const
Return this declaration's defining attribute if it has one.
bool isTemplateParameter() const
isTemplateParameter - Determines whether this declaration is a template parameter.
DeclContext * getNonTransparentDeclContext()
Return the non transparent context.
Decl * getNonClosureContext()
Find the innermost non-closure ancestor of this declaration, walking up through blocks,...
bool isInvalidDecl() const
unsigned getIdentifierNamespace() const
bool hasDefiningAttr() const
Return true if this declaration has an attribute which acts as definition of the entity,...
bool isLocalExternDecl() const
Determine whether this is a block-scope declaration with linkage.
void setAccess(AccessSpecifier AS)
const char * getDeclKindName() const
@ IDNS_Ordinary
Ordinary names.
@ IDNS_Type
Types, declared with 'struct foo', typedefs, etc.
@ IDNS_OMPReduction
This declaration is an OpenMP user defined reduction construction.
@ IDNS_Label
Labels, declared with 'x:' and referenced with 'goto x'.
@ IDNS_Member
Members, declared with object declarations within tag definitions.
@ IDNS_OMPMapper
This declaration is an OpenMP user defined mapper.
@ IDNS_ObjCProtocol
Objective C @protocol.
@ IDNS_Namespace
Namespaces, declared with 'namespace foo {}'.
@ IDNS_Using
This declaration is a using declaration.
@ IDNS_Tag
Tags, declared with 'struct foo;' and referenced with 'struct foo'.
bool isTemplateParameterPack() const
isTemplateParameter - Determines whether this declaration is a template parameter pack.
void setLocalOwningModule(Module *M)
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
void setIsUsed()
Set whether the declaration is used, in the sense of odr-use.
unsigned Access
Access - Used by C++ decls for the access specifier.
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required.
DeclContext * getDeclContext()
bool isInAnonymousNamespace() const
static void EnableStatistics()
TranslationUnitDecl * getTranslationUnitDecl()
VersionTuple getVersionIntroduced() const
Retrieve the version of the target platform in which this declaration was introduced.
bool hasOwningModule() const
Is this declaration owned by some module?
bool isFromHeaderUnit() const
Whether this declaration comes from a header unit.
void setDeclContext(DeclContext *DC)
setDeclContext - Set both the semantic and lexical DeclContext to DC.
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC).
void setLexicalDeclContext(DeclContext *DC)
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
@ VisibleWhenImported
This declaration has an owning module, and is visible when that module is imported.
@ ReachableWhenImported
This declaration has an owning module, and is visible to lookups that occurs within that module.
void setModuleOwnershipKind(ModuleOwnershipKind MOK)
Set whether this declaration is hidden from name lookup.
const LangOptions & getLangOpts() const LLVM_READONLY
Helper to get the language options from the ASTContext.
GlobalDeclID getGlobalID() const
Retrieve the global declaration ID associated with this declaration, which specifies where this Decl ...
unsigned getOwningModuleID() const
Retrieve the global ID of the module that owns this particular declaration.
bool shouldEmitInExternalSource() const
Whether the definition of the declaration should be emitted in external sources.
The name of a declaration.
A dependently-generated diagnostic.
static DependentDiagnostic * Create(ASTContext &Context, DeclContext *Parent, AccessNonce _, SourceLocation Loc, bool IsMemberAccess, AccessSpecifier AS, NamedDecl *TargetDecl, CXXRecordDecl *NamingClass, QualType BaseObjectType, const PartialDiagnostic &PDiag)
This represents one expression.
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
RAII class for safely pairing a StartedDeserializing call with FinishedDeserializing.
Abstract interface for external sources of AST nodes.
virtual ExtKind hasExternalDefinitions(const Decl *D)
static DeclContextLookupResult SetExternalVisibleDeclsForName(const DeclContext *DC, DeclarationName Name, ArrayRef< NamedDecl * > Decls)
static DeclContextLookupResult SetNoExternalVisibleDeclsForName(const DeclContext *DC, DeclarationName Name)
virtual Module * getModule(unsigned ID)
Retrieve the module that corresponds to the given module ID.
virtual bool FindExternalVisibleDeclsByName(const DeclContext *DC, DeclarationName Name, const DeclContext *OriginalDC)
Find all declarations with the given name in the given context, and add them to the context by callin...
Represents a member of a struct/union/class.
Represents a function declaration or definition.
FunctionType - C99 6.7.5.3 - Function Declarators.
One of these records is kept for each identifier that is lexed.
bool isStr(const char(&Str)[StrLen]) const
Return true if this is the identifier for the specified string.
StringRef getName() const
Return the actual identifier string.
StrictFlexArraysLevelKind
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
bool trackLocalOwningModule() const
Do we need to track the owning module for a local declaration?
Represents a linkage specification.
A pointer to member type per C++ 8.3.3 - Pointers to members.
Describes a module or submodule.
bool isExplicitGlobalModule() const
bool isGlobalModule() const
Does this Module scope describe a fragment of the global module within some C++ module.
bool isHeaderUnit() const
Is this module a header unit.
bool isNamedModule() const
Does this Module is a named module of a standard named module?
Module * getTopLevelModule()
Retrieve the top-level module for this (sub)module, which may be this module.
This represents a decl that may have a name.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Represent a C++ namespace.
The basic abstraction for the target Objective-C runtime.
bool hasWeakClassImport() const
Does this runtime support weakly importing classes?
PointerType - C99 6.7.5.1 - Pointer Declarators.
void print(raw_ostream &OS) const override
A (possibly-)qualified type.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
QualType getCanonicalType() const
Represents a struct/union/class.
specific_decl_iterator< FieldDecl > field_iterator
Base for LValueReferenceType and RValueReferenceType.
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
void print(raw_ostream &OS, const SourceManager &SM) const
Stmt - This represents one statement.
An array of decls optimized for the common case of only containing one entry.
void setHasExternalDecls()
void addOrReplaceDecl(NamedDecl *D)
If this is a redeclaration of an existing decl, replace the old one with D.
void prependDeclNoReplace(NamedDecl *D)
Add a declaration to the list without checking if it replaces anything.
void replaceExternalDecls(ArrayRef< NamedDecl * > Decls)
void remove(NamedDecl *D)
DeclContext::lookup_result getLookupResult() const
Return the list of all the decls.
static void DestroyAll(StoredDeclsMap *Map, bool Dependent)
The base class of all kinds of template declarations (e.g., class, function, etc.).
Stores a list of template parameters for a TemplateDecl and its derived classes.
The top declaration context.
ASTContext & getASTContext() const
Base wrapper for a particular "section" of type source info.
T getAs() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
T getAsAdjusted() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
A container of type source information.
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
bool isBlockPointerType() const
bool isFunctionReferenceType() const
bool isFunctionPointerType() const
const T * castAs() const
Member-template castAs<specific type>.
bool isMemberFunctionPointerType() const
const T * getAs() const
Member-template getAs<specific type>'.
Wrapper for source info for typedefs.
Represents C++ using-directive.
specific_attr_iterator - Iterates over a subrange of an AttrVec, only providing attributes that are o...
Defines the clang::TargetInfo interface.
The JSON file list parser is used to communicate input to InstallAPI.
bool isa(CodeGen::Address addr)
LinkageSpecLanguageIDs
Represents the language in a linkage specification.
@ Self
'self' clause, allowed on Compute and Combined Constructs, plus 'update'.
SmallVector< Attr *, 4 > AttrVec
AttrVec - A vector of Attr, which is how they are stored on the AST.
@ Dependent
Parse the block as a dependent block, which may be used in some template instantiations but not other...
@ Internal
Internal linkage, which indicates that the entity can be referred to from within the translation unit...
bool isLambdaCallOperator(const CXXMethodDecl *MD)
@ Result
The result type of a method or function.
const FunctionProtoType * T
@ FunctionTemplate
The name was classified as a function template name.
@ Concept
The name was classified as a concept name.
@ VarTemplate
The name was classified as a variable template name.
AvailabilityResult
Captures the result of checking the availability of a declaration.
U cast(CodeGen::Address addr)
@ Enum
The "enum" keyword introduces the elaborated-type-specifier.
UsingDirectiveDecl * operator*() const