Introduce a new ModuleKind enum to implement RTTI for module downcasting.

No functionality change.



Swift SVN r8053
This commit is contained in:
Chris Lattner
2013-09-09 21:53:21 +00:00
parent 387946298e
commit 53e0f11141
4 changed files with 43 additions and 9 deletions

View File

@@ -386,13 +386,18 @@ public:
SerializedModule(ASTContext &ctx, SerializedModuleLoader &owner,
Identifier name, std::string DebugModuleName,
Component *comp, ModuleFile *file)
: LoadedModule(DeclContextKind::SerializedModule, name, DebugModuleName,
: LoadedModule(DeclContextKind::SerializedModule,
ModuleKind::SerializedModule, name, DebugModuleName,
comp, ctx, owner),
File(file) {}
static bool classof(const DeclContext *DC) {
return DC->getContextKind() == DeclContextKind::SerializedModule;
}
static bool classof(const Module *M) {
return M->getKind() == ModuleKind::SerializedModule;
}
};
} // end namespace swift