Lines Matching +full:msi +full:- +full:specifier

1 //===- ASTReaderDecl.cpp - Decl Deserialization ---------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
78 //===----------------------------------------------------------------------===//
80 //===----------------------------------------------------------------------===//
108 return LocalOffset ? Loc.Offset - LocalOffset : 0;
272 ASTContext &C = D->getASTContext();
274 auto *&LazySpecializations = D->getCommonPtr()->LazySpecializations;
322 Cat->NextClassCategory = Next;
492 if (Current->isFirstDecl()) {
494 Current = Current->getMostRecentDecl();
496 Current = Current->getPreviousDecl();
523 return Loc.F->DeclsCursor.GetCurrentBitNo() + Loc.F->GlobalBitOffset;
529 Loc.F->Kind == ModuleKind::MK_MainFile ||
533 CD->setNumCtorInitializers(Record.readInt());
534 if (CD->getNumCtorInitializers())
535 CD->CtorInitializers = ReadGlobalOffset();
546 D->getCanonicalDecl()->Used |= IsDeclMarkedUsed;
550 if (auto *TInfo = DD->getTypeSourceInfo())
551 Record.readTypeLoc(TInfo->getTypeLoc());
556 TD->setTypeForDecl(Reader.GetType(DeferredTypeID).getTypePtrOrNull());
561 cast<TagDecl>(D)->TypedefNameDeclOrQualifier =
565 ID->TypeForDecl = Reader.GetType(DeferredTypeID).getTypePtrOrNull();
573 if (FD->hasInClassInitializer() && Record.readInt()) {
574 FD->setLazyInClassInitializer(LazyDeclStmtPtr(GetCurrentCursorOffset()));
583 D->setReferenced(DeclBits.getNextBit());
584 D->Used = DeclBits.getNextBit();
585 IsDeclMarkedUsed |= D->Used;
586 D->setAccess((AccessSpecifier)DeclBits.getNextBits(/*Width=*/2));
587 D->setImplicit(DeclBits.getNextBit());
590 D->setTopLevelDeclInObjCContainer(DeclBits.getNextBit());
591 D->InvalidDecl = DeclBits.getNextBit();
592 D->FromASTFile = true;
594 if (D->isTemplateParameter() || D->isTemplateParameterPack() ||
610 D->setDeclContext(Reader.getContext().getTranslationUnitDecl());
626 D->setDeclContextsImpl(MergedSemaDC ? MergedSemaDC : SemaDC, LexicalDC,
629 D->setLocation(ThisDeclLoc);
636 D->setAttrsImpl(Attrs, Reader.getContext());
655 D->setModuleOwnershipKind(ModuleOwnership);
657 D->setOwningModuleID(SubmoduleID);
660 // Module-private declarations are never visible, so there is no work to
667 if (Owner->NameVisibility == Module::AllVisible)
668 D->setVisibleDespiteOwningModule();
673 D->setModuleOwnershipKind(Decl::ModuleOwnershipKind::ModulePrivate);
679 D->setLocation(readSourceLocation());
680 D->CommentKind = (PragmaMSCommentKind)Record.readInt();
682 memcpy(D->getTrailingObjects<char>(), Arg.data(), Arg.size());
683 D->getTrailingObjects<char>()[Arg.size()] = '\0';
688 D->setLocation(readSourceLocation());
690 memcpy(D->getTrailingObjects<char>(), Name.data(), Name.size());
691 D->getTrailingObjects<char>()[Name.size()] = '\0';
693 D->ValueStart = Name.size() + 1;
695 memcpy(D->getTrailingObjects<char>() + D->ValueStart, Value.data(),
697 D->getTrailingObjects<char>()[D->ValueStart + Value.size()] = '\0';
706 ND->setDeclName(Record.readDeclarationName());
712 TD->setLocStart(readSourceLocation());
724 TD->setModedTypeSourceInfo(TInfo, modedT);
726 TD->setTypeSourceInfo(TInfo);
744 TD->setDescribedAliasTemplate(Template);
753 TD->IdentifierNamespace = Record.readInt();
756 TD->setTagKind(
758 TD->setCompleteDefinition(TagDeclBits.getNextBit());
759 TD->setEmbeddedInDeclarator(TagDeclBits.getNextBit());
760 TD->setFreeStanding(TagDeclBits.getNextBit());
761 TD->setCompleteDefinitionRequired(TagDeclBits.getNextBit());
762 TD->setBraceRange(readSourceRange());
770 TD->TypedefNameDeclOrQualifier = Info;
789 ED->setIntegerTypeSourceInfo(TI);
791 ED->setIntegerType(Record.readType());
792 ED->setPromotionType(Record.readType());
795 ED->setNumPositiveBits(EnumDeclBits.getNextBits(/*Width=*/8));
796 ED->setNumNegativeBits(EnumDeclBits.getNextBits(/*Width=*/8));
797 ED->setScoped(EnumDeclBits.getNextBit());
798 ED->setScopedUsingClassTag(EnumDeclBits.getNextBit());
799 ED->setFixed(EnumDeclBits.getNextBit());
801 ED->setHasODRHash(true);
802 ED->ODRHash = Record.readInt();
806 if (ED->isCompleteDefinition() && Reader.getContext().getLangOpts().Modules) {
807 EnumDecl *&OldDef = Reader.EnumDefinitions[ED->getCanonicalDecl()];
811 for (auto *D : merged_redecls(ED->getCanonicalDecl())) {
812 if (!D->isFromASTFile() && D->isCompleteDefinition()) {
820 ED->demoteThisDefinitionToDeclaration();
825 OldDef->getODRHash() != ED->getODRHash())
835 ED->setInstantiationOfMemberEnum(Reader.getContext(), InstED, TSK);
836 ED->getMemberSpecializationInfo()->setPointOfInstantiation(POI);
845 RD->setHasFlexibleArrayMember(RecordDeclBits.getNextBit());
846 RD->setAnonymousStructOrUnion(RecordDeclBits.getNextBit());
847 RD->setHasObjectMember(RecordDeclBits.getNextBit());
848 RD->setHasVolatileMember(RecordDeclBits.getNextBit());
849 RD->setNonTrivialToPrimitiveDefaultInitialize(RecordDeclBits.getNextBit());
850 RD->setNonTrivialToPrimitiveCopy(RecordDeclBits.getNextBit());
851 RD->setNonTrivialToPrimitiveDestroy(RecordDeclBits.getNextBit());
852 RD->setHasNonTrivialToPrimitiveDefaultInitializeCUnion(
854 RD->setHasNonTrivialToPrimitiveDestructCUnion(RecordDeclBits.getNextBit());
855 RD->setHasNonTrivialToPrimitiveCopyCUnion(RecordDeclBits.getNextBit());
856 RD->setParamDestroyedInCallee(RecordDeclBits.getNextBit());
857 RD->setArgPassingRestrictions(
864 RD->setODRHash(Record.readInt());
868 if (RD->isCompleteDefinition()) {
869 RecordDecl *Canon = static_cast<RecordDecl *>(RD->getCanonicalDecl());
875 if (!D->isFromASTFile() && D->isCompleteDefinition()) {
883 RD->demoteThisDefinitionToDeclaration();
885 if (OldDef->getODRHash() != RD->getODRHash())
901 VD->setType(Record.readType());
907 ECD->setInitExpr(Record.readExpr());
908 ECD->setInitVal(Reader.getContext(), Record.readAPSInt());
914 DD->setInnerLocStart(readSourceLocation());
918 Info->TrailingRequiresClause = Record.readExpr();
919 DD->DeclInfo = Info;
922 DD->setTypeSourceInfo(
936 FD->setInstantiatedFromDecl(readDeclAs<FunctionDecl>());
940 Template->init(FD);
941 FD->setDescribedFunctionTemplate(Template);
948 FD->setInstantiationOfMemberFunction(Reader.getContext(), InstFD, TSK);
949 FD->getMemberSpecializationInfo()->setPointOfInstantiation(POI);
979 MSInfo->setPointOfInstantiation(POI);
987 FD->TemplateOrSpecialization = FTInfo;
989 if (FD->isCanonicalDecl()) { // if canonical add to template's set.
1001 FunctionTemplateDecl::Common *CommonPtr = CanonTemplate->getCommonPtr();
1003 CommonPtr->Specializations.FindNodeOrInsertPos(ID, InsertPos);
1005 CommonPtr->Specializations.InsertNode(FTInfo, InsertPos);
1009 Existing = ExistingInfo->getFunction();
1018 while (NumCandidates--)
1027 FD->setDependentTemplateSpecialization(
1040 if (FD->getTypeSourceInfo() && FD->getTypeSourceInfo()
1041 ->getType()
1042 ->castAs<FunctionType>()
1043 ->getReturnType()
1044 ->getContainedAutoType()) {
1047 FD->setType(FD->getTypeSourceInfo()->getType());
1050 FD->setType(Reader.GetType(DeferredTypeID));
1054 FD->DNLoc = Record.readDeclarationNameLoc(FD->getDeclName());
1055 FD->IdentifierNamespace = Record.readInt();
1061 FD->setCachedLinkage((Linkage)FunctionDeclBits.getNextBits(/*Width=*/3));
1062 FD->setStorageClass((StorageClass)FunctionDeclBits.getNextBits(/*Width=*/3));
1063 FD->setInlineSpecified(FunctionDeclBits.getNextBit());
1064 FD->setImplicitlyInline(FunctionDeclBits.getNextBit());
1065 FD->setHasSkippedBody(FunctionDeclBits.getNextBit());
1066 FD->setVirtualAsWritten(FunctionDeclBits.getNextBit());
1071 FD->setHasInheritedPrototype(FunctionDeclBits.getNextBit());
1072 FD->setHasWrittenPrototype(FunctionDeclBits.getNextBit());
1073 FD->setDeletedAsWritten(FunctionDeclBits.getNextBit());
1074 FD->setTrivial(FunctionDeclBits.getNextBit());
1075 FD->setTrivialForCall(FunctionDeclBits.getNextBit());
1076 FD->setDefaulted(FunctionDeclBits.getNextBit());
1077 FD->setExplicitlyDefaulted(FunctionDeclBits.getNextBit());
1078 FD->setIneligibleOrNotSelected(FunctionDeclBits.getNextBit());
1079 FD->setConstexprKind(
1081 FD->setHasImplicitReturnZero(FunctionDeclBits.getNextBit());
1082 FD->setIsMultiVersion(FunctionDeclBits.getNextBit());
1083 FD->setLateTemplateParsed(FunctionDeclBits.getNextBit());
1084 FD->setFriendConstraintRefersToEnclosingTemplate(
1086 FD->setUsesSEHTry(FunctionDeclBits.getNextBit());
1088 FD->EndRangeLoc = readSourceLocation();
1089 if (FD->isExplicitlyDefaulted())
1090 FD->setDefaultLoc(readSourceLocation());
1092 FD->ODRHash = Record.readInt();
1093 FD->setHasODRHash(true);
1095 if (FD->isDefaulted() || FD->isDeletedAsWritten()) {
1112 FD->setDefaultedOrDeletedInfo(
1120 else if (auto Kind = FD->getTemplatedKind();
1133 [](FunctionDecl *FD) { return FD->getDescribedFunctionTemplate(); });
1136 return FD->getTemplateSpecializationInfo()->getTemplate();
1143 FD->setIsPureVirtual(Pure);
1151 FD->setParams(Reader.getContext(), Params);
1157 // Load the body on-demand. Most clients won't care, because method
1161 MD->setSelfDecl(readDeclAs<ImplicitParamDecl>());
1162 MD->setCmdDecl(readDeclAs<ImplicitParamDecl>());
1163 MD->setInstanceMethod(Record.readInt());
1164 MD->setVariadic(Record.readInt());
1165 MD->setPropertyAccessor(Record.readInt());
1166 MD->setSynthesizedAccessorStub(Record.readInt());
1167 MD->setDefined(Record.readInt());
1168 MD->setOverriding(Record.readInt());
1169 MD->setHasSkippedBody(Record.readInt());
1171 MD->setIsRedeclaration(Record.readInt());
1172 MD->setHasRedeclaration(Record.readInt());
1173 if (MD->hasRedeclaration())
1177 MD->setDeclImplementation(
1179 MD->setObjCDeclQualifier((Decl::ObjCDeclQualifier)Record.readInt());
1180 MD->setRelatedResultType(Record.readInt());
1181 MD->setReturnType(Record.readType());
1182 MD->setReturnTypeSourceInfo(readTypeSourceInfo());
1183 MD->DeclEndLoc = readSourceLocation();
1190 MD->setSelLocsKind((SelectorLocationsKind)Record.readInt());
1197 MD->setParamsAndSelLocs(Reader.getContext(), Params, SelLocs);
1203 D->Variance = Record.readInt();
1204 D->Index = Record.readInt();
1205 D->VarianceLoc = readSourceLocation();
1206 D->ColonLoc = readSourceLocation();
1211 CD->setAtStartLoc(readSourceLocation());
1212 CD->setAtEndRange(readSourceRange());
1272 struct ObjCInterfaceDecl::DefinitionData &DD = D->data();
1280 if (D->getODRHash() != NewDD.ODRHash)
1291 ID->TypeParamList = ReadObjCTypeParamList();
1294 ID->allocateDefinitionData();
1296 ReadObjCDefinitionData(ID->data());
1297 ObjCInterfaceDecl *Canon = ID->getCanonicalDecl();
1298 if (Canon->Data.getPointer()) {
1301 MergeDefinitionData(Canon, std::move(ID->data()));
1302 ID->Data = Canon->Data;
1306 ID->getCanonicalDecl()->Data = ID->Data;
1309 ID->setIvarList(nullptr);
1315 // Note that we've loaded this Objective-C class.
1318 ID->Data = ID->getCanonicalDecl()->Data;
1324 IVD->setAccessControl((ObjCIvarDecl::AccessControl)Record.readInt());
1326 IVD->setNextIvar(nullptr);
1328 IVD->setSynthesize(synth);
1331 if (IVD->isInvalidDecl())
1336 if (isa<ObjCInterfaceDecl>(IVD->getDeclContext()))
1339 IVD->getContainingInterface()->getCanonicalDecl();
1340 IdentifierInfo *II = IVD->getIdentifier();
1341 ObjCIvarDecl *PrevIvar = CanonIntf->lookupInstanceVariable(II);
1343 auto *ParentExt = dyn_cast<ObjCCategoryDecl>(IVD->getDeclContext());
1345 dyn_cast<ObjCCategoryDecl>(PrevIvar->getDeclContext());
1357 Reader.Diag(IVD->getLocation(), diag::err_duplicate_ivar_declaration)
1359 Reader.Diag(PrevIvar->getLocation(), diag::note_previous_definition);
1383 struct ObjCProtocolDecl::DefinitionData &DD = D->data();
1391 if (D->getODRHash() != NewDD.ODRHash)
1403 PD->allocateDefinitionData();
1405 ReadObjCDefinitionData(PD->data());
1407 ObjCProtocolDecl *Canon = PD->getCanonicalDecl();
1408 if (Canon->Data.getPointer()) {
1411 MergeDefinitionData(Canon, std::move(PD->data()));
1412 PD->Data = Canon->Data;
1416 PD->getCanonicalDecl()->Data = PD->Data;
1421 PD->Data = PD->getCanonicalDecl()->Data;
1431 CD->setCategoryNameLoc(readSourceLocation());
1432 CD->setIvarLBraceLoc(readSourceLocation());
1433 CD->setIvarRBraceLoc(readSourceLocation());
1440 CD->ClassInterface = readDeclAs<ObjCInterfaceDecl>();
1441 CD->TypeParamList = ReadObjCTypeParamList();
1451 CD->setProtocolList(ProtoRefs.data(), NumProtoRefs, ProtoLocs.data(),
1455 if (NumProtoRefs > 0 && CD->ClassInterface && CD->IsClassExtension())
1456 CD->ClassInterface->mergeClassExtensionProtocolList(
1463 CAD->setClassInterface(readDeclAs<ObjCInterfaceDecl>());
1468 D->setAtLoc(readSourceLocation());
1469 D->setLParenLoc(readSourceLocation());
1472 D->setType(T, TSI);
1473 D->setPropertyAttributes((ObjCPropertyAttribute::Kind)Record.readInt());
1474 D->setPropertyAttributesAsWritten(
1476 D->setPropertyImplementation(
1480 D->setGetterName(GetterName.getObjCSelector(), GetterLoc);
1483 D->setSetterName(SetterName.getObjCSelector(), SetterLoc);
1484 D->setGetterMethodDecl(readDeclAs<ObjCMethodDecl>());
1485 D->setSetterMethodDecl(readDeclAs<ObjCMethodDecl>());
1486 D->setPropertyIvarDecl(readDeclAs<ObjCIvarDecl>());
1491 D->setClassInterface(readDeclAs<ObjCInterfaceDecl>());
1496 D->CategoryNameLoc = readSourceLocation();
1501 D->setSuperClass(readDeclAs<ObjCInterfaceDecl>());
1502 D->SuperLoc = readSourceLocation();
1503 D->setIvarLBraceLoc(readSourceLocation());
1504 D->setIvarRBraceLoc(readSourceLocation());
1505 D->setHasNonZeroConstructors(Record.readInt());
1506 D->setHasDestructors(Record.readInt());
1507 D->NumIvarInitializers = Record.readInt();
1508 if (D->NumIvarInitializers)
1509 D->IvarInitializers = ReadGlobalOffset();
1514 D->setAtLoc(readSourceLocation());
1515 D->setPropertyDecl(readDeclAs<ObjCPropertyDecl>());
1516 D->PropertyIvarDecl = readDeclAs<ObjCIvarDecl>();
1517 D->IvarLoc = readSourceLocation();
1518 D->setGetterMethodDecl(readDeclAs<ObjCMethodDecl>());
1519 D->setSetterMethodDecl(readDeclAs<ObjCMethodDecl>());
1520 D->setGetterCXXConstructor(Record.readExpr());
1521 D->setSetterCXXAssignment(Record.readExpr());
1526 FD->Mutable = Record.readInt();
1529 FD->StorageKind = Bits >> 1;
1530 if (FD->StorageKind == FieldDecl::ISK_CapturedVLAType)
1531 FD->CapturedVLAType =
1534 FD->setBitWidth(Record.readExpr());
1536 if (!FD->getDeclName()) {
1545 PD->GetterId = Record.readIdentifier();
1546 PD->SetterId = Record.readIdentifier();
1551 D->PartVal.Part1 = Record.readInt();
1552 D->PartVal.Part2 = Record.readInt();
1553 D->PartVal.Part3 = Record.readInt();
1554 for (auto &C : D->PartVal.Part4And5)
1559 Reader.getContext().setPrimaryMergedDecl(D, Existing->getCanonicalDecl());
1565 D->Value = Record.readAPValue();
1570 Reader.getContext().setPrimaryMergedDecl(D, Existing->getCanonicalDecl());
1575 D->Value = Record.readAPValue();
1581 Reader.getContext().setPrimaryMergedDecl(D, Existing->getCanonicalDecl());
1587 FD->ChainingSize = Record.readInt();
1588 assert(FD->ChainingSize >= 2 && "Anonymous chaining must be >= 2");
1589 FD->Chaining = new (Reader.getContext())NamedDecl*[FD->ChainingSize];
1591 for (unsigned I = 0; I != FD->ChainingSize; ++I)
1592 FD->Chaining[I] = readDeclAs<NamedDecl>();
1604 VD->VarDeclBits.SClass = (StorageClass)VarDeclBits.getNextBits(/*Width=*/3);
1605 VD->VarDeclBits.TSCSpec = VarDeclBits.getNextBits(/*Width=*/2);
1606 VD->VarDeclBits.InitStyle = VarDeclBits.getNextBits(/*Width=*/2);
1607 VD->VarDeclBits.ARCPseudoStrong = VarDeclBits.getNextBit();
1610 VD->NonParmVarDeclBits.IsThisDeclarationADemotedDefinition =
1612 VD->NonParmVarDeclBits.ExceptionVar = VarDeclBits.getNextBit();
1613 VD->NonParmVarDeclBits.NRVOVariable = VarDeclBits.getNextBit();
1614 VD->NonParmVarDeclBits.CXXForRangeDecl = VarDeclBits.getNextBit();
1616 VD->NonParmVarDeclBits.IsInline = VarDeclBits.getNextBit();
1617 VD->NonParmVarDeclBits.IsInlineSpecified = VarDeclBits.getNextBit();
1618 VD->NonParmVarDeclBits.IsConstexpr = VarDeclBits.getNextBit();
1619 VD->NonParmVarDeclBits.IsInitCapture = VarDeclBits.getNextBit();
1620 VD->NonParmVarDeclBits.PreviousDeclInSameBlockScope =
1623 VD->NonParmVarDeclBits.EscapingByref = VarDeclBits.getNextBit();
1625 VD->NonParmVarDeclBits.ImplicitParamKind =
1628 VD->NonParmVarDeclBits.ObjCForDecl = VarDeclBits.getNextBit();
1637 VD->setType(Reader.GetType(DeferredTypeID));
1640 VD->setCachedLinkage(VarLinkage);
1643 if (VD->getStorageClass() == SC_Extern && VarLinkage != Linkage::None &&
1644 VD->getLexicalDeclContext()->isFunctionOrMethod())
1645 VD->setLocalExternDecl();
1649 Loc.F->Kind == ModuleKind::MK_MainFile ||
1653 if (VD->hasAttr<BlocksAttr>()) {
1672 VD->setDescribedVarTemplate(readDeclAs<VarTemplateDecl>());
1689 EvaluatedStmt *Eval = VD->ensureEvaluatedStmt();
1690 Eval->HasConstantInitialization = (Val & 2) != 0;
1691 Eval->HasConstantDestruction = (Val & 4) != 0;
1692 Eval->WasEvaluated = (Val & 8) != 0;
1693 if (Eval->WasEvaluated) {
1694 Eval->Evaluated = Record.readAPValue();
1695 if (Eval->Evaluated.needsCleanup())
1696 Reader.getContext().addDestruction(&Eval->Evaluated);
1702 Eval->Value = GetCurrentCursorOffset();
1720 PD->setObjCMethodScopeInfo(scopeIndex);
1721 PD->ParmVarDeclBits.ScopeDepthOrObjCQuals = declQualifier;
1723 PD->setScopeInfo(scopeDepth, scopeIndex);
1725 PD->ParmVarDeclBits.IsKNRPromoted = ParmVarDeclBits.getNextBit();
1727 PD->ParmVarDeclBits.HasInheritedDefaultArg = ParmVarDeclBits.getNextBit();
1729 PD->setUninstantiatedDefaultArg(Record.readExpr());
1732 PD->ExplicitObjectParameterIntroducerLoc = Record.readSourceLocation();
1740 auto **BDs = DD->getTrailingObjects<BindingDecl *>();
1741 for (unsigned I = 0; I != DD->NumBindings; ++I) {
1743 BDs[I]->setDecomposedDecl(DD);
1749 BD->Binding = Record.readExpr();
1754 AD->setAsmString(cast<StringLiteral>(Record.readExpr()));
1755 AD->setRParenLoc(readSourceLocation());
1760 D->Statement = Record.readStmt();
1765 BD->setBody(cast_or_null<CompoundStmt>(Record.readStmt()));
1766 BD->setSignatureAsWritten(readTypeSourceInfo());
1772 BD->setParams(Params);
1774 BD->setIsVariadic(Record.readInt());
1775 BD->setBlockMissingReturnType(Record.readInt());
1776 BD->setIsConversionFromLambda(Record.readInt());
1777 BD->setDoesNotEscape(Record.readInt());
1778 BD->setCanAvoidCopyToHeap(Record.readInt());
1793 BD->setCaptures(Reader.getContext(), captures, capturesCXXThis);
1799 CD->setNothrow(Record.readInt() != 0);
1801 for (unsigned I = 0; I < CD->NumParams; ++I) {
1803 CD->setParam(I, readDeclAs<ImplicitParamDecl>());
1805 CD->setContextParam(I, readDeclAs<ImplicitParamDecl>());
1811 D->setLanguage(static_cast<LinkageSpecLanguageIDs>(Record.readInt()));
1812 D->setExternLoc(readSourceLocation());
1813 D->setRBraceLoc(readSourceLocation());
1818 D->RBraceLoc = readSourceLocation();
1823 D->setLocStart(readSourceLocation());
1831 D->setInline(NamespaceDeclBits.getNextBit());
1832 D->setNested(NamespaceDeclBits.getNextBit());
1833 D->LocStart = readSourceLocation();
1834 D->RBraceLoc = readSourceLocation();
1852 D->setAnonymousNamespace(Anon);
1859 D->IsCBuffer = Record.readBool();
1860 D->KwLoc = readSourceLocation();
1861 D->LBraceLoc = readSourceLocation();
1862 D->RBraceLoc = readSourceLocation();
1868 D->NamespaceLoc = readSourceLocation();
1869 D->IdentLoc = readSourceLocation();
1870 D->QualifierLoc = Record.readNestedNameSpecifierLoc();
1871 D->Namespace = readDeclAs<NamedDecl>();
1877 D->setUsingLoc(readSourceLocation());
1878 D->QualifierLoc = Record.readNestedNameSpecifierLoc();
1879 D->DNLoc = Record.readDeclarationNameLoc(D->getDeclName());
1880 D->FirstUsingShadow.setPointer(readDeclAs<UsingShadowDecl>());
1881 D->setTypename(Record.readInt());
1889 D->setUsingLoc(readSourceLocation());
1890 D->setEnumLoc(readSourceLocation());
1891 D->setEnumType(Record.readTypeSourceInfo());
1892 D->FirstUsingShadow.setPointer(readDeclAs<UsingShadowDecl>());
1900 D->InstantiatedFrom = readDeclAs<NamedDecl>();
1901 auto **Expansions = D->getTrailingObjects<NamedDecl *>();
1902 for (unsigned I = 0; I != D->NumExpansions; ++I)
1910 D->Underlying = readDeclAs<NamedDecl>();
1911 D->IdentifierNamespace = Record.readInt();
1912 D->UsingOrNextShadow = readDeclAs<NamedDecl>();
1922 D->NominatedBaseClassShadowDecl = readDeclAs<ConstructorUsingShadowDecl>();
1923 D->ConstructedBaseClassShadowDecl = readDeclAs<ConstructorUsingShadowDecl>();
1924 D->IsVirtual = Record.readInt();
1929 D->UsingLoc = readSourceLocation();
1930 D->NamespaceLoc = readSourceLocation();
1931 D->QualifierLoc = Record.readNestedNameSpecifierLoc();
1932 D->NominatedNamespace = readDeclAs<NamedDecl>();
1933 D->CommonAncestor = readDeclAs<DeclContext>();
1938 D->setUsingLoc(readSourceLocation());
1939 D->QualifierLoc = Record.readNestedNameSpecifierLoc();
1940 D->DNLoc = Record.readDeclarationNameLoc(D->getDeclName());
1941 D->EllipsisLoc = readSourceLocation();
1948 D->TypenameLocation = readSourceLocation();
1949 D->QualifierLoc = Record.readNestedNameSpecifierLoc();
1950 D->EllipsisLoc = readSourceLocation();
1979 Loc.F->Kind == ModuleKind::MK_MainFile ||
1991 "given lambda context for non-lambda");
2055 assert(D->DefinitionData &&
2056 "merging class definition into non-definition");
2057 auto &DD = *D->DefinitionData;
2064 MergeDD.Definition->setCompleteDefinition(false);
2072 PFDI->second == ASTReader::PendingFakeDefinitionKind::Fake) {
2076 PFDI->second = ASTReader::PendingFakeDefinitionKind::FakeLoaded;
2140 if (D->getODRHash() != MergeDD.ODRHash) {
2166 CXXRecordDecl *Canon = D->getCanonicalDecl();
2170 if (!Canon->DefinitionData)
2171 Canon->DefinitionData = DD;
2172 D->DefinitionData = Canon->DefinitionData;
2178 if (Canon->DefinitionData != DD) {
2184 D->setCompleteDefinition(true);
2218 D->TemplateOrInstantiation = Template;
2219 if (!Template->getTemplatedDecl()) {
2234 MemberSpecializationInfo *MSI = new (C) MemberSpecializationInfo(RD, TSK);
2235 MSI->setPointOfInstantiation(POI);
2236 D->TemplateOrInstantiation = MSI;
2255 D->DefinitionData = D->getCanonicalDecl()->DefinitionData;
2261 if (KeyFn.isValid() && D->isCompleteDefinition())
2272 D->setExplicitSpecifier(Record.readExplicitSpec());
2273 D->Ctor = readDeclAs<CXXConstructorDecl>();
2275 D->setDeductionCandidateKind(
2283 if (D->isCanonicalDecl()) {
2284 while (NumOverridenMethods--) {
2288 Reader.getContext().addOverriddenMethod(D, MD->getCanonicalDecl());
2300 D->setExplicitSpecifier(Record.readExplicitSpec());
2301 if (D->isInheritingConstructor()) {
2304 *D->getTrailingObjects<InheritedConstructor>() =
2315 CXXDestructorDecl *Canon = D->getCanonicalDecl();
2318 if (!Canon->OperatorDelete) {
2319 Canon->OperatorDelete = OperatorDelete;
2320 Canon->OperatorDeleteThisArg = ThisArg;
2326 D->setExplicitSpecifier(Record.readExplicitSpec());
2332 D->ImportedModule = readModule();
2333 D->setImportComplete(Record.readInt());
2334 auto *StoredLocs = D->getTrailingObjects<SourceLocation>();
2342 D->setColonLoc(readSourceLocation());
2348 D->Friend = readDeclAs<NamedDecl>();
2350 D->Friend = readTypeSourceInfo();
2351 for (unsigned i = 0; i != D->NumTPLists; ++i)
2352 D->getTrailingObjects<TemplateParameterList *>()[i] =
2354 D->NextFriend = readDeclID().getRawValue();
2355 D->UnsupportedFriend = (Record.readInt() != 0);
2356 D->FriendLoc = readSourceLocation();
2362 D->NumParams = NumParams;
2363 D->Params = new (Reader.getContext()) TemplateParameterList *[NumParams];
2365 D->Params[i] = Record.readTemplateParameterList();
2367 D->Friend = readDeclAs<NamedDecl>();
2369 D->Friend = readTypeSourceInfo();
2370 D->FriendLoc = readSourceLocation();
2376 assert(!D->TemplateParams && "TemplateParams already set!");
2377 D->TemplateParams = Record.readTemplateParameterList();
2378 D->init(readDeclAs<NamedDecl>());
2383 D->ConstraintExpr = Record.readExpr();
2390 // don't have to re-read it here.
2393 for (unsigned I = 0; I < D->NumTemplateArgs; ++I)
2395 D->setTemplateArguments(Args);
2407 RedeclarableTemplateDecl *CanonD = D->getCanonicalDecl();
2408 if (!CanonD->Common) {
2409 CanonD->Common = CanonD->newCommon(Reader.getContext());
2412 D->Common = CanonD->Common;
2418 assert(RTD->getKind() == D->getKind() &&
2420 D->setInstantiatedFromMemberTemplate(RTD);
2422 D->setMemberSpecialization();
2427 D->IdentifierNamespace = Record.readInt();
2444 if (D->getTemplatedDecl()->TemplateOrInstantiation) {
2449 D->getTemplatedDecl(), D->getInjectedClassNameSpecialization());
2481 D->SpecializedTemplate = CTD;
2490 PS->PartialSpecialization
2492 PS->TemplateArgs = ArgList;
2493 D->SpecializedTemplate = PS;
2499 D->TemplateArgs = TemplateArgumentList::CreateCopy(C, TemplArgs);
2500 D->PointOfInstantiation = readSourceLocation();
2501 D->SpecializationKind = (TemplateSpecializationKind)Record.readInt();
2506 if (D->isCanonicalDecl()) { // It's kept in the folding set.
2510 CanonSpec = CanonPattern->getCommonPtr()->PartialSpecializations
2514 CanonPattern->getCommonPtr()->Specializations.GetOrInsertNode(D);
2522 if (auto *DDD = D->DefinitionData) {
2523 if (CanonSpec->DefinitionData)
2526 CanonSpec->DefinitionData = D->DefinitionData;
2528 D->DefinitionData = CanonSpec->DefinitionData;
2536 ExplicitInfo->ExternKeywordLoc = readSourceLocation();
2537 ExplicitInfo->TemplateKeywordLoc = readSourceLocation();
2538 D->ExplicitInfo = ExplicitInfo;
2542 D->setTemplateArgsAsWritten(Record.readASTTemplateArgumentListInfo());
2552 D->TemplateParams = Params;
2558 D->InstantiatedFromMember.setPointer(
2560 D->InstantiatedFromMember.setInt(Record.readInt());
2586 D->SpecializedTemplate = VTD;
2595 PS->PartialSpecialization =
2597 PS->TemplateArgs = ArgList;
2598 D->SpecializedTemplate = PS;
2605 ExplicitInfo->ExternKeywordLoc = readSourceLocation();
2606 ExplicitInfo->TemplateKeywordLoc = readSourceLocation();
2607 D->ExplicitInfo = ExplicitInfo;
2611 D->setTemplateArgsAsWritten(Record.readASTTemplateArgumentListInfo());
2615 D->TemplateArgs = TemplateArgumentList::CreateCopy(C, TemplArgs);
2616 D->PointOfInstantiation = readSourceLocation();
2617 D->SpecializationKind = (TemplateSpecializationKind)Record.readInt();
2618 D->IsCompleteDefinition = Record.readInt();
2625 if (D->isCanonicalDecl()) { // It's kept in the folding set.
2628 CanonSpec = CanonPattern->getCommonPtr()
2629 ->PartialSpecializations.GetOrInsertNode(Partial);
2632 CanonPattern->getCommonPtr()->Specializations.GetOrInsertNode(D);
2651 D->TemplateParams = Params;
2657 D->InstantiatedFromMember.setPointer(
2659 D->InstantiatedFromMember.setInt(Record.readInt());
2666 D->setDeclaredWithTypename(Record.readInt());
2669 if (TypeConstraintInitialized && D->hasTypeConstraint()) {
2675 D->setTypeConstraint(CR, ImmediatelyDeclaredConstraint);
2676 if ((D->ExpandedParameterPack = Record.readInt()))
2677 D->NumExpanded = Record.readInt();
2681 D->setDefaultArgument(Reader.getContext(),
2688 D->setDepth(Record.readInt());
2689 D->setPosition(Record.readInt());
2690 if (D->hasPlaceholderTypeConstraint())
2691 D->setPlaceholderTypeConstraint(Record.readExpr());
2692 if (D->isExpandedParameterPack()) {
2694 D->getTrailingObjects<std::pair<QualType, TypeSourceInfo *>>();
2695 for (unsigned I = 0, N = D->getNumExpansionTypes(); I != N; ++I) {
2701 D->ParameterPack = Record.readInt();
2703 D->setDefaultArgument(Reader.getContext(),
2710 D->setDeclaredWithTypename(Record.readBool());
2712 D->setDepth(Record.readInt());
2713 D->setPosition(Record.readInt());
2714 if (D->isExpandedParameterPack()) {
2715 auto **Data = D->getTrailingObjects<TemplateParameterList *>();
2716 for (unsigned I = 0, N = D->getNumExpansionTemplateParameters();
2721 D->ParameterPack = Record.readInt();
2723 D->setDefaultArgument(Reader.getContext(),
2735 D->AssertExprAndFailed.setPointer(Record.readExpr());
2736 D->AssertExprAndFailed.setInt(Record.readInt());
2737 D->Message = cast_or_null<StringLiteral>(Record.readExpr());
2738 D->RParenLoc = readSourceLocation();
2748 D->ExtendingDecl = readDeclAs<ValueDecl>();
2749 D->ExprWithTemporary = Record.readStmt();
2751 D->Value = new (D->getASTContext()) APValue(Record.readAPValue());
2752 D->getASTContext().addDestruction(D->Value);
2754 D->ManglingNumber = Record.readInt();
2793 for (unsigned I = 0; I != N - 1; ++I)
2809 D->RedeclLink = Redeclarable<T>::PreviousDeclLink(FirstDecl);
2810 D->First = FirstDecl->getCanonicalDecl();
2835 if (!DBase->isFirstDecl())
2866 if (!D->isFirstDecl())
2876 Context->getCanonicalDecl(), IndexInContext}];
2889 D->Common = D->getCanonicalDecl()->Common;
2905 auto *DPattern = D->getTemplatedDecl();
2906 auto *ExistingPattern = Existing->getTemplatedDecl();
2909 DPattern->getCanonicalDecl()->getGlobalID(), IsKeyDecl);
2915 cast<CXXRecordDecl>(ExistingPattern)->getCanonicalDecl();
2916 if (auto *DDD = DClass->DefinitionData) {
2917 if (ExistingClass->DefinitionData) {
2920 ExistingClass->DefinitionData = DClass->DefinitionData;
2926 DClass->DefinitionData = ExistingClass->DefinitionData;
2948 T *ExistingCanon = Existing->getCanonicalDecl();
2949 T *DCanon = D->getCanonicalDecl();
2954 D->RedeclLink = Redeclarable<T>::PreviousDeclLink(ExistingCanon);
2955 D->First = ExistingCanon;
2956 ExistingCanon->Used |= D->Used;
2957 D->Used = false;
2971 /// ODR-like semantics for C/ObjC allow us to merge tag types and a structural
2996 LETDecl->getExtendingDecl(), LETDecl->getManglingNumber())];
2999 LookupResult->getCanonicalDecl());
3014 // ODR-based merging is performed in C++ and in some cases (tag types) in C.
3015 // Note that C identically-named things in different translation units are
3016 // not redeclarations, but may still have compatible types, where ODR-like
3025 Existing->getCanonicalDecl());
3029 Record.readOMPChildren(D->Data);
3034 Record.readOMPChildren(D->Data);
3039 Record.readOMPChildren(D->Data);
3045 D->setLocation(readSourceLocation());
3048 D->setCombinerData(In, Out);
3050 D->setCombiner(Combiner);
3053 D->setInitializerData(Orig, Priv);
3056 D->setInitializer(Init, IK);
3057 D->PrevDeclInScope = readDeclID().getRawValue();
3061 Record.readOMPChildren(D->Data);
3063 D->VarName = Record.readDeclarationName();
3064 D->PrevDeclInScope = readDeclID().getRawValue();
3071 //===----------------------------------------------------------------------===//
3073 //===----------------------------------------------------------------------===//
3129 // Kind is stored as a 1-based integer because 0 is used to indicate a null
3131 auto Kind = static_cast<attr::Kind>(V - 1);
3164 //===----------------------------------------------------------------------===//
3166 //===----------------------------------------------------------------------===//
3183 /// code generation, e.g., inline function definitions, Objective-C
3192 auto *M = D->getImportedOwningModule();
3193 if (M && M->Kind == Module::ModuleMapModule &&
3203 return !D->getDeclContext()->isFunctionOrMethod();
3205 return Var->isFileVarDecl() &&
3206 (Var->isThisDeclarationADefinition() == VarDecl::Definition ||
3209 return Func->doesThisDeclarationHaveABody() || PendingBodies.count(D);
3211 if (auto *ES = D->getASTContext().getExternalSource())
3212 if (ES->hasExternalDefinitions(D) == ExternalASTSource::EK_Never)
3224 const DeclOffset &DOffs = M->DeclOffsets[LocalDeclIndex];
3226 return RecordLocation(M, DOffs.getBitOffset(M->DeclsBlockStartOffset));
3233 return RecordLocation(I->second, GlobalOffset - I->second->GlobalBitOffset);
3244 auto *DD = RD->DefinitionData;
3246 DD = RD->getCanonicalDecl()->DefinitionData;
3254 RD->setCompleteDefinition(true);
3255 RD->DefinitionData = DD;
3256 RD->getCanonicalDecl()->DefinitionData = DD;
3263 return DD->Definition;
3271 return ND->getFirstDecl();
3277 return RD->getDefinition();
3280 return ED->getDefinition();
3283 return OID->getDefinition();
3286 // we're in clang-repl so we still need to get the primary context.
3288 return TU->getPrimaryContext();
3297 DeclContext *DC = New->getDeclContext()->getRedeclContext();
3306 DeclarationName Name = New->getDeclName();
3307 DeclContext *DC = New->getDeclContext()->getRedeclContext();
3309 setAnonymousDeclForMerging(Reader, New->getLexicalDeclContext(),
3311 } else if (DC->isTranslationUnit() &&
3319 MergeDC->makeDeclVisibleInContextImpl(New, /*Internal*/true);
3334 if (Found->isFromASTFile())
3338 return TND->getAnonDeclWithTypedefName(/*AnyRedecl*/true);
3350 auto *DD = RD->getCanonicalDecl()->DefinitionData;
3351 return DD ? DD->Definition : nullptr;
3353 return OID->getCanonicalDecl()->getDefinition();
3361 if (FD->isThisDeclarationADefinition())
3364 if (MD->isThisDeclarationADefinition())
3367 if (RD->isThisDeclarationADefinition())
3378 // If the lexical context has been merged, look into the now-canonical
3380 auto *CanonDC = cast<Decl>(DC)->getCanonicalDecl();
3390 if (PrimaryDC && !cast<Decl>(PrimaryDC)->isFromASTFile()) {
3393 Previous.push_back(cast<NamedDecl>(ND->getCanonicalDecl()));
3395 Previous[Number] = cast<NamedDecl>(ND->getCanonicalDecl());
3405 auto *CanonDC = cast<Decl>(DC)->getCanonicalDecl();
3416 : D->getDeclName();
3428 DeclContext *DC = D->getDeclContext()->getRedeclContext();
3433 if (C.isSameEntity(It->second, D))
3434 return FindExistingResult(Reader, D, It->second, AnonymousDeclNumber,
3444 Reader, D->getLexicalDeclContext(), AnonymousDeclNumber))
3448 } else if (DC->isTranslationUnit() &&
3452 // Temporarily consider the identifier to be up-to-date. We don't want to
3461 WasOutToDate = II->isOutOfDate();
3463 II->setOutOfDate(false);
3469 II->setOutOfDate(true);
3482 DeclContext::lookup_result R = MergeDC->noload_lookup(Name);
3502 auto MergedDCIt = Reader.MergedDeclContexts.find(D->getLexicalDeclContext());
3504 !shouldSkipCheckingODR(D) && MergedDCIt->second == D->getDeclContext())
3513 return D->RedeclLink.getLatestNotUpdated();
3517 llvm_unreachable("getMostRecentDecl on non-redeclarable declaration");
3523 switch (D->getKind()) {
3534 return ASTDeclReader::getMostRecentDecl(D->getCanonicalDecl());
3541 const auto *IA = Previous->getAttr<MSInheritanceAttr>();
3543 if (IA && !D->hasAttr<MSInheritanceAttr>()) {
3544 NewAttr = cast<InheritableAttr>(IA->clone(Context));
3545 NewAttr->setInherited(true);
3546 D->addAttr(NewAttr);
3549 const auto *AA = Previous->getAttr<AvailabilityAttr>();
3550 if (AA && !D->hasAttr<AvailabilityAttr>()) {
3551 NewAttr = AA->clone(Context);
3552 NewAttr->setInherited(true);
3553 D->addAttr(NewAttr);
3561 D->RedeclLink.setPrevious(cast<DeclT>(Previous));
3562 D->First = cast<DeclT>(Previous)->First;
3573 D->RedeclLink.setPrevious(PrevVD);
3574 D->First = PrevVD->First;
3579 if (VD->isThisDeclarationADefinition() == VarDecl::Definition) {
3580 for (VarDecl *CurD = PrevVD; CurD; CurD = CurD->getPreviousDecl()) {
3581 if (CurD->isThisDeclarationADefinition() == VarDecl::Definition) {
3583 VD->demoteThisDefinitionToDeclaration();
3591 auto *DT = T->getContainedDeducedType();
3592 return DT && !DT->isDeduced();
3602 FD->RedeclLink.setPrevious(PrevFD);
3603 FD->First = PrevFD->First;
3607 if (PrevFD->isInlined() != FD->isInlined()) {
3623 FD->setImplicitlyInline(true);
3626 auto *FPT = FD->getType()->getAs<FunctionProtoType>();
3627 auto *PrevFPT = PrevFD->getType()->getAs<FunctionProtoType>();
3631 bool IsUnresolved = isUnresolvedExceptionSpec(FPT->getExceptionSpecType());
3633 isUnresolvedExceptionSpec(PrevFPT->getExceptionSpecType());
3640 bool IsUndeduced = isUndeducedReturnType(FPT->getReturnType());
3641 bool WasUndeduced = isUndeducedReturnType(PrevFPT->getReturnType());
3645 (IsUndeduced ? PrevFPT : FPT)->getReturnType()});
3652 llvm_unreachable("attachPreviousDecl on non-redeclarable declaration");
3661 if (!From->hasDefaultArgument())
3663 To->setInheritedDefaultArgument(Context, From);
3670 auto *FromTP = From->getTemplateParameters();
3671 auto *ToTP = To->getTemplateParameters();
3672 assert(FromTP->size() == ToTP->size() && "merged mismatched templates?");
3674 for (unsigned I = 0, N = FromTP->size(); I != N; ++I) {
3675 NamedDecl *FromParam = FromTP->getParam(I);
3676 NamedDecl *ToParam = ToTP->getParam(I);
3690 // the program is ill-formed;
3693 Module *M = Previous->getOwningModule();
3696 if (!M || !M->isNamedModule())
3701 if (Previous->isImplicit())
3716 VTSD && !VTSD->isExplicitSpecialization())
3719 CTSD && !CTSD->isExplicitSpecialization())
3722 if (auto *FTSI = Func->getTemplateSpecializationInfo();
3723 FTSI && !FTSI->isExplicitSpecialization())
3727 if (Reader.getContext().isInSameModule(M, D->getOwningModule()))
3730 Reader.Diag(Previous->getLocation(),
3732 << cast<NamedDecl>(Previous) << M->Name;
3733 Reader.Diag(D->getLocation(), diag::note_also_found);
3740 switch (D->getKind()) {
3756 D->IdentifierNamespace |=
3757 Previous->IdentifierNamespace &
3775 D->RedeclLink.setLatest(cast<DeclT>(Latest));
3779 llvm_unreachable("attachLatestDecl on non-redeclarable declaration");
3785 switch (D->getKind()) {
3797 D->RedeclLink.markIncomplete();
3801 llvm_unreachable("markIncompleteDeclChain on non-redeclarable declaration");
3805 switch (D->getKind()) {
3819 llvm::BitstreamCursor &DeclsCursor = Loc.F->DeclsCursor;
3854 llvm_unreachable("Record cannot be de-serialized with readDeclRecord");
4079 Error("attempt to read a C++ base-specifier record as a declaration");
4151 D->setDeclContext(Context.getTranslationUnitDecl());
4168 Offsets = Iter->second;
4187 if (Class->isThisDeclarationADefinition() ||
4210 // Ensure that we've loaded all potentially-interesting declarations
4237 VD && VD->isFileVarDecl() && !VD->isExternallyVisible())
4238 VD->getInit();
4249 assert(!RD->shouldEmitInExternalSource());
4267 auto UpdateOffsets = std::move(UpdI->second);
4278 llvm::BitstreamCursor &Cursor = F->DeclsCursor;
4327 auto VisibleUpdates = std::move(I->second);
4330 auto *DC = cast<DeclContext>(D)->getPrimaryContext();
4335 DC->setHasExternalVisibleStorage(true);
4341 Decl *CanonDecl = FirstLocal->getCanonicalDecl();
4358 llvm::BitstreamCursor &Cursor = M->DeclsCursor;
4381 // we should instead generate one loop per kind and dispatch up-front?
4384 unsigned Idx = N - I - 1;
4411 if (Cat->getDeclName()) {
4412 ObjCCategoryDecl *&Existing = NameCategoryMap[Cat->getDeclName()];
4417 Cat->getASTContext(), Existing->getASTContext(),
4424 Reader.Diag(Cat->getLocation(), diag::warn_dup_category_def)
4425 << Interface->getDeclName() << Cat->getDeclName();
4426 Reader.Diag(Existing->getLocation(),
4439 Interface->setCategoryListRaw(Cat);
4450 // Populate the name -> category map with the set of known categories.
4451 for (auto *Cat : Interface->known_categories()) {
4452 if (Cat->getDeclName())
4453 NameCategoryMap[Cat->getDeclName()] = Cat;
4482 LocalID != Result->getDefinitionID()) {
4490 unsigned Offset = Result->Offset;
4515 auto *MostRecent = D->getMostRecentDecl();
4518 Redecl = Redecl->getPreviousDecl())
4524 Redecl = Redecl->getPreviousDecl())
4555 TU->setAnonymousNamespace(Anon);
4557 cast<NamespaceDecl>(D)->setAnonymousNamespace(Anon);
4564 VD->NonParmVarDeclBits.IsInline = Record.readInt();
4565 VD->NonParmVarDeclBits.IsInlineSpecified = Record.readInt();
4573 VTSD->setPointOfInstantiation(POI);
4575 MemberSpecializationInfo *MSInfo = VD->getMemberSpecializationInfo();
4577 MSInfo->setPointOfInstantiation(POI);
4580 if (auto *FTSInfo = FD->TemplateOrSpecialization
4582 FTSInfo->setPointOfInstantiation(POI);
4584 FD->TemplateOrSpecialization.get<MemberSpecializationInfo *>()
4585 ->setPointOfInstantiation(POI);
4600 if (Param->hasUninstantiatedDefaultArg())
4601 Param->setDefaultArg(DefaultArg);
4611 if (FD->hasInClassInitializer() && !FD->hasNonNullInClassInitializer()) {
4613 FD->setInClassInitializer(DefaultInit);
4617 FD->removeInClassInitializer();
4635 FD->setImplicitlyInline();
4638 FD->setInnerLocStart(readSourceLocation());
4646 auto *OldDD = RD->getCanonicalDecl()->DefinitionData;
4648 OldDD && (OldDD->Definition != RD ||
4650 RD->setParamDestroyedInCallee(Record.readInt());
4651 RD->setArgPassingRestrictions(
4665 RD->getMemberSpecializationInfo()) {
4666 MSInfo->setTemplateSpecializationKind(TSK);
4667 MSInfo->setPointOfInstantiation(POI);
4670 Spec->setTemplateSpecializationKind(TSK);
4671 Spec->setPointOfInstantiation(POI);
4683 if (!Spec->getSpecializedTemplateOrPartial()
4685 Spec->setInstantiationOf(PartialSpec, TemplArgList);
4689 RD->setTagKind(static_cast<TagTypeKind>(Record.readInt()));
4690 RD->setLocation(readSourceLocation());
4691 RD->setLocStart(readSourceLocation());
4692 RD->setBraceRange(readSourceRange());
4699 if (!D->hasAttrs())
4700 D->setAttrsImpl(Attrs, Reader.getContext());
4709 auto *First = cast<CXXDestructorDecl>(D->getCanonicalDecl());
4712 if (!First->OperatorDelete) {
4713 First->OperatorDelete = Del;
4714 First->OperatorDeleteThisArg = ThisArg;
4725 auto *FPT = FD->getType()->castAs<FunctionProtoType>();
4728 if (isUnresolvedExceptionSpec(FPT->getExceptionSpecType())) {
4729 FD->setType(Reader.getContext().getFunctionType(
4730 FPT->getReturnType(), FPT->getParamTypes(),
4731 FPT->getExtProtoInfo().withExceptionSpec(ESI)));
4736 std::make_pair(FD->getCanonicalDecl(), FD));
4745 {FD->getCanonicalDecl(), DeducedResultType});
4751 D->markUsed(Reader.getContext());
4765 D->addAttr(OMPThreadPrivateDeclAttr::CreateImplicit(Reader.getContext(),
4775 D->addAttr(OMPAllocateDeclAttr::CreateImplicit(
4795 D->addAttr(OMPDeclareTargetDeclAttr::CreateImplicit(
4805 D->addAttr(Attrs[0]);