Add request to query primary files

Remove the `PrimarySourceFiles` vector from the
frontend and replace it with a request on
ModuleDecl that retrieves the primary files for
the main module.

This is in preparation for having
`CompilerInstance::getMainModule` automatically
populate the main module with files when queried.
This commit is contained in:
Hamish Knight
2020-06-02 09:10:35 -07:00
parent 71b2c5003f
commit e60c7fe547
7 changed files with 67 additions and 16 deletions

View File

@@ -548,6 +548,10 @@ public:
return Bits.ModuleDecl.IsMainModule;
}
/// For the main module, retrieves the list of primary source files being
/// compiled, that is, the files we're generating code for.
ArrayRef<SourceFile *> getPrimarySourceFiles() const;
/// Retrieve the top-level module. If this module is already top-level, this
/// returns itself. If this is a submodule such as \c Foo.Bar.Baz, this
/// returns the module \c Foo.