Add some serialization debug guards.

No functionality change.

Swift SVN r5746
This commit is contained in:
Jordan Rose
2013-06-21 17:52:00 +00:00
parent c957a28f99
commit 5e0d3f15fc

View File

@@ -222,6 +222,12 @@ Decl *ModuleFile::getDecl(DeclID DID) {
return nullptr;
}
#ifndef NDEBUG
assert(declOrOffset.get<BitOffset>() != 0 &&
"this decl is already being deserialized");
declOrOffset = BitOffset(0);
#endif
ASTContext &ctx = ModuleContext->Ctx;
SmallVector<uint64_t, 64> scratch;
@@ -548,6 +554,12 @@ Type ModuleFile::getType(TypeID TID) {
return nullptr;
}
#ifndef NDEBUG
assert(typeOrOffset.get<BitOffset>() != 0 &&
"this type is already being deserialized");
typeOrOffset = BitOffset(0);
#endif
ASTContext &ctx = ModuleContext->Ctx;
SmallVector<uint64_t, 64> scratch;