[serialization] Hook up a module loader that just builds a TranslationUnit.

The writer stores the paths to the .swift files, the reader just loads
those .swift files. Fun!

No version validation yet. No separate ModuleReader class yet. No use of
the SerializedModule architecture yet, except for creating a dummy module
when the .sm file is corrupted.

Swift SVN r5164
This commit is contained in:
Jordan Rose
2013-05-13 21:41:23 +00:00
parent 8372f46fb4
commit ebcff9685f
5 changed files with 154 additions and 21 deletions

View File

@@ -49,8 +49,14 @@ public:
/// \returns the module referenced, if it could be loaded. Otherwise,
/// emits a diagnostic and returns NULL.
virtual Module *
loadModule(SourceLoc importLoc,
ArrayRef<std::pair<Identifier, SourceLoc>> path) override;
loadModule(SourceLoc importLoc, Module::AccessPathTy path) override;
private:
/// Report an error in reading a module file.
///
/// \returns A dummy module, to prevent reloadeding
// FIXME: This should move to a dedicated Reader class.
Module *error(std::pair<Identifier, SourceLoc> importLoc);
};
}