[serialization] Remove FALL_BACK_TO_TRANSLATION_UNIT hack.

As a bring-up hack, the module serializer would write a special record,
FALL_BACK_TO_TRANSLATION_UNIT, if it encountered something it didn't know
how to serialize. This then directed the deserializer to ignore the
contents of the module file and instead reload the original source file.
Now that we can serialize pretty much everything*, though, we don't need
this, and instead we'd rather know where the serialization coverage has
gaps (by asserting).

Swift SVN r7752
This commit is contained in:
Jordan Rose
2013-08-29 22:05:43 +00:00
parent 65a53dfd9d
commit cad735b896
5 changed files with 73 additions and 174 deletions

View File

@@ -50,12 +50,6 @@ enum class ModuleStatus {
/// The module is valid.
Valid,
/// The module contains pointers to source files, which should be loaded
/// instead.
///
/// This is a bring-up hack and will eventually go away.
FallBackToTranslationUnit,
/// The module file format is too new to be used by this version of the
/// compiler.
FormatTooNew,
@@ -196,8 +190,7 @@ private:
/// Convenience function for module loading.
void error(ModuleStatus issue = ModuleStatus::Malformed) {
assert(issue != ModuleStatus::Valid &&
issue != ModuleStatus::FallBackToTranslationUnit);
assert(issue != ModuleStatus::Valid);
Status = issue;
}
@@ -316,8 +309,7 @@ public:
/// Returns paths to the source files that were used to build this module.
ArrayRef<StringRef> getInputSourcePaths() const {
assert(getStatus() == ModuleStatus::Valid ||
getStatus() == ModuleStatus::FallBackToTranslationUnit);
assert(getStatus() == ModuleStatus::Valid);
return SourcePaths;
}