[AST] Completely replace Module with ModuleDecl

The typedef `swift::Module` was a temporary solution that allowed
`swift::Module` to be renamed to `swift::ModuleDecl` without requiring
every single callsite to be modified.

Modify all the callsites, and get rid of the typedef.
This commit is contained in:
Brian Gesiak
2017-01-07 17:06:35 -05:00
parent c0ecff1344
commit 663b92ece9
87 changed files with 561 additions and 562 deletions

View File

@@ -50,7 +50,7 @@ class ModuleFile : public LazyMemberLoader {
FileUnit *FileContext = nullptr;
/// The module shadowed by this module, if any.
Module *ShadowedModule = nullptr;
ModuleDecl *ShadowedModule = nullptr;
/// The module file data.
std::unique_ptr<llvm::MemoryBuffer> ModuleInputBuffer;
@@ -120,7 +120,7 @@ public:
/// Represents another module that has been imported as a dependency.
class Dependency {
public:
Module::ImportedModule Import = {};
ModuleDecl::ImportedModule Import = {};
const StringRef RawPath;
private:
@@ -419,7 +419,7 @@ public:
return FileContext->getParentModule()->getASTContext();
}
Module *getAssociatedModule() const {
ModuleDecl *getAssociatedModule() const {
assert(FileContext && "no associated context yet");
return FileContext->getParentModule();
}
@@ -515,7 +515,7 @@ private:
/// because it reads from the cursor, it is not possible to reset the cursor
/// after reading. Nothing should ever follow an XREF record except
/// XREF_PATH_PIECE records.
Decl *resolveCrossReference(Module *M, uint32_t pathLen);
Decl *resolveCrossReference(ModuleDecl *M, uint32_t pathLen);
/// Populates TopLevelIDs for name lookup.
void buildTopLevelDeclMap();
@@ -576,7 +576,7 @@ public:
}
/// The module shadowed by this module, if any.
Module *getShadowedModule() const { return ShadowedModule; }
ModuleDecl *getShadowedModule() const { return ShadowedModule; }
/// Searches the module's top-level decls for the given identifier.
void lookupValue(DeclName name, SmallVectorImpl<ValueDecl*> &results);
@@ -596,13 +596,13 @@ public:
PrecedenceGroupDecl *lookupPrecedenceGroup(Identifier name);
/// Adds any imported modules to the given vector.
void getImportedModules(SmallVectorImpl<Module::ImportedModule> &results,
Module::ImportFilter filter);
void getImportedModules(SmallVectorImpl<ModuleDecl::ImportedModule> &results,
ModuleDecl::ImportFilter filter);
void getImportDecls(SmallVectorImpl<Decl *> &Results);
/// Reports all visible top-level members in this module.
void lookupVisibleDecls(Module::AccessPathTy accessPath,
void lookupVisibleDecls(ModuleDecl::AccessPathTy accessPath,
VisibleDeclConsumer &consumer,
NLKind lookupKind);
@@ -633,13 +633,13 @@ public:
/// Reports all class members in the module to the given consumer.
///
/// This is intended for use with id-style lookup and code completion.
void lookupClassMembers(Module::AccessPathTy accessPath,
void lookupClassMembers(ModuleDecl::AccessPathTy accessPath,
VisibleDeclConsumer &consumer);
/// Adds class members in the module with the given name to the given vector.
///
/// This is intended for use with id-style lookup.
void lookupClassMember(Module::AccessPathTy accessPath,
void lookupClassMember(ModuleDecl::AccessPathTy accessPath,
DeclName name,
SmallVectorImpl<ValueDecl*> &results);
@@ -649,7 +649,7 @@ public:
SmallVectorImpl<AbstractFunctionDecl *> &results);
/// Reports all link-time dependencies.
void collectLinkLibraries(Module::LinkLibraryCallback callback) const;
void collectLinkLibraries(ModuleDecl::LinkLibraryCallback callback) const;
/// Adds all top-level decls to the given vector.
void getTopLevelDecls(SmallVectorImpl<Decl*> &Results);
@@ -733,13 +733,13 @@ public:
DeclContext *getLocalDeclContext(serialization::DeclContextID DID);
/// Returns the appropriate module for the given ID.
Module *getModule(serialization::ModuleID MID);
ModuleDecl *getModule(serialization::ModuleID MID);
/// Returns the appropriate module for the given name.
///
/// If the name matches the name of the current module, a shadowed module
/// is loaded instead.
Module *getModule(ArrayRef<Identifier> name);
ModuleDecl *getModule(ArrayRef<Identifier> name);
/// Returns the generic signature or environment for the given ID,
/// deserializing it if needed.