@@ -203,17 +203,18 @@ class ModuleDecl : public DeclContext, public TypeDecl {
203203 friend class DirectPrecedenceGroupLookupRequest ;
204204
205205public:
206- typedef ArrayRef<Located<Identifier>> AccessPathTy;
206+ LLVM_ATTRIBUTE_DEPRECATED (typedef ArrayRef<Located<Identifier>> AccessPathTy,
207+ " use ImportPath types instead" );
207208 // / Convenience struct to keep track of a module along with its access path.
208209 struct alignas (uint64_t ) ImportedModule {
209210 // / The access path from an import: `import Foo.Bar` -> `Foo.Bar`.
210- ModuleDecl::AccessPathTy accessPath;
211+ ImportPath::Access accessPath;
211212 // / The actual module corresponding to the import.
212213 // /
213214 // / Invariant: The pointer is non-null.
214215 ModuleDecl *importedModule;
215216
216- ImportedModule (ModuleDecl::AccessPathTy accessPath,
217+ ImportedModule (ImportPath::Access accessPath,
217218 ModuleDecl *importedModule)
218219 : accessPath (accessPath), importedModule (importedModule) {
219220 assert (this ->importedModule );
@@ -225,7 +226,10 @@ class ModuleDecl : public DeclContext, public TypeDecl {
225226 }
226227 };
227228
228- static bool matchesAccessPath (AccessPathTy AccessPath, DeclName Name) {
229+ LLVM_ATTRIBUTE_DEPRECATED (
230+ static bool matchesAccessPath (AccessPathTy AccessPath, DeclName Name),
231+ "use ImportPath::Access::matches() instead")
232+ {
229233 assert (AccessPath.size () <= 1 && " can only refer to top-level decls" );
230234
231235 return AccessPath.empty ()
@@ -240,8 +244,8 @@ class ModuleDecl : public DeclContext, public TypeDecl {
240244 if (lhs.importedModule != rhs.importedModule )
241245 return std::less<const ModuleDecl *>()(lhs.importedModule ,
242246 rhs.importedModule );
243- if (lhs.accessPath .data () != rhs.accessPath .data ())
244- return std::less<AccessPathTy ::iterator>()(lhs.accessPath .begin (),
247+ if (lhs.accessPath .getRaw (). data () != rhs.accessPath . getRaw () .data ())
248+ return std::less<ImportPath::Raw ::iterator>()(lhs.accessPath .begin (),
245249 rhs.accessPath .begin ());
246250 return lhs.accessPath .size () < rhs.accessPath .size ();
247251 }
@@ -583,7 +587,7 @@ class ModuleDecl : public DeclContext, public TypeDecl {
583587 // / Find ValueDecls in the module and pass them to the given consumer object.
584588 // /
585589 // / This does a simple local lookup, not recursively looking through imports.
586- void lookupVisibleDecls (AccessPathTy AccessPath,
590+ void lookupVisibleDecls (ImportPath::Access AccessPath,
587591 VisibleDeclConsumer &Consumer,
588592 NLKind LookupKind) const ;
589593
@@ -596,13 +600,13 @@ class ModuleDecl : public DeclContext, public TypeDecl {
596600 // / Finds all class members defined in this module.
597601 // /
598602 // / This does a simple local lookup, not recursively looking through imports.
599- void lookupClassMembers (AccessPathTy accessPath,
603+ void lookupClassMembers (ImportPath::Access accessPath,
600604 VisibleDeclConsumer &consumer) const ;
601605
602606 // / Finds class members defined in this module with the given name.
603607 // /
604608 // / This does a simple local lookup, not recursively looking through imports.
605- void lookupClassMember (AccessPathTy accessPath,
609+ void lookupClassMember (ImportPath::Access accessPath,
606610 DeclName name,
607611 SmallVectorImpl<ValueDecl*> &results) const ;
608612
@@ -757,7 +761,9 @@ class ModuleDecl : public DeclContext, public TypeDecl {
757761 // / identifiers.
758762 // /
759763 // / Source locations are ignored here.
760- static bool isSameAccessPath (AccessPathTy lhs, AccessPathTy rhs);
764+ LLVM_ATTRIBUTE_DEPRECATED (
765+ static bool isSameAccessPath (AccessPathTy lhs, AccessPathTy rhs),
766+ "use ImportPath::Access::isSameAs() instead");
761767
762768 // / Get the path for the file that this module came from, or an empty
763769 // / string if this is not applicable.
@@ -890,7 +896,7 @@ namespace llvm {
890896 static bool isEqual (const ModuleDecl::ImportedModule &lhs,
891897 const ModuleDecl::ImportedModule &rhs) {
892898 return lhs.importedModule == rhs.importedModule &&
893- ModuleDecl::isSameAccessPath ( lhs.accessPath , rhs.accessPath );
899+ lhs.accessPath . isSameAs ( rhs.accessPath );
894900 }
895901 };
896902}
0 commit comments