;
56#define DECL(DERIVED, BASE) static int n##DERIVED##s = 0; 57#define ABSTRACT_DECL(DECL) 58#include "clang/AST/DeclNodes.inc" 64#define DECL(DERIVED, BASE) \ 65 static_assert(alignof(Decl) >= alignof(DERIVED##Decl), \ 66 "Alignment sufficient after objects prepended to "#DERIVED);
67#define ABSTRACT_DECL(DECL) 68#include "clang/AST/DeclNodes.inc" 70void*Decl::operator
new(std::size_t Size,
const ASTContext&Context,
74 static_assert(
sizeof(uint64_t) >=
alignof(
Decl),
"Decl won't be misaligned");
75 void*Start = Context.
Allocate(Size + Extra + 8);
76 void*
Result= (
char*)Start + 8;
78uint64_t *PrefixPtr = (uint64_t *)
Result- 1;
80*PrefixPtr = ID.getRawValue();
84assert(*PrefixPtr < llvm::maskTrailingOnes<uint64_t>(48));
89void*Decl::operator
new(std::size_t Size,
const ASTContext&Ctx,
91assert(!
Parent|| &
Parent->getParentASTContext() == &Ctx);
99llvm::offsetToAlignment(
sizeof(
Module*), llvm::Align(
alignof(
Decl)));
100 auto*Buffer =
reinterpret_cast<char*
>(
101::operator
new(ExtraAlign +
sizeof(
Module*) + Size + Extra, Ctx));
102Buffer += ExtraAlign;
104 Parent? cast<Decl>(
Parent)->getOwningModule() :
nullptr;
105 return new(Buffer)
Module*(ParentModule) + 1;
107return ::operator
new(Size + Extra, Ctx);
114uint64_t ID = *((
constuint64_t *)
this- 1);
115 return GlobalDeclID(ID & llvm::maskTrailingOnes<uint64_t>(48));
122uint64_t ID = *((
constuint64_t *)
this- 1);
127assert(
isFromASTFile() &&
"Only works on a deserialized declaration");
128uint64_t *IDAddress = (uint64_t *)
this- 1;
129*IDAddress &= llvm::maskTrailingOnes<uint64_t>(48);
130*IDAddress |= (uint64_t)ID << 48;
141Module*Decl::getOwningModuleSlow()
const{
152 default: llvm_unreachable(
"Declaration not in DeclNodes.inc!");
153#define DECL(DERIVED, BASE) case DERIVED: return #DERIVED; 154#define ABSTRACT_DECL(DECL) 155#include "clang/AST/DeclNodes.inc" 161assert(!isa<TagDecl>(
this) || !cast<TagDecl>(
this)->isCompleteDefinition());
166 if(!isa<ParmVarDecl>(
this)) {
175 if(
auto*DD = dyn_cast<DecompositionDecl>(
this)) {
176 for(
auto*Binding : DD->bindings()) {
177Binding->setInvalidDecl();
184#define DECL(DERIVED, BASE) case Decl::DERIVED: return true; 185#define ABSTRACT_DECL(DECL) 186#include "clang/AST/DeclNodes.inc" 193#define DECL(DERIVED, BASE) case Decl::DERIVED: return #DERIVED; 194#define ABSTRACT_DECL(DECL) 195#include "clang/AST/DeclNodes.inc" 197llvm_unreachable(
"Declaration context not in DeclNodes.inc!");
200boolDecl::StatisticsEnabled =
false;
202StatisticsEnabled =
true;
206llvm::errs() <<
"\n*** Decl Stats:\n";
209#define DECL(DERIVED, BASE) totalDecls += n##DERIVED##s; 210#define ABSTRACT_DECL(DECL) 211#include "clang/AST/DeclNodes.inc" 212llvm::errs() <<
" "<< totalDecls <<
" decls total.\n";
215#define DECL(DERIVED, BASE) \ 216 if (n##DERIVED##s > 0) { \ 217 totalBytes += (int)(n##DERIVED##s * sizeof(DERIVED##Decl)); \ 218 llvm::errs() << " "<< n##DERIVED##s << " " #DERIVED " decls, " \
219<< sizeof(DERIVED##Decl) << " each (" \
220<< n##DERIVED##s * sizeof(DERIVED##Decl) \
223#define ABSTRACT_DECL(DECL) 224#include "clang/AST/DeclNodes.inc" 226llvm::errs() <<
"Total bytes = "<< totalBytes <<
"\n";
231#define DECL(DERIVED, BASE) case DERIVED: ++n##DERIVED##s; break; 232#define ABSTRACT_DECL(DECL) 233#include "clang/AST/DeclNodes.inc" 238 if(
const auto*TTP = dyn_cast<TemplateTypeParmDecl>(
this))
239 returnTTP->isParameterPack();
240 if(
const auto*NTTP = dyn_cast<NonTypeTemplateParmDecl>(
this))
241 returnNTTP->isParameterPack();
242 if(
const auto*TTP = dyn_cast<TemplateTemplateParmDecl>(
this))
243 returnTTP->isParameterPack();
248 if(
const auto*Var = dyn_cast<ValueDecl>(
this))
249 returnVar->isParameterPack();
255 if(
auto*FD = dyn_cast<FunctionDecl>(
this))
257 if(
const auto*FTD = dyn_cast<FunctionTemplateDecl>(
this))
258 returnFTD->getTemplatedDecl();
263 returnisa<TemplateDecl>(
this);
267 if(
auto*FD = dyn_cast<FunctionDecl>(
this))
268 returnFD->getDescribedFunctionTemplate();
269 if(
auto*RD = dyn_cast<CXXRecordDecl>(
this))
270 returnRD->getDescribedClassTemplate();
271 if(
auto*VD = dyn_cast<VarDecl>(
this))
272 returnVD->getDescribedVarTemplate();
273 if(
auto*AD = dyn_cast<TypeAliasDecl>(
this))
274 returnAD->getDescribedAliasTemplate();
281 returnTD->getTemplateParameters();
282 if(
auto*CTPSD = dyn_cast<ClassTemplatePartialSpecializationDecl>(
this))
283 returnCTPSD->getTemplateParameters();
284 if(
auto*VTPSD = dyn_cast<VarTemplatePartialSpecializationDecl>(
this))
285 returnVTPSD->getTemplateParameters();
293 if(
auto*AsDC = dyn_cast<DeclContext>(
this))
294 returnAsDC->isDependentContext();
302 if(
auto*DC = dyn_cast<DeclContext>(
this))
303 if(DC->isFileContext())
307 returnTPL->getDepth() + 1;
312 auto*RD = dyn_cast<CXXRecordDecl>(
this);
313 if(RD && RD->isDependentLambda())
314 if(
Decl*Context = RD->getLambdaContextDecl())
315 returnContext->getTemplateDepth();
319 returncast<Decl>(DC)->getTemplateDepth();
326 if(DC->isFunctionOrMethod())
342TheLoc.
print(OS, SM);
348 if(
const auto*DN = dyn_cast_or_null<NamedDecl>(TheDecl)) {
350DN->printQualifiedName(OS);
374getMultipleDC()->LexicalDC = DC;
388 "hidden declaration has no owning module");
393 if(SemaDC == LexicalDC) {
396 auto*MDC =
new(Ctx) Decl::MultipleDC();
397MDC->SemanticDC = SemaDC;
398MDC->LexicalDC = LexicalDC;
410 if(!isa<TagDecl>(LDC))
412 if(
const auto*CRD = dyn_cast<CXXRecordDecl>(LDC))
422 if(
const auto*ND = dyn_cast<NamespaceDecl>(DC))
423 if(ND->isAnonymousNamespace())
436 const auto*DC = dyn_cast<DeclContext>(
this);
437 returnDC && DC->isFileContext();
443 boolIgnoreTemplateOrMacroSubstitution) {
450llvm::APInt Size = CAT->getSize();
451 if(StrictFlexArraysLevel == FAMKind::IncompleteOnly)
458 if(StrictFlexArraysLevel == FAMKind::ZeroOrIncomplete && Size.uge(1))
461 if(StrictFlexArraysLevel == FAMKind::OneZeroOrIncomplete && Size.uge(2))
467 if(
const auto*OID = dyn_cast_if_present<ObjCIvarDecl>(
D))
468 returnOID->getNextIvar() ==
nullptr;
470 const auto*FD = dyn_cast_if_present<FieldDecl>(
D);
477llvm::APInt Size = CAT->getSize();
478 if(FD->getParent()->isUnion() && (Size.isZero() || Size.isOne()))
484 if(IgnoreTemplateOrMacroSubstitution) {
497 if(
const Expr*SizeExpr =
498dyn_cast_if_present<IntegerLiteral>(CTL.getSizeExpr());
510 return++FI == FD->getParent()->field_end();
514 if(
auto*TUD = dyn_cast<TranslationUnitDecl>(
this))
518assert(DC &&
"This decl is not contained in a translation unit!");
522assert(DC &&
"This decl is not contained in a translation unit!");
525 returncast<TranslationUnitDecl>(DC);
550 for(; I !=
E; ++I) {
551 if(!I->isAlignmentErrorDependent())
552Align = std::max(Align, I->getAlignment(Ctx));
576 if(
C.getASTMutationListener())
577 C.getASTMutationListener()->DeclarationMarkedUsed(
this);
587 for(
const auto*I :
redecls())
596 if(
auto*ID = dyn_cast<ObjCInterfaceDecl>(
this)) {
598}
else if(
auto*PD = dyn_cast<ObjCProtocolDecl>(
this)) {
600}
else if(
auto*TD = dyn_cast<TagDecl>(
this)) {
606 if(
auto*
attr=
Definition->getAttr<ExternalSourceSymbolAttr>())
609 returndcd->getAttr<ExternalSourceSymbolAttr>();
616 returnhasAttr<AliasAttr>() || hasAttr<IFuncAttr>() ||
617hasAttr<LoaderUninitializedAttr>();
621 if(
auto*AA = getAttr<AliasAttr>())
623 if(
auto*IFA = getAttr<IFuncAttr>())
625 if(
auto*NZA = getAttr<LoaderUninitializedAttr>())
634StringRef RealizedPlatform = A->getPlatform()->getName();
636 returnRealizedPlatform;
637 size_tsuffix = RealizedPlatform.rfind(
"_app_extension");
638 if(suffix != StringRef::npos)
639 returnRealizedPlatform.slice(0, suffix);
640 returnRealizedPlatform;
653 constAvailabilityAttr *A,
654std::string *Message,
655VersionTuple EnclosingVersion) {
656 if(EnclosingVersion.empty())
659 if(EnclosingVersion.empty())
662StringRef ActualPlatform = A->getPlatform()->getName();
669StringRef PrettyPlatformName
670= AvailabilityAttr::getPrettyPlatformName(ActualPlatform);
672 if(PrettyPlatformName.empty())
673PrettyPlatformName = ActualPlatform;
675std::string HintMessage;
676 if(!A->getMessage().empty()) {
677HintMessage =
" - ";
678HintMessage += A->getMessage();
682 if(A->getUnavailable()) {
685llvm::raw_string_ostream Out(*Message);
686Out <<
"not available on "<< PrettyPlatformName
694 if(!A->getIntroduced().empty() &&
695EnclosingVersion < A->getIntroduced()) {
697StringRef TargetEnv =
699StringRef EnvName = llvm::Triple::getEnvironmentTypeName(
702 if(!IIEnv || (!TargetEnv.empty() && IIEnv->
getName() == TargetEnv)) {
705llvm::raw_string_ostream Out(*Message);
706VersionTuple VTI(A->getIntroduced());
707Out <<
"introduced in "<< PrettyPlatformName <<
" "<< VTI <<
" " 708<< EnvName << HintMessage;
715llvm::raw_string_ostream Out(*Message);
716Out <<
"not available on "<< PrettyPlatformName <<
" "<< EnvName
725 if(!A->getObsoleted().empty() && EnclosingVersion >= A->getObsoleted()) {
728llvm::raw_string_ostream Out(*Message);
729VersionTuple VTO(A->getObsoleted());
730Out <<
"obsoleted in "<< PrettyPlatformName <<
' ' 731<< VTO << HintMessage;
738 if(!A->getDeprecated().empty() && EnclosingVersion >= A->getDeprecated()) {
741llvm::raw_string_ostream Out(*Message);
742VersionTuple VTD(A->getDeprecated());
743Out <<
"first deprecated in "<< PrettyPlatformName <<
' ' 744<< VTD << HintMessage;
754VersionTuple EnclosingVersion,
755StringRef *RealizedPlatform)
const{
756 if(
auto*FTD = dyn_cast<FunctionTemplateDecl>(
this))
757 returnFTD->getTemplatedDecl()->getAvailability(Message, EnclosingVersion,
761std::string ResultMessage;
763 for(
const auto*A :
attrs()) {
764 if(
const auto*Deprecated = dyn_cast<DeprecatedAttr>(A)) {
769ResultMessage = std::string(Deprecated->getMessage());
775 if(
const auto*Unavailable = dyn_cast<UnavailableAttr>(A)) {
777*Message = std::string(Unavailable->getMessage());
781 if(
const auto*Availability = dyn_cast<AvailabilityAttr>(A)) {
783Message, EnclosingVersion);
786 if(RealizedPlatform)
787*RealizedPlatform = Availability->getPlatform()->getName();
794ResultMessage.swap(*Message);
801Message->swap(ResultMessage);
808 for(
const auto*A :
attrs()) {
809 if(
const auto*Availability = dyn_cast<AvailabilityAttr>(A)) {
812 if(!Availability->getIntroduced().empty())
813 returnAvailability->getIntroduced();
820IsDefinition =
false;
823 if(
const auto*Var = dyn_cast<VarDecl>(
this)) {
824 if(Var->isThisDeclarationADefinition()) {
825IsDefinition =
true;
831 if(
const auto*FD = dyn_cast<FunctionDecl>(
this)) {
833IsDefinition =
true;
840 if(isa<ObjCInterfaceDecl>(
this) &&
854 if(isa<WeakImportAttr>(A))
857 if(
const auto*Availability = dyn_cast<AvailabilityAttr>(A)) {
870 caseCXXDeductionGuide:
873 caseConstructorUsingShadow:
889 caseNonTypeTemplateParm:
896 caseObjCCompatibleAlias:
902 caseTemplateTypeParm:
906 caseUnresolvedUsingTypename:
912 caseUnresolvedUsingValue:
925 caseObjCAtDefsField:
938 caseFunctionTemplate:
942 caseTemplateTemplateParm:
943 caseTypeAliasTemplate:
946 caseUnresolvedUsingIfExists:
949 caseOMPDeclareReduction:
952 caseOMPDeclareMapper:
964 caseObjCPropertyImpl:
966 casePragmaDetectMismatch:
969 caseOutlinedFunction:
970 caseTranslationUnit:
974 caseUnnamedGlobalConstant:
975 caseTemplateParamObject:
978 caseBuiltinTemplate:
979 caseClassTemplateSpecialization:
980 caseClassTemplatePartialSpecialization:
981 caseVarTemplateSpecialization:
982 caseVarTemplatePartialSpecialization:
983 caseObjCImplementation:
985 caseObjCCategoryImpl:
987 caseOMPThreadPrivate:
990 caseOMPCapturedExpr:
992 caseLifetimeExtendedTemporary:
993 caseRequiresExprBody:
994 caseImplicitConceptSpecialization:
999llvm_unreachable(
"Invalid DeclKind!");
1003assert(!HasAttrs &&
"Decl already contains attrs.");
1006assert(AttrBlank.empty() &&
"HasAttrs was wrong?");
1013 if(!HasAttrs)
return;
1034 autoI = Attrs.begin(),
E= Attrs.end();
1035 for(; I !=
E; ++I) {
1036 if(!(*I)->isInherited())
1043assert(HasAttrs &&
"No attrs to get!");
1050#define DECL(NAME, BASE) 1051#define DECL_CONTEXT(NAME) \ 1053 return static_cast<NAME##Decl *>(const_cast<DeclContext *>(D)); 1054#include "clang/AST/DeclNodes.inc" 1056llvm_unreachable(
"a decl that inherits DeclContext isn't handled");
1063#define DECL(NAME, BASE) 1064#define DECL_CONTEXT(NAME) \ 1066 return static_cast<NAME##Decl *>(const_cast<Decl *>(D)); 1067#include "clang/AST/DeclNodes.inc" 1069llvm_unreachable(
"a decl that inherits DeclContext isn't handled");
1076 if(
const auto*FD = dyn_cast<FunctionDecl>(
this)) {
1079 return Definition->getSourceRange().getEnd();
1084 returnBody->getSourceRange().getEnd();
1089boolDecl::AccessDeclContextCheck()
const{
1100 if(isa<TranslationUnitDecl>(
this) || isa<TemplateTypeParmDecl>(
this) ||
1103isa<StaticAssertDecl>(
this) || isa<BlockDecl>(
this) ||
1106isa<ParmVarDecl>(
this) ||
1109isa<CXXRecordDecl>(
this) || isa<LifetimeExtendedTemporaryDecl>(
this))
1113 "Access specifier is AS_none inside a record decl");
1121 while(DC && !isa<ExportDecl>(DC))
1124 returnisa_and_nonnull<ExportDecl>(DC);
1141M = M->getTopLevelModule();
1142 if(!M->isNamedModule())
1151 if(!M || !M->isNamedModule())
1190 if(
const auto*
D= dyn_cast<ValueDecl>(
this))
1192 else if(
const auto*
D= dyn_cast<TypedefNameDecl>(
this))
1193Ty =
D->getUnderlyingType();
1200assert(isa<BindingDecl>(
this));
1218 if(
const auto*
D= dyn_cast<ValueDecl>(
this))
1220 else if(
const auto*
D= dyn_cast<TypedefNameDecl>(
this))
1221Ty =
D->getUnderlyingType();
1236 if(
getKind(
D) == Decl::CXXMethod) {
1237 auto*MD = cast<CXXMethodDecl>(
D);
1238 if(MD->getOverloadedOperator() == OO_Call &&
1239MD->getParent()->isLambda())
1243 if(
auto*FD = dyn_cast<FunctionDecl>(
D))
1245 if(
auto*MD = dyn_cast<ObjCMethodDecl>(
D))
1247 if(
auto*BD = dyn_cast<BlockDecl>(
D))
1249 if(
auto*CD = dyn_cast<CapturedDecl>(
D))
1251 if(
auto*OFD = dyn_cast<OutlinedFunctionDecl>(
D))
1257return ::getNonClosureContext(
this);
1261return ::getNonClosureContext(
this);
1272setNeedToReconcileExternalVisibleStorage(
false);
1273setHasLazyLocalLexicalLookups(
false);
1274setHasLazyExternalLexicalLookups(
false);
1281#define DECL(NAME, BASE) 1282#define DECL_CONTEXT(NAME) case Decl::NAME: 1283#include "clang/AST/DeclNodes.inc" 1300 if(isa<FunctionDecl>(
this))
1318 if(Ctx->isClosure())
1319 returncast<BlockDecl>(Ctx);
1320Ctx = Ctx->getParent();
1328cast<NamespaceDecl>(
this)->isInline();
1335 const auto*ND = cast<NamespaceDecl>(
this);
1336 if(ND->isInline()) {
1337 returnND->getParent()->isStdNamespace();
1344 returnII && II->
isStr(
"std");
1351 if(isa<ClassTemplatePartialSpecializationDecl>(
this))
1354 if(
const auto*
Record= dyn_cast<CXXRecordDecl>(
this)) {
1355 if(
Record->getDescribedClassTemplate())
1358 if(
Record->isDependentLambda())
1360 if(
Record->isNeverDependentLambda())
1364 if(
const auto*
Function= dyn_cast<FunctionDecl>(
this)) {
1365 if(
Function->getDescribedFunctionTemplate())
1370 if(cast<Decl>(
this)->getFriendObjectKind())
1383 return!cast<EnumDecl>(
this)->isScoped();
1385 returnisa<LinkageSpecDecl, ExportDecl, HLSLBufferDecl>(
this);
1390 while(DC->
getDeclKind() != Decl::TranslationUnit) {
1392 returncast<LinkageSpecDecl>(DC)->getLanguage() == ID;
1404 while(DC->
getDeclKind() != Decl::TranslationUnit) {
1407 returncast<LinkageSpecDecl>(DC);
1422 if(!isa<LinkageSpecDecl>(DC) && !isa<ExportDecl>(DC) &&
1432assert(DC &&
"All transparent contexts should have a parent!");
1439 caseDecl::ExternCContext:
1440 caseDecl::LinkageSpec:
1442 caseDecl::TopLevelStmt:
1444 caseDecl::Captured:
1445 caseDecl::OutlinedFunction:
1446 caseDecl::OMPDeclareReduction:
1447 caseDecl::OMPDeclareMapper:
1448 caseDecl::RequiresExprBody:
1452 caseDecl::HLSLBuffer:
1461 caseDecl::TranslationUnit:
1463 caseDecl::Namespace:
1464 return static_cast<NamespaceDecl*
>(
this)->getFirstDecl();
1466 caseDecl::ObjCMethod:
1469 caseDecl::ObjCInterface:
1470 if(
auto*OID = dyn_cast<ObjCInterfaceDecl>(
this))
1471 if(
auto*Def = OID->getDefinition())
1475 caseDecl::ObjCProtocol:
1476 if(
auto*OPD = dyn_cast<ObjCProtocolDecl>(
this))
1477 if(
auto*Def = OPD->getDefinition())
1481 caseDecl::ObjCCategory:
1484 caseDecl::ObjCImplementation:
1485 caseDecl::ObjCCategoryImpl:
1492 auto*Tag = cast<TagDecl>(
this);
1494 if(
TagDecl*Def = Tag->getDefinition())
1497 if(
const auto*TagTy = dyn_cast<TagType>(Tag->getTypeForDecl())) {
1499 TagDecl*PossiblePartialDef = TagTy->getDecl();
1501 returnPossiblePartialDef;
1503assert(isa<InjectedClassNameType>(Tag->getTypeForDecl()));
1511 "Unknown DeclContext kind");
1516template<
typenameT>
1520Contexts.push_back(
D);
1522std::reverse(Contexts.begin(), Contexts.end());
1530 if(Kind == Decl::TranslationUnit)
1532 else if(Kind == Decl::Namespace)
1535Contexts.push_back(
this);
1538std::pair<Decl *, Decl *>
1540 boolFieldsAlreadyLoaded) {
1542 Decl*FirstNewDecl =
nullptr;
1543 Decl*PrevDecl =
nullptr;
1544 for(
auto*
D: Decls) {
1545 if(FieldsAlreadyLoaded && isa<FieldDecl>(
D))
1556 returnstd::make_pair(FirstNewDecl, PrevDecl);
1562voidDeclContext::reconcileExternalVisibleStorage()
const{
1563assert(hasNeedToReconcileExternalVisibleStorage() &&
LookupPtr);
1564setNeedToReconcileExternalVisibleStorage(
false);
1567Lookup.second.setHasExternalDecls();
1574DeclContext::LoadLexicalDeclsFromExternalStorage()
const{
1591 boolFieldsAlreadyLoaded =
false;
1592 if(
const auto*RD = dyn_cast<RecordDecl>(
this))
1593FieldsAlreadyLoaded = RD->hasLoadedFieldsFromExternalStorage();
1597 Decl*ExternalFirst, *ExternalLast;
1598std::tie(ExternalFirst, ExternalLast) =
1613Map = DC->CreateStoredDeclsMap(Context);
1614 if(DC->hasNeedToReconcileExternalVisibleStorage())
1615DC->reconcileExternalVisibleStorage();
1617(*Map)[Name].removeExternalDecls();
1629Map = DC->CreateStoredDeclsMap(Context);
1630 if(DC->hasNeedToReconcileExternalVisibleStorage())
1631DC->reconcileExternalVisibleStorage();
1634List.replaceExternalDecls(Decls);
1635 returnList.getLookupResult();
1640LoadLexicalDeclsFromExternalStorage();
1646LoadLexicalDeclsFromExternalStorage();
1658LoadLexicalDeclsFromExternalStorage();
1666 if(!
D->getDeclName())
1685 if(isa<ClassTemplateSpecializationDecl>(
D))
1687 if(
auto*FD = dyn_cast<FunctionDecl>(
D))
1688 if(FD->isFunctionTemplateSpecialization())
1703 "decl being removed from non-lexical context");
1705 "decl is not in decls list");
1715assert(I &&
"decl not found in linked list");
1716 if(I->NextInContextAndBits.getPointer() ==
D) {
1728 if(isa<NamedDecl>(
D)) {
1729 auto*ND = cast<NamedDecl>(
D);
1737 if(!ND->getDeclName())
1744StoredDeclsMap::iterator Pos = Map->find(ND->getDeclName());
1745assert(Pos != Map->end() &&
"no lookup entry for decl");
1752}
while(DC->isTransparentContext() && (DC = DC->getParent()));
1758 "Decl inserted into wrong lexical context");
1760 "Decl already inserted into a DeclContext");
1771 if(
auto*
Record= dyn_cast<CXXRecordDecl>(
this))
1777 if(
auto*Import = dyn_cast<ImportDecl>(
D))
1785 if(
auto*ND = dyn_cast<NamedDecl>(
D))
1786ND->getDeclContext()->getPrimaryContext()->
1787makeDeclVisibleInContextWithFlags(ND,
false,
true);
1793 if(
auto*ND = dyn_cast<NamedDecl>(
D))
1794ND->getDeclContext()->getPrimaryContext()->
1795makeDeclVisibleInContextWithFlags(ND,
true,
true);
1806assert(
this==
getPrimaryContext() &&
"buildLookup called on non-primary DC");
1808 if(!hasLazyLocalLexicalLookups() &&
1809!hasLazyExternalLexicalLookups())
1815 if(hasLazyExternalLexicalLookups()) {
1816setHasLazyExternalLexicalLookups(
false);
1817 for(
auto*DC : Contexts) {
1818 if(DC->hasExternalLexicalStorage()) {
1819 boolLoadedDecls = DC->LoadLexicalDeclsFromExternalStorage();
1820setHasLazyLocalLexicalLookups(
1821hasLazyLocalLexicalLookups() | LoadedDecls );
1825 if(!hasLazyLocalLexicalLookups())
1829 for(
auto*DC : Contexts)
1833setHasLazyLocalLexicalLookups(
false);
1851 if(
auto*ND = dyn_cast<NamedDecl>(
D))
1853(!ND->isFromASTFile() ||
1856makeDeclVisibleInContextImpl(ND,
Internal);
1861 if(
auto*InnerCtx = dyn_cast<DeclContext>(
D))
1862 if(InnerCtx->isTransparentContext() || InnerCtx->isInlineNamespace())
1863buildLookupImpl(InnerCtx,
Internal);
1880 "lookupImpl should only be called with primary DC!");
1882 "We shouldn't lookup in transparent DC.");
1889(void)cast<Decl>(
this)->getMostRecentDecl();
1892assert(Source &&
"external visible storage but no external source?");
1894 if(hasNeedToReconcileExternalVisibleStorage())
1895reconcileExternalVisibleStorage();
1899 if(hasLazyLocalLexicalLookups() ||
1900hasLazyExternalLexicalLookups())
1908std::pair<StoredDeclsMap::iterator, bool> R =
1910 if(!R.second && !R.first->second.hasExternalDecls())
1911 returnR.first->second.getLookupResult();
1916StoredDeclsMap::iterator I = Map->find(Name);
1917 if(I != Map->end())
1918 returnI->second.getLookupResult();
1926 if(hasLazyLocalLexicalLookups() ||
1927hasLazyExternalLexicalLookups())
1933StoredDeclsMap::iterator I = Map->find(Name);
1934 if(I == Map->end())
1937 returnI->second.getLookupResult();
1947 if(PrimaryContext !=
this)
1950loadLazyLocalLexicalLookups();
1955StoredDeclsMap::iterator I = Map->find(Name);
1956 returnI != Map->end() ? I->second.getLookupResult()
1963voidDeclContext::loadLazyLocalLexicalLookups() {
1964 if(hasLazyLocalLexicalLookups()) {
1967 for(
auto*Context : Contexts)
1969setHasLazyLocalLexicalLookups(
false);
1981Results.insert(Results.end(), LookupResults.
begin(), LookupResults.
end());
1982 if(!Results.empty())
1988 if(Name && !hasLazyLocalLexicalLookups() &&
1989!hasLazyExternalLexicalLookups()) {
1991StoredDeclsMap::iterator Pos = Map->find(Name);
1992 if(Pos != Map->end()) {
1993Results.insert(Results.end(),
1994Pos->second.getLookupResult().begin(),
1995Pos->second.getLookupResult().end());
2006 if(
auto*ND = dyn_cast<NamedDecl>(
D))
2007 if(ND->getDeclName() == Name)
2008Results.push_back(ND);
2020 boolSkipRecords =
getDeclKind() == Decl::Kind::Enum &&
2025 while((SkipRecords && Ctx->isRecord()) || Ctx->isTransparentContext())
2026Ctx = Ctx->getParent();
2033 while(!Ctx->isFileContext())
2034Ctx = Ctx->getParent();
2035 returnCtx->getPrimaryContext();
2043OutermostRD = cast<RecordDecl>(DC);
2052 returnO->
Equals(
this);
2058 const auto*NS = dyn_cast<NamespaceDecl>(O);
2059 if(!NS || !NS->isInline())
2072PrimaryDC->makeDeclVisibleInContextWithFlags(
D,
false, PrimaryDC == DeclDC);
2082->makeDeclVisibleInContextWithFlags(
D,
Internal, Recoverable);
2106makeDeclVisibleInContextImpl(
D,
Internal);
2108setHasLazyLocalLexicalLookups(
true);
2115makeDeclVisibleInContextWithFlags(
D,
Internal, Recoverable);
2117 auto*DCAsDecl = cast<Decl>(
this);
2119 if(!(isa<TagDecl>(DCAsDecl) && cast<TagDecl>(DCAsDecl)->isBeingDefined()))
2121L->AddedVisibleDecl(
this,
D);
2129Map = CreateStoredDeclsMap(*
C);
2139Map->find(
D->getDeclName()) == Map->end())
2160 returncast<UsingDirectiveDecl>(*I);
2177assert(!
LookupPtr&&
"context already has a decls map");
2179 "creating decls map on non-primary context");
2187M->Previous =
C.LastSDM;
2188 C.LastSDM = llvm::PointerIntPair<StoredDeclsMap*,1>(M,
Dependent);
2193voidASTContext::ReleaseDeclContextMaps() {
2198LastSDM.setPointer(
nullptr);
2204llvm::PointerIntPair<StoredDeclsMap*,1> Next = Map->Previous;
2211Map = Next.getPointer();
2219assert(
Parent->isDependentContext()
2220&&
"cannot iterate dependent diagnostics of non-dependent context");
2222 if(!
Parent->LookupPtr)
2223 Parent->CreateStoredDeclsMap(
C);
2236DD->NextDiagnostic = Map->FirstDiagnostic;
2237Map->FirstDiagnostic = DD;
2243 returnID & llvm::maskTrailingOnes<DeclID>(32);
Defines the clang::ASTContext interface.
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 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...
void * Allocate(size_t Size, unsigned Align=8) const
const TargetInfo & getTargetInfo() const
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.
The results of name lookup within a DeclContext.
decl_iterator - Iterates through the declarations stored within this context.
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext,...
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.
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 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
unsigned getLocalDeclIndex() const
Decl - This represents one declaration (or definition), e.g.
Decl * getPreviousDecl()
Retrieve the previous declaration that declares the same entity as this declaration,...
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 isFromGlobalModule() const
Whether this declaration comes from global module.
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)
SourceLocation getLocation() const
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 updateOutOfDate(IdentifierInfo &II) const
Update a potentially out-of-date declaration.
static bool isFlexibleArrayMemberLike(ASTContext &Context, const Decl *D, QualType Ty, LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel, bool IgnoreTemplateOrMacroSubstitution)
Whether it resembles a flexible array member.
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.
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...
virtual void updateOutOfDateIdentifier(const IdentifierInfo &II)
Update an out-of-date identifier.
virtual void FindExternalLexicalDecls(const DeclContext *DC, llvm::function_ref< bool(Decl::Kind)> IsKindWeWant, SmallVectorImpl< Decl * > &Result)
Finds all declarations lexically contained within the given DeclContext, after applying an optional f...
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.
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.
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.
static void DestroyAll(StoredDeclsMap *Map, bool Dependent)
Represents the declaration of a struct/union/class/enum.
bool isBeingDefined() const
Return true if this decl is currently being defined.
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
StringRef getPlatformName() const
Retrieve the name of the platform as it is used in the availability attribute.
VersionTuple getPlatformMinVersion() const
Retrieve the minimum desired version of the platform, to which the program should be compiled.
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>'.
Base class for declarations which introduce a typedef-name.
TypeSourceInfo * getTypeSourceInfo() const
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.
const internal::VariadicAllOfMatcher< Attr > attr
Matches attributes.
The JSON file list parser is used to communicate input to InstallAPI.
SmallVector< Attr *, 4 > AttrVec
AttrVec - A vector of Attr, which is how they are stored on the AST.
LinkageSpecLanguageIDs
Represents the language in a linkage specification.
@ Self
'self' clause, allowed on Compute and Combined Constructs, plus 'update'.
@ 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.
AvailabilityResult
Captures the result of checking the availability of a declaration.
const FunctionProtoType * T
@ Enum
The "enum" keyword introduces the elaborated-type-specifier.
UsingDirectiveDecl * operator*() const
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4