Debug info: emit the module name for types declare in a swiftmodule.

Swift SVN r6734
This commit is contained in:
Adrian Prantl
2013-07-30 01:17:02 +00:00
parent b3050b1c04
commit 2306563aa2
7 changed files with 64 additions and 25 deletions

View File

@@ -322,9 +322,11 @@ public:
/// This may be a Swift module or a Clang module.
class LoadedModule : public Module {
protected:
LoadedModule(DeclContextKind kind, Identifier name, Component *comp,
LoadedModule(DeclContextKind kind, Identifier name,
std::string DebugModuleName, Component *comp,
ASTContext &ctx, ModuleLoader &owner)
: Module(kind, name, comp, ctx) {
: Module(kind, name, comp, ctx),
DebugModuleName(DebugModuleName) {
// Loaded modules are always well-formed.
ASTStage = TypeChecked;
LookupCachePimpl = static_cast<void *>(&owner);
@@ -334,6 +336,8 @@ protected:
return *static_cast<ModuleLoader *>(LookupCachePimpl);
}
std::string DebugModuleName;
public:
// Inherited from Module.
void lookupValue(AccessPathTy accessPath, Identifier name, NLKind lookupKind,
@@ -366,6 +370,12 @@ public:
return DC->getContextKind() >= DeclContextKind::First_LoadedModule &&
DC->getContextKind() <= DeclContextKind::Last_LoadedModule;
}
/// \brief \return the name of the module as it should be
/// represented in the debug info.
std::string getDebugModuleName() const { return DebugModuleName; }
};
template <>