Accept swiftmodule files on the command line as partial AST inputs.

Each loaded file gets added to the main module, rather than being a standalone
separate module. In theory, this will be used to assemble several partial
ASTs into a complete module. In practice, there's still a ways to go...but
this can already round-trip a single module file.

This also factors out the FileUnit-creating part of SerializedModuleLoader,
which should help clients like SourceKit that don't need to search for a
swiftmodule file associated with a particular import.

Swift SVN r10952
This commit is contained in:
Jordan Rose
2013-12-07 00:14:01 +00:00
parent b4e4b551bd
commit 439ba3e624
6 changed files with 185 additions and 121 deletions

View File

@@ -268,7 +268,7 @@ static Optional<swift::LibraryKind> getActualLibraryKind(unsigned rawKind) {
}
ModuleFile::ModuleFile(llvm::OwningPtr<llvm::MemoryBuffer> &&input)
ModuleFile::ModuleFile(std::unique_ptr<llvm::MemoryBuffer> input)
: FileContext(nullptr),
InputFile(std::move(input)),
InputReader(reinterpret_cast<const uint8_t *>(InputFile->getBufferStart()),