[deserialization] Expose ModuleFile::error and use the method in SILDeserializer to mark a module as being malformed when invalid SIL is encountered.

Swift SVN r14703
This commit is contained in:
Michael Gottesman
2014-03-06 00:08:35 +00:00
parent 84c9eb0d2f
commit 2aa197f636
2 changed files with 9 additions and 2 deletions

View File

@@ -246,7 +246,9 @@ private:
/// Constructs an new module and validates it.
ModuleFile(std::unique_ptr<llvm::MemoryBuffer> input, bool isFramework);
/// Convenience function for module loading.
public:
/// Change the status of the current module. Default argument marks the module
/// as being malformed.
void error(ModuleStatus issue = ModuleStatus::Malformed) {
assert(issue != ModuleStatus::Valid);
assert((!FileContext || issue != ModuleStatus::Malformed) &&
@@ -254,7 +256,6 @@ private:
setStatus(issue);
}
public:
ASTContext &getContext() const {
assert(FileContext && "no associated context yet");
return FileContext->getParentModule()->Ctx;