Lines Matching refs:From
131 void updateFlags(const Decl *From, Decl *To) { in updateFlags() argument
134 if (From->isUsed(false) && !To->isUsed(false)) in updateFlags()
185 [[nodiscard]] Error importInto(ImportT &To, const ImportT &From) { in importInto() argument
186 return Importer.importInto(To, From); in importInto()
191 [[nodiscard]] Error importInto(ImportT *&To, ImportT *From) { in importInto() argument
192 auto ToOrErr = Importer.Import(From); in importInto()
201 auto import(T *From) in import() argument
204 auto ToOrErr = Importer.Import(From); in import()
211 auto import(const T *From) { in import() argument
212 return import(const_cast<T *>(From)); in import()
217 Expected<T> import(const T &From) { in import() argument
218 return Importer.Import(From); in import()
223 Expected<std::optional<T>> import(std::optional<T> From) { in import() argument
224 if (!From) in import()
226 return import(*From); in import()
383 const DeclarationNameInfo &From, DeclarationNameInfo &To);
386 Decl *From, DeclContext *&ToDC, DeclContext *&ToLexicalDC);
387 Error ImportImplicitMethods(const CXXRecordDecl *From, CXXRecordDecl *To);
389 Error ImportFieldDeclDefinition(const FieldDecl *From, const FieldDecl *To);
413 Error ImportInitializer(VarDecl *From, VarDecl *To);
415 RecordDecl *From, RecordDecl *To,
418 EnumDecl *From, EnumDecl *To,
421 ObjCInterfaceDecl *From, ObjCInterfaceDecl *To,
424 ObjCProtocolDecl *From, ObjCProtocolDecl *To,
429 ImportTemplateArgument(const TemplateArgument &From);
458 ImportInheritedConstructor(const InheritedConstructor &From);
461 bool hasSameVisibilityContextAndLinkage(T *Found, T *From);
463 bool IsStructuralMatch(Decl *From, Decl *To, bool Complain = true,
650 template <typename T> T importChecked(Error &Err, const T &From) { in importChecked() argument
654 Expected<T> MaybeVal = import(From); in importChecked()
722 const TemplateArgumentListInfo &From, TemplateArgumentListInfo &Result) { in ImportTemplateArgumentListInfo() argument
724 From.getLAngleLoc(), From.getRAngleLoc(), From.arguments(), Result); in ImportTemplateArgumentListInfo()
730 const ASTTemplateArgumentListInfo &From, in ImportTemplateArgumentListInfo() argument
733 From.LAngleLoc, From.RAngleLoc, From.arguments(), Result); in ImportTemplateArgumentListInfo()
758 ASTNodeImporter::import(TemplateParameterList *From) { in import() argument
759 SmallVector<NamedDecl *, 4> To(From->size()); in import()
760 if (Error Err = ImportContainerChecked(*From, To)) in import()
763 ExpectedExpr ToRequiresClause = import(From->getRequiresClause()); in import()
767 auto ToTemplateLocOrErr = import(From->getTemplateLoc()); in import()
770 auto ToLAngleLocOrErr = import(From->getLAngleLoc()); in import()
773 auto ToRAngleLocOrErr = import(From->getRAngleLoc()); in import()
788 ASTNodeImporter::import(const TemplateArgument &From) { in import() argument
789 switch (From.getKind()) { in import()
794 ExpectedType ToTypeOrErr = import(From.getAsType()); in import()
798 From.getIsDefaulted()); in import()
802 ExpectedType ToTypeOrErr = import(From.getIntegralType()); in import()
805 return TemplateArgument(From, *ToTypeOrErr); in import()
809 Expected<ValueDecl *> ToOrErr = import(From.getAsDecl()); in import()
812 ExpectedType ToTypeOrErr = import(From.getParamTypeForDecl()); in import()
816 *ToTypeOrErr, From.getIsDefaulted()); in import()
820 ExpectedType ToTypeOrErr = import(From.getNullPtrType()); in import()
824 From.getIsDefaulted()); in import()
828 ExpectedType ToTypeOrErr = import(From.getStructuralValueType()); in import()
831 Expected<APValue> ToValueOrErr = import(From.getAsStructuralValue()); in import()
839 Expected<TemplateName> ToTemplateOrErr = import(From.getAsTemplate()); in import()
843 return TemplateArgument(*ToTemplateOrErr, From.getIsDefaulted()); in import()
848 import(From.getAsTemplateOrTemplatePattern()); in import()
852 return TemplateArgument(*ToTemplateOrErr, From.getNumTemplateExpansions(), in import()
853 From.getIsDefaulted()); in import()
857 if (ExpectedExpr ToExpr = import(From.getAsExpr())) in import()
858 return TemplateArgument(*ToExpr, From.getIsDefaulted()); in import()
864 ToPack.reserve(From.pack_size()); in import()
865 if (Error Err = ImportTemplateArguments(From.pack_elements(), ToPack)) in import()
977 Expected<ConceptReference *> ASTNodeImporter::import(ConceptReference *From) { in import() argument
979 auto ToNNS = importChecked(Err, From->getNestedNameSpecifierLoc()); in import()
980 auto ToTemplateKWLoc = importChecked(Err, From->getTemplateKWLoc()); in import()
982 importChecked(Err, From->getConceptNameInfo().getLoc()); in import()
983 auto ToConceptName = importChecked(Err, From->getConceptNameInfo().getName()); in import()
984 auto ToFoundDecl = importChecked(Err, From->getFoundDecl()); in import()
985 auto ToNamedConcept = importChecked(Err, From->getNamedConcept()); in import()
989 const auto *ASTTemplateArgs = From->getTemplateArgsAsWritten(); in import()
1004 Expected<LambdaCapture> ASTNodeImporter::import(const LambdaCapture &From) { in import() argument
1006 if (From.capturesVariable()) { in import()
1007 if (auto VarOrErr = import(From.getCapturedVar())) in import()
1013 auto LocationOrErr = import(From.getLocation()); in import()
1018 if (From.isPackExpansion()) in import()
1019 if (Error Err = importInto(EllipsisLoc, From.getEllipsisLoc())) in import()
1023 *LocationOrErr, From.isImplicit(), From.getCaptureKind(), Var, in import()
1028 bool ASTNodeImporter::hasSameVisibilityContextAndLinkage(T *Found, T *From) { in hasSameVisibilityContextAndLinkage() argument
1029 if (Found->getLinkageInternal() != From->getLinkageInternal()) in hasSameVisibilityContextAndLinkage()
1032 if (From->hasExternalFormalLinkage()) in hasSameVisibilityContextAndLinkage()
1034 if (Importer.GetFromTU(Found) != From->getTranslationUnitDecl()) in hasSameVisibilityContextAndLinkage()
1036 if (From->isInAnonymousNamespace()) in hasSameVisibilityContextAndLinkage()
1045 TypedefNameDecl *From) { in hasSameVisibilityContextAndLinkage() argument
1046 if (Found->getLinkageInternal() != From->getLinkageInternal()) in hasSameVisibilityContextAndLinkage()
1049 if (From->isInAnonymousNamespace() && Found->isInAnonymousNamespace()) in hasSameVisibilityContextAndLinkage()
1050 return Importer.GetFromTU(Found) == From->getTranslationUnitDecl(); in hasSameVisibilityContextAndLinkage()
1051 return From->isInAnonymousNamespace() == Found->isInAnonymousNamespace(); in hasSameVisibilityContextAndLinkage()
1979 const DeclarationNameInfo &From, DeclarationNameInfo& To) { in ImportDeclarationNameLoc() argument
1992 if (auto ToRangeOrErr = import(From.getCXXOperatorNameRange())) in ImportDeclarationNameLoc()
1999 if (ExpectedSLoc LocOrErr = import(From.getCXXLiteralOperatorNameLoc())) in ImportDeclarationNameLoc()
2008 if (auto ToTInfoOrErr = import(From.getNamedTypeInfo())) in ImportDeclarationNameLoc()
2042 for (auto *From : FromDC->decls()) { in ImportDeclContext() local
2043 if (!MightNeedReordering(From)) in ImportDeclContext()
2046 ExpectedDecl ImportedOrErr = import(From); in ImportDeclContext()
2057 FieldDecl *FieldFrom = dyn_cast_or_null<FieldDecl>(From); in ImportDeclContext()
2119 for (auto *From : FromDC->decls()) { in ImportDeclContext() local
2120 if (MightNeedReordering(From)) in ImportDeclContext()
2123 ExpectedDecl ImportedOrErr = import(From); in ImportDeclContext()
2132 Error ASTNodeImporter::ImportFieldDeclDefinition(const FieldDecl *From, in ImportFieldDeclDefinition() argument
2138 QualType FromType = From->getType(); in ImportFieldDeclDefinition()
2185 const CXXRecordDecl *From, CXXRecordDecl *To) { in ImportImplicitMethods() argument
2186 assert(From->isCompleteDefinition() && To->getDefinition() == To && in ImportImplicitMethods()
2189 for (CXXMethodDecl *FromM : From->methods()) in ImportImplicitMethods()
2199 static Error setTypedefNameForAnonDecl(TagDecl *From, TagDecl *To, in setTypedefNameForAnonDecl() argument
2201 if (TypedefNameDecl *FromTypedef = From->getTypedefNameForAnonDecl()) { in setTypedefNameForAnonDecl()
2211 RecordDecl *From, RecordDecl *To, ImportDefinitionKind Kind) { in ImportDefinition() argument
2231 auto *FromCXXRD = cast<CXXRecordDecl>(From); in ImportDefinition()
2244 Error Result = ImportDeclContext(From, /*ForceImport=*/true); in ImportDefinition()
2269 if (Error Err = setTypedefNameForAnonDecl(From, To, Importer)) in ImportDefinition()
2274 auto *FromCXX = dyn_cast<CXXRecordDecl>(From); in ImportDefinition()
2328 if (Error Err = ImportDeclContext(From, /*ForceImport=*/true)) in ImportDefinition()
2335 Error ASTNodeImporter::ImportInitializer(VarDecl *From, VarDecl *To) { in ImportInitializer() argument
2339 Expr *FromInit = From->getInit(); in ImportInitializer()
2348 if (EvaluatedStmt *FromEval = From->getEvaluatedStmt()) { in ImportInitializer()
2360 EnumDecl *From, EnumDecl *To, ImportDefinitionKind Kind) { in ImportDefinition() argument
2363 return ImportDeclContext(From, /*ForceImport=*/true); in ImportDefinition()
2369 if (Error Err = setTypedefNameForAnonDecl(From, To, Importer)) in ImportDefinition()
2373 import(Importer.getFromContext().getTypeDeclType(From)); in ImportDefinition()
2377 ExpectedType ToPromotionTypeOrErr = import(From->getPromotionType()); in ImportDefinition()
2382 if (Error Err = ImportDeclContext(From, /*ForceImport=*/true)) in ImportDefinition()
2388 From->getNumPositiveBits(), in ImportDefinition()
2389 From->getNumNegativeBits()); in ImportDefinition()
2408 ASTNodeImporter::ImportTemplateArgument(const TemplateArgument &From) { in ImportTemplateArgument() argument
2409 return import(From); in ImportTemplateArgument()
2430 bool ASTNodeImporter::IsStructuralMatch(Decl *From, Decl *To, bool Complain, in IsStructuralMatch() argument
2444 return Ctx.IsEquivalent(From, To); in IsStructuralMatch()
4673 ASTNodeImporter::ImportInheritedConstructor(const InheritedConstructor &From) { in ImportInheritedConstructor() argument
4675 CXXConstructorDecl *ToBaseCtor = importChecked(Err, From.getConstructor()); in ImportInheritedConstructor()
4677 importChecked(Err, From.getShadowDecl()); in ImportInheritedConstructor()
4982 ObjCProtocolDecl *From, ObjCProtocolDecl *To, ImportDefinitionKind Kind) { in ImportDefinition() argument
4985 if (Error Err = ImportDeclContext(From)) in ImportDefinition()
4997 From->protocol_loc_begin(); in ImportDefinition()
4998 for (ObjCProtocolDecl::protocol_iterator FromProto = From->protocol_begin(), in ImportDefinition()
4999 FromProtoEnd = From->protocol_end(); in ImportDefinition()
5020 if (Error Err = ImportDeclContext(From, /*ForceImport=*/true)) in ImportDefinition()
5423 ObjCInterfaceDecl *From, ObjCInterfaceDecl *To, ImportDefinitionKind Kind) { in ImportDefinition() argument
5426 ObjCInterfaceDecl *FromSuper = From->getSuperClass(); in ImportDefinition()
5446 if (From->getSuperClass()) in ImportDefinition()
5447 Importer.FromDiag(From->getSuperClassLoc(), in ImportDefinition()
5449 << From->getSuperClass()->getDeclName(); in ImportDefinition()
5451 Importer.FromDiag(From->getLocation(), in ImportDefinition()
5456 if (Error Err = ImportDeclContext(From)) in ImportDefinition()
5465 if (From->getSuperClass()) { in ImportDefinition()
5466 if (auto SuperTInfoOrErr = import(From->getSuperClassTInfo())) in ImportDefinition()
5476 From->protocol_loc_begin(); in ImportDefinition()
5478 for (ObjCInterfaceDecl::protocol_iterator FromProto = From->protocol_begin(), in ImportDefinition()
5479 FromProtoEnd = From->protocol_end(); in ImportDefinition()
5500 for (auto *Cat : From->known_categories()) { in ImportDefinition()
5507 if (From->getImplementation()) { in ImportDefinition()
5509 import(From->getImplementation())) in ImportDefinition()
5516 if (Error Err = ImportDeclContext(From, /*ForceImport=*/true)) in ImportDefinition()
9050 ASTImporter::Import(ExprWithCleanups::CleanupObject From) { in Import() argument
9051 if (auto *CLE = From.dyn_cast<CompoundLiteralExpr *>()) { in Import()
9120 AttrArgImporter(ASTNodeImporter &I, Error &Err, const T &From) in AttrArgImporter()
9121 : To(I.importChecked(Err, From)) {} in AttrArgImporter()
9141 const llvm::iterator_range<T *> &From, in AttrArgArrayImporter()
9146 Err = I.ImportContainerChecked(From, To); in AttrArgArrayImporter()
9171 template <class T> AttrArgImporter<T> importArg(const T &From) { in importArg() argument
9172 return AttrArgImporter<T>(NImporter, Err, From); in importArg()
9179 AttrArgArrayImporter<T> importArrayArg(const llvm::iterator_range<T *> &From, in importArrayArg() argument
9181 return AttrArgArrayImporter<T>(NImporter, Err, From, ArraySize); in importArrayArg()
9253 auto *From = cast<AlignedAttr>(FromAttr); in Import() local
9254 if (From->isAlignmentExpr()) in Import()
9255 AI.importAttr(From, true, AI.importArg(From->getAlignmentExpr()).value()); in Import()
9257 AI.importAttr(From, false, in Import()
9258 AI.importArg(From->getAlignmentType()).value()); in Import()
9263 auto *From = cast<AlignValueAttr>(FromAttr); in Import() local
9264 AI.importAttr(From, AI.importArg(From->getAlignment()).value()); in Import()
9269 const auto *From = cast<FormatAttr>(FromAttr); in Import() local
9270 AI.importAttr(From, Import(From->getType()), From->getFormatIdx(), in Import()
9271 From->getFirstArg()); in Import()
9276 const auto *From = cast<EnableIfAttr>(FromAttr); in Import() local
9277 AI.importAttr(From, AI.importArg(From->getCond()).value(), in Import()
9278 From->getMessage()); in Import()
9283 const auto *From = cast<AssertCapabilityAttr>(FromAttr); in Import() local
9284 AI.importAttr(From, in Import()
9285 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
9286 From->args_size()); in Import()
9290 const auto *From = cast<AcquireCapabilityAttr>(FromAttr); in Import() local
9291 AI.importAttr(From, in Import()
9292 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
9293 From->args_size()); in Import()
9297 const auto *From = cast<TryAcquireCapabilityAttr>(FromAttr); in Import() local
9298 AI.importAttr(From, AI.importArg(From->getSuccessValue()).value(), in Import()
9299 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
9300 From->args_size()); in Import()
9304 const auto *From = cast<ReleaseCapabilityAttr>(FromAttr); in Import() local
9305 AI.importAttr(From, in Import()
9306 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
9307 From->args_size()); in Import()
9311 const auto *From = cast<RequiresCapabilityAttr>(FromAttr); in Import() local
9312 AI.importAttr(From, in Import()
9313 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
9314 From->args_size()); in Import()
9318 const auto *From = cast<GuardedByAttr>(FromAttr); in Import() local
9319 AI.importAttr(From, AI.importArg(From->getArg()).value()); in Import()
9323 const auto *From = cast<PtGuardedByAttr>(FromAttr); in Import() local
9324 AI.importAttr(From, AI.importArg(From->getArg()).value()); in Import()
9328 const auto *From = cast<AcquiredAfterAttr>(FromAttr); in Import() local
9329 AI.importAttr(From, in Import()
9330 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
9331 From->args_size()); in Import()
9335 const auto *From = cast<AcquiredBeforeAttr>(FromAttr); in Import() local
9336 AI.importAttr(From, in Import()
9337 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
9338 From->args_size()); in Import()
9342 const auto *From = cast<AssertExclusiveLockAttr>(FromAttr); in Import() local
9343 AI.importAttr(From, in Import()
9344 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
9345 From->args_size()); in Import()
9349 const auto *From = cast<AssertSharedLockAttr>(FromAttr); in Import() local
9350 AI.importAttr(From, in Import()
9351 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
9352 From->args_size()); in Import()
9356 const auto *From = cast<ExclusiveTrylockFunctionAttr>(FromAttr); in Import() local
9357 AI.importAttr(From, AI.importArg(From->getSuccessValue()).value(), in Import()
9358 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
9359 From->args_size()); in Import()
9363 const auto *From = cast<SharedTrylockFunctionAttr>(FromAttr); in Import() local
9364 AI.importAttr(From, AI.importArg(From->getSuccessValue()).value(), in Import()
9365 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
9366 From->args_size()); in Import()
9370 const auto *From = cast<LockReturnedAttr>(FromAttr); in Import() local
9371 AI.importAttr(From, AI.importArg(From->getArg()).value()); in Import()
9375 const auto *From = cast<LocksExcludedAttr>(FromAttr); in Import() local
9376 AI.importAttr(From, in Import()
9377 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
9378 From->args_size()); in Import()
9562 ASTImporter::Import(const InheritedConstructor &From) { in Import() argument
9563 return ASTNodeImporter(*this).ImportInheritedConstructor(From); in Import()
9809 Expected<TemplateName> ASTImporter::Import(TemplateName From) { in Import() argument
9810 switch (From.getKind()) { in Import()
9812 if (ExpectedDecl ToTemplateOrErr = Import(From.getAsTemplateDecl())) in Import()
9818 OverloadedTemplateStorage *FromStorage = From.getAsOverloadedTemplate(); in Import()
9831 AssumedTemplateStorage *FromStorage = From.getAsAssumedTemplateName(); in Import()
9839 QualifiedTemplateName *QTN = From.getAsQualifiedTemplateName(); in Import()
9851 DependentTemplateName *DTN = From.getAsDependentTemplateName(); in Import()
9867 From.getAsSubstTemplateTemplateParm(); in Import()
9883 From.getAsSubstTemplateTemplateParmPack(); in Import()
9899 auto UsingOrError = Import(From.getAsUsingShadowDecl()); in Import()
10021 Expected<CXXCtorInitializer *> ASTImporter::Import(CXXCtorInitializer *From) { in Import() argument
10022 ExpectedExpr ToExprOrErr = Import(From->getInit()); in Import()
10026 auto LParenLocOrErr = Import(From->getLParenLoc()); in Import()
10030 auto RParenLocOrErr = Import(From->getRParenLoc()); in Import()
10034 if (From->isBaseInitializer()) { in Import()
10035 auto ToTInfoOrErr = Import(From->getTypeSourceInfo()); in Import()
10040 if (From->isPackExpansion()) in Import()
10041 if (Error Err = importInto(EllipsisLoc, From->getEllipsisLoc())) in Import()
10045 ToContext, *ToTInfoOrErr, From->isBaseVirtual(), *LParenLocOrErr, in Import()
10047 } else if (From->isMemberInitializer()) { in Import()
10048 ExpectedDecl ToFieldOrErr = Import(From->getMember()); in Import()
10052 auto MemberLocOrErr = Import(From->getMemberLocation()); in Import()
10059 } else if (From->isIndirectMemberInitializer()) { in Import()
10060 ExpectedDecl ToIFieldOrErr = Import(From->getIndirectMember()); in Import()
10064 auto MemberLocOrErr = Import(From->getMemberLocation()); in Import()
10071 } else if (From->isDelegatingInitializer()) { in Import()
10072 auto ToTInfoOrErr = Import(From->getTypeSourceInfo()); in Import()
10112 Error ASTImporter::ImportDefinition(Decl *From) { in ImportDefinition() argument
10113 ExpectedDecl ToOrErr = Import(From); in ImportDefinition()
10118 auto *FromDC = cast<DeclContext>(From); in ImportDefinition()
10246 auto ImportLoop = [&](const APValue *From, APValue *To, unsigned Size) { in ImportAPValue() argument
10248 APValue Tmp = importChecked(Err, From[Idx]); in ImportAPValue()
10452 Decl *ASTImporter::MapImported(Decl *From, Decl *To) { in MapImported() argument
10453 llvm::DenseMap<Decl *, Decl *>::iterator Pos = ImportedDecls.find(From); in MapImported()
10458 ImportedDecls[From] = To; in MapImported()
10461 ImportedFromDecls[To] = From; in MapImported()
10479 void ASTImporter::setImportDeclError(Decl *From, ASTImportError Error) { in setImportDeclError() argument
10480 auto InsertRes = ImportDeclErrors.insert({From, Error}); in setImportDeclError()
10487 bool ASTImporter::IsStructurallyEquivalent(QualType From, QualType To, in IsStructurallyEquivalent() argument
10490 ImportedTypes.find(From.getTypePtr()); in IsStructurallyEquivalent()
10492 if (ExpectedType ToFromOrErr = Import(From)) { in IsStructurallyEquivalent()
10503 return Ctx.IsEquivalent(From, To); in IsStructurallyEquivalent()