Remove useless forwarding methods from LoadedModule.

A part of my mind wanted to skip the kind check in Module's implementation
of these if we already knew we were dealing with a LoadedModule, but the
extra level of indirection is fairly annoying. Just jump straight to the
LoadedModule's owner here.

(We can't use virtual methods because we want Module to stay vtable-free.)

Swift SVN r7337
This commit is contained in:
Jordan Rose
2013-08-19 22:45:10 +00:00
parent c098cd1476
commit 048c659a32
2 changed files with 12 additions and 55 deletions

View File

@@ -368,6 +368,8 @@ public:
/// This may be a Swift module or a Clang module.
class LoadedModule : public Module {
protected:
friend class Module;
LoadedModule(DeclContextKind kind, Identifier name,
std::string DebugModuleName, Component *comp,
ASTContext &ctx, ModuleLoader &owner)
@@ -385,10 +387,6 @@ protected:
std::string DebugModuleName;
public:
// Inherited from Module.
void lookupValue(AccessPathTy accessPath, Identifier name, NLKind lookupKind,
SmallVectorImpl<ValueDecl*> &result);
/// Look up an operator declaration.
///
/// \param name The operator name ("+", ">>", etc.)
@@ -404,22 +402,6 @@ public:
"Must specify prefix, postfix, or infix operator decl");
}
/// Adds any modules re-exported by this module to the given vector.
void getReexportedModules(SmallVectorImpl<ImportedModule> &modules) const;
/// Find ValueDecls in the module and pass them to the given consumer object.
void lookupVisibleDecls(AccessPathTy accessPath,
VisibleDeclConsumer &consumer,
NLKind lookupKind) const;
// Inherited from Module.
void lookupClassMembers(AccessPathTy accessPath,
VisibleDeclConsumer &consumer) const;
void lookupClassMember(AccessPathTy accessPath,
Identifier name,
SmallVectorImpl<ValueDecl*> &results) const;
static bool classof(const DeclContext *DC) {
return DC->getContextKind() >= DeclContextKind::First_LoadedModule &&
DC->getContextKind() <= DeclContextKind::Last_LoadedModule;