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()
430 const DeclarationNameInfo &From, DeclarationNameInfo &To);
433 Decl *From, DeclContext *&ToDC, DeclContext *&ToLexicalDC);
434 Error ImportImplicitMethods(const CXXRecordDecl *From, CXXRecordDecl *To);
459 Error ImportInitializer(VarDecl *From, VarDecl *To);
461 RecordDecl *From, RecordDecl *To,
464 EnumDecl *From, EnumDecl *To,
467 ObjCInterfaceDecl *From, ObjCInterfaceDecl *To,
470 ObjCProtocolDecl *From, ObjCProtocolDecl *To,
475 ImportTemplateArgument(const TemplateArgument &From);
503 ImportInheritedConstructor(const InheritedConstructor &From);
506 bool hasSameVisibilityContextAndLinkage(T *Found, T *From);
508 bool IsStructuralMatch(Decl *From, Decl *To, bool Complain = true);
692 template <typename T> T importChecked(Error &Err, const T &From) { in importChecked() argument
696 Expected<T> MaybeVal = import(From); in importChecked()
764 const TemplateArgumentListInfo &From, TemplateArgumentListInfo &Result) { in ImportTemplateArgumentListInfo() argument
766 From.getLAngleLoc(), From.getRAngleLoc(), From.arguments(), Result); in ImportTemplateArgumentListInfo()
772 const ASTTemplateArgumentListInfo &From, in ImportTemplateArgumentListInfo() argument
775 From.LAngleLoc, From.RAngleLoc, From.arguments(), Result); in ImportTemplateArgumentListInfo()
800 ASTNodeImporter::import(TemplateParameterList *From) { in import() argument
801 SmallVector<NamedDecl *, 4> To(From->size()); in import()
802 if (Error Err = ImportContainerChecked(*From, To)) in import()
805 ExpectedExpr ToRequiresClause = import(From->getRequiresClause()); in import()
809 auto ToTemplateLocOrErr = import(From->getTemplateLoc()); in import()
812 auto ToLAngleLocOrErr = import(From->getLAngleLoc()); in import()
815 auto ToRAngleLocOrErr = import(From->getRAngleLoc()); in import()
830 ASTNodeImporter::import(const TemplateArgument &From) { in import() argument
831 switch (From.getKind()) { in import()
836 ExpectedType ToTypeOrErr = import(From.getAsType()); in import()
843 ExpectedType ToTypeOrErr = import(From.getIntegralType()); in import()
846 return TemplateArgument(From, *ToTypeOrErr); in import()
850 Expected<ValueDecl *> ToOrErr = import(From.getAsDecl()); in import()
853 ExpectedType ToTypeOrErr = import(From.getParamTypeForDecl()); in import()
860 ExpectedType ToTypeOrErr = import(From.getNullPtrType()); in import()
867 Expected<TemplateName> ToTemplateOrErr = import(From.getAsTemplate()); in import()
876 import(From.getAsTemplateOrTemplatePattern()); in import()
881 *ToTemplateOrErr, From.getNumTemplateExpansions()); in import()
885 if (ExpectedExpr ToExpr = import(From.getAsExpr())) in import()
892 ToPack.reserve(From.pack_size()); in import()
893 if (Error Err = ImportTemplateArguments(From.pack_elements(), ToPack)) in import()
1003 Expected<LambdaCapture> ASTNodeImporter::import(const LambdaCapture &From) { in import() argument
1005 if (From.capturesVariable()) { in import()
1006 if (auto VarOrErr = import(From.getCapturedVar())) in import()
1012 auto LocationOrErr = import(From.getLocation()); in import()
1017 if (From.isPackExpansion()) in import()
1018 if (Error Err = importInto(EllipsisLoc, From.getEllipsisLoc())) in import()
1022 *LocationOrErr, From.isImplicit(), From.getCaptureKind(), Var, in import()
1027 bool ASTNodeImporter::hasSameVisibilityContextAndLinkage(T *Found, T *From) { in hasSameVisibilityContextAndLinkage() argument
1028 if (Found->getLinkageInternal() != From->getLinkageInternal()) in hasSameVisibilityContextAndLinkage()
1031 if (From->hasExternalFormalLinkage()) in hasSameVisibilityContextAndLinkage()
1033 if (Importer.GetFromTU(Found) != From->getTranslationUnitDecl()) in hasSameVisibilityContextAndLinkage()
1035 if (From->isInAnonymousNamespace()) in hasSameVisibilityContextAndLinkage()
1044 TypedefNameDecl *From) { in hasSameVisibilityContextAndLinkage() argument
1045 if (Found->getLinkageInternal() != From->getLinkageInternal()) in hasSameVisibilityContextAndLinkage()
1048 if (From->isInAnonymousNamespace() && Found->isInAnonymousNamespace()) in hasSameVisibilityContextAndLinkage()
1049 return Importer.GetFromTU(Found) == From->getTranslationUnitDecl(); in hasSameVisibilityContextAndLinkage()
1050 return From->isInAnonymousNamespace() == Found->isInAnonymousNamespace(); in hasSameVisibilityContextAndLinkage()
1792 const DeclarationNameInfo &From, DeclarationNameInfo& To) { in ImportDeclarationNameLoc() argument
1805 if (auto ToRangeOrErr = import(From.getCXXOperatorNameRange())) in ImportDeclarationNameLoc()
1812 if (ExpectedSLoc LocOrErr = import(From.getCXXLiteralOperatorNameLoc())) in ImportDeclarationNameLoc()
1821 if (auto ToTInfoOrErr = import(From.getNamedTypeInfo())) in ImportDeclarationNameLoc()
1850 for (auto *From : FromDC->decls()) { in ImportDeclContext() local
1851 ExpectedDecl ImportedOrErr = import(From); in ImportDeclContext()
1858 FieldDecl *FieldFrom = dyn_cast_or_null<FieldDecl>(From); in ImportDeclContext()
1974 const CXXRecordDecl *From, CXXRecordDecl *To) { in ImportImplicitMethods() argument
1975 assert(From->isCompleteDefinition() && To->getDefinition() == To && in ImportImplicitMethods()
1978 for (CXXMethodDecl *FromM : From->methods()) in ImportImplicitMethods()
1988 static Error setTypedefNameForAnonDecl(TagDecl *From, TagDecl *To, in setTypedefNameForAnonDecl() argument
1990 if (TypedefNameDecl *FromTypedef = From->getTypedefNameForAnonDecl()) { in setTypedefNameForAnonDecl()
2000 RecordDecl *From, RecordDecl *To, ImportDefinitionKind Kind) { in ImportDefinition() argument
2020 auto *FromCXXRD = cast<CXXRecordDecl>(From); in ImportDefinition()
2033 Error Result = ImportDeclContext(From, /*ForceImport=*/true); in ImportDefinition()
2058 if (Error Err = setTypedefNameForAnonDecl(From, To, Importer)) in ImportDefinition()
2063 auto *FromCXX = dyn_cast<CXXRecordDecl>(From); in ImportDefinition()
2117 if (Error Err = ImportDeclContext(From, /*ForceImport=*/true)) in ImportDefinition()
2124 Error ASTNodeImporter::ImportInitializer(VarDecl *From, VarDecl *To) { in ImportInitializer() argument
2128 Expr *FromInit = From->getInit(); in ImportInitializer()
2137 if (EvaluatedStmt *FromEval = From->getEvaluatedStmt()) { in ImportInitializer()
2149 EnumDecl *From, EnumDecl *To, ImportDefinitionKind Kind) { in ImportDefinition() argument
2152 return ImportDeclContext(From, /*ForceImport=*/true); in ImportDefinition()
2158 if (Error Err = setTypedefNameForAnonDecl(From, To, Importer)) in ImportDefinition()
2162 import(Importer.getFromContext().getTypeDeclType(From)); in ImportDefinition()
2166 ExpectedType ToPromotionTypeOrErr = import(From->getPromotionType()); in ImportDefinition()
2171 if (Error Err = ImportDeclContext(From, /*ForceImport=*/true)) in ImportDefinition()
2177 From->getNumPositiveBits(), in ImportDefinition()
2178 From->getNumNegativeBits()); in ImportDefinition()
2197 ASTNodeImporter::ImportTemplateArgument(const TemplateArgument &From) { in ImportTemplateArgument() argument
2198 return import(From); in ImportTemplateArgument()
2219 bool ASTNodeImporter::IsStructuralMatch(Decl *From, Decl *To, bool Complain) { in IsStructuralMatch() argument
2231 return Ctx.IsEquivalent(From, To); in IsStructuralMatch()
4361 ASTNodeImporter::ImportInheritedConstructor(const InheritedConstructor &From) { in ImportInheritedConstructor() argument
4363 CXXConstructorDecl *ToBaseCtor = importChecked(Err, From.getConstructor()); in ImportInheritedConstructor()
4365 importChecked(Err, From.getShadowDecl()); in ImportInheritedConstructor()
4665 ObjCProtocolDecl *From, ObjCProtocolDecl *To, ImportDefinitionKind Kind) { in ImportDefinition() argument
4668 if (Error Err = ImportDeclContext(From)) in ImportDefinition()
4680 From->protocol_loc_begin(); in ImportDefinition()
4681 for (ObjCProtocolDecl::protocol_iterator FromProto = From->protocol_begin(), in ImportDefinition()
4682 FromProtoEnd = From->protocol_end(); in ImportDefinition()
4703 if (Error Err = ImportDeclContext(From, /*ForceImport=*/true)) in ImportDefinition()
5106 ObjCInterfaceDecl *From, ObjCInterfaceDecl *To, ImportDefinitionKind Kind) { in ImportDefinition() argument
5109 ObjCInterfaceDecl *FromSuper = From->getSuperClass(); in ImportDefinition()
5129 if (From->getSuperClass()) in ImportDefinition()
5130 Importer.FromDiag(From->getSuperClassLoc(), in ImportDefinition()
5132 << From->getSuperClass()->getDeclName(); in ImportDefinition()
5134 Importer.FromDiag(From->getLocation(), in ImportDefinition()
5139 if (Error Err = ImportDeclContext(From)) in ImportDefinition()
5148 if (From->getSuperClass()) { in ImportDefinition()
5149 if (auto SuperTInfoOrErr = import(From->getSuperClassTInfo())) in ImportDefinition()
5159 From->protocol_loc_begin(); in ImportDefinition()
5161 for (ObjCInterfaceDecl::protocol_iterator FromProto = From->protocol_begin(), in ImportDefinition()
5162 FromProtoEnd = From->protocol_end(); in ImportDefinition()
5183 for (auto *Cat : From->known_categories()) { in ImportDefinition()
5190 if (From->getImplementation()) { in ImportDefinition()
5192 import(From->getImplementation())) in ImportDefinition()
5199 if (Error Err = ImportDeclContext(From, /*ForceImport=*/true)) in ImportDefinition()
8626 ASTImporter::Import(ExprWithCleanups::CleanupObject From) { in Import() argument
8627 if (auto *CLE = From.dyn_cast<CompoundLiteralExpr *>()) { in Import()
8696 AttrArgImporter(ASTNodeImporter &I, Error &Err, const T &From) in AttrArgImporter()
8697 : To(I.importChecked(Err, From)) {} in AttrArgImporter()
8717 const llvm::iterator_range<T *> &From, in AttrArgArrayImporter()
8722 Err = I.ImportContainerChecked(From, To); in AttrArgArrayImporter()
8743 template <class T> AttrArgImporter<T> importArg(const T &From) { in importArg() argument
8744 return AttrArgImporter<T>(NImporter, Err, From); in importArg()
8751 AttrArgArrayImporter<T> importArrayArg(const llvm::iterator_range<T *> &From, in importArrayArg() argument
8753 return AttrArgArrayImporter<T>(NImporter, Err, From, ArraySize); in importArrayArg()
8825 auto *From = cast<AlignedAttr>(FromAttr); in Import() local
8826 if (From->isAlignmentExpr()) in Import()
8827 AI.importAttr(From, true, AI.importArg(From->getAlignmentExpr()).value()); in Import()
8829 AI.importAttr(From, false, in Import()
8830 AI.importArg(From->getAlignmentType()).value()); in Import()
8835 const auto *From = cast<FormatAttr>(FromAttr); in Import() local
8836 AI.importAttr(From, Import(From->getType()), From->getFormatIdx(), in Import()
8837 From->getFirstArg()); in Import()
8842 const auto *From = cast<EnableIfAttr>(FromAttr); in Import() local
8843 AI.importAttr(From, AI.importArg(From->getCond()).value(), in Import()
8844 From->getMessage()); in Import()
8849 const auto *From = cast<AssertCapabilityAttr>(FromAttr); in Import() local
8850 AI.importAttr(From, in Import()
8851 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
8852 From->args_size()); in Import()
8856 const auto *From = cast<AcquireCapabilityAttr>(FromAttr); in Import() local
8857 AI.importAttr(From, in Import()
8858 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
8859 From->args_size()); in Import()
8863 const auto *From = cast<TryAcquireCapabilityAttr>(FromAttr); in Import() local
8864 AI.importAttr(From, AI.importArg(From->getSuccessValue()).value(), in Import()
8865 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
8866 From->args_size()); in Import()
8870 const auto *From = cast<ReleaseCapabilityAttr>(FromAttr); in Import() local
8871 AI.importAttr(From, in Import()
8872 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
8873 From->args_size()); in Import()
8877 const auto *From = cast<RequiresCapabilityAttr>(FromAttr); in Import() local
8878 AI.importAttr(From, in Import()
8879 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
8880 From->args_size()); in Import()
8884 const auto *From = cast<GuardedByAttr>(FromAttr); in Import() local
8885 AI.importAttr(From, AI.importArg(From->getArg()).value()); in Import()
8889 const auto *From = cast<PtGuardedByAttr>(FromAttr); in Import() local
8890 AI.importAttr(From, AI.importArg(From->getArg()).value()); in Import()
8894 const auto *From = cast<AcquiredAfterAttr>(FromAttr); in Import() local
8895 AI.importAttr(From, in Import()
8896 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
8897 From->args_size()); in Import()
8901 const auto *From = cast<AcquiredBeforeAttr>(FromAttr); in Import() local
8902 AI.importAttr(From, in Import()
8903 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
8904 From->args_size()); in Import()
8908 const auto *From = cast<AssertExclusiveLockAttr>(FromAttr); in Import() local
8909 AI.importAttr(From, in Import()
8910 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
8911 From->args_size()); in Import()
8915 const auto *From = cast<AssertSharedLockAttr>(FromAttr); in Import() local
8916 AI.importAttr(From, in Import()
8917 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
8918 From->args_size()); in Import()
8922 const auto *From = cast<ExclusiveTrylockFunctionAttr>(FromAttr); in Import() local
8923 AI.importAttr(From, AI.importArg(From->getSuccessValue()).value(), in Import()
8924 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
8925 From->args_size()); in Import()
8929 const auto *From = cast<SharedTrylockFunctionAttr>(FromAttr); in Import() local
8930 AI.importAttr(From, AI.importArg(From->getSuccessValue()).value(), in Import()
8931 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
8932 From->args_size()); in Import()
8936 const auto *From = cast<LockReturnedAttr>(FromAttr); in Import() local
8937 AI.importAttr(From, AI.importArg(From->getArg()).value()); in Import()
8941 const auto *From = cast<LocksExcludedAttr>(FromAttr); in Import() local
8942 AI.importAttr(From, in Import()
8943 AI.importArrayArg(From->args(), From->args_size()).value(), in Import()
8944 From->args_size()); in Import()
9128 ASTImporter::Import(const InheritedConstructor &From) { in Import() argument
9129 return ASTNodeImporter(*this).ImportInheritedConstructor(From); in Import()
9375 Expected<TemplateName> ASTImporter::Import(TemplateName From) { in Import() argument
9376 switch (From.getKind()) { in Import()
9378 if (ExpectedDecl ToTemplateOrErr = Import(From.getAsTemplateDecl())) in Import()
9384 OverloadedTemplateStorage *FromStorage = From.getAsOverloadedTemplate(); in Import()
9397 AssumedTemplateStorage *FromStorage = From.getAsAssumedTemplateName(); in Import()
9405 QualifiedTemplateName *QTN = From.getAsQualifiedTemplateName(); in Import()
9417 DependentTemplateName *DTN = From.getAsDependentTemplateName(); in Import()
9433 From.getAsSubstTemplateTemplateParm(); in Import()
9449 From.getAsSubstTemplateTemplateParmPack(); in Import()
9465 auto UsingOrError = Import(From.getAsUsingShadowDecl()); in Import()
9587 Expected<CXXCtorInitializer *> ASTImporter::Import(CXXCtorInitializer *From) { in Import() argument
9588 ExpectedExpr ToExprOrErr = Import(From->getInit()); in Import()
9592 auto LParenLocOrErr = Import(From->getLParenLoc()); in Import()
9596 auto RParenLocOrErr = Import(From->getRParenLoc()); in Import()
9600 if (From->isBaseInitializer()) { in Import()
9601 auto ToTInfoOrErr = Import(From->getTypeSourceInfo()); in Import()
9606 if (From->isPackExpansion()) in Import()
9607 if (Error Err = importInto(EllipsisLoc, From->getEllipsisLoc())) in Import()
9611 ToContext, *ToTInfoOrErr, From->isBaseVirtual(), *LParenLocOrErr, in Import()
9613 } else if (From->isMemberInitializer()) { in Import()
9614 ExpectedDecl ToFieldOrErr = Import(From->getMember()); in Import()
9618 auto MemberLocOrErr = Import(From->getMemberLocation()); in Import()
9625 } else if (From->isIndirectMemberInitializer()) { in Import()
9626 ExpectedDecl ToIFieldOrErr = Import(From->getIndirectMember()); in Import()
9630 auto MemberLocOrErr = Import(From->getMemberLocation()); in Import()
9637 } else if (From->isDelegatingInitializer()) { in Import()
9638 auto ToTInfoOrErr = Import(From->getTypeSourceInfo()); in Import()
9678 Error ASTImporter::ImportDefinition(Decl *From) { in ImportDefinition() argument
9679 ExpectedDecl ToOrErr = Import(From); in ImportDefinition()
9684 auto *FromDC = cast<DeclContext>(From); in ImportDefinition()
9812 auto ImportLoop = [&](const APValue *From, APValue *To, unsigned Size) { in ImportAPValue() argument
9814 APValue Tmp = importChecked(Err, From[Idx]); in ImportAPValue()
10018 Decl *ASTImporter::MapImported(Decl *From, Decl *To) { in MapImported() argument
10019 llvm::DenseMap<Decl *, Decl *>::iterator Pos = ImportedDecls.find(From); in MapImported()
10024 ImportedDecls[From] = To; in MapImported()
10027 ImportedFromDecls[To] = From; in MapImported()
10045 void ASTImporter::setImportDeclError(Decl *From, ASTImportError Error) { in setImportDeclError() argument
10046 auto InsertRes = ImportDeclErrors.insert({From, Error}); in setImportDeclError()
10053 bool ASTImporter::IsStructurallyEquivalent(QualType From, QualType To, in IsStructurallyEquivalent() argument
10056 ImportedTypes.find(From.getTypePtr()); in IsStructurallyEquivalent()
10058 if (ExpectedType ToFromOrErr = Import(From)) { in IsStructurallyEquivalent()
10069 return Ctx.IsEquivalent(From, To); in IsStructurallyEquivalent()