if (ad != NULL)
{
/* Recursively search through attribute decls. */
- Dsymbols *decls = ad->include (NULL, NULL);
+ Dsymbols *decls = ad->include (NULL);
if (decls && decls->length)
{
for (size_t i = 0; i < decls->length; i++)
void visit (AttribDeclaration *d)
{
- Dsymbols *ds = d->include (NULL, NULL);
+ Dsymbols *ds = d->include (NULL);
if (!ds)
return;
-48d704f082ebe8b199a9ef7712c223216cd70d3a
+6d5bffa54f7da21d388d9999e586fd8a11ebcdb1
The first line of this file holds the git revision number of the last
merge done from the dlang/dmd repository.
this->decl = decl;
}
-Dsymbols *AttribDeclaration::include(Scope *, ScopeDsymbol *)
+Dsymbols *AttribDeclaration::include(Scope *)
{
if (errors)
return NULL;
int AttribDeclaration::apply(Dsymbol_apply_ft_t fp, void *param)
{
- Dsymbols *d = include(_scope, NULL);
+ Dsymbols *d = include(_scope);
if (d)
{
void AttribDeclaration::addMember(Scope *sc, ScopeDsymbol *sds)
{
- Dsymbols *d = include(sc, sds);
+ Dsymbols *d = include(sc);
if (d)
{
void AttribDeclaration::setScope(Scope *sc)
{
- Dsymbols *d = include(sc, NULL);
+ Dsymbols *d = include(sc);
//printf("\tAttribDeclaration::setScope '%s', d = %p\n",toChars(), d);
if (d)
void AttribDeclaration::importAll(Scope *sc)
{
- Dsymbols *d = include(sc, NULL);
+ Dsymbols *d = include(sc);
//printf("\tAttribDeclaration::importAll '%s', d = %p\n", toChars(), d);
if (d)
if (semanticRun != PASSinit)
return;
semanticRun = PASSsemantic;
- Dsymbols *d = include(sc, NULL);
+ Dsymbols *d = include(sc);
//printf("\tAttribDeclaration::semantic '%s', d = %p\n",toChars(), d);
if (d)
void AttribDeclaration::semantic2(Scope *sc)
{
- Dsymbols *d = include(sc, NULL);
+ Dsymbols *d = include(sc);
if (d)
{
void AttribDeclaration::semantic3(Scope *sc)
{
- Dsymbols *d = include(sc, NULL);
+ Dsymbols *d = include(sc);
if (d)
{
//printf("AttribDeclaration::addComment %s\n", comment);
if (comment)
{
- Dsymbols *d = include(NULL, NULL);
+ Dsymbols *d = include(NULL);
if (d)
{
void AttribDeclaration::setFieldOffset(AggregateDeclaration *ad, unsigned *poffset, bool isunion)
{
- Dsymbols *d = include(NULL, NULL);
+ Dsymbols *d = include(NULL);
if (d)
{
bool AttribDeclaration::hasPointers()
{
- Dsymbols *d = include(NULL, NULL);
+ Dsymbols *d = include(NULL);
if (d)
{
bool AttribDeclaration::hasStaticCtorOrDtor()
{
- Dsymbols *d = include(NULL, NULL);
+ Dsymbols *d = include(NULL);
if (d)
{
bool AttribDeclaration::oneMember(Dsymbol **ps, Identifier *ident)
{
- Dsymbols *d = include(NULL, NULL);
+ Dsymbols *d = include(NULL);
return Dsymbol::oneMembers(d, ps, ident);
}
void AttribDeclaration::checkCtorConstInit()
{
- Dsymbols *d = include(NULL, NULL);
+ Dsymbols *d = include(NULL);
if (d)
{
void AttribDeclaration::addLocalClass(ClassDeclarations *aclasses)
{
- Dsymbols *d = include(NULL, NULL);
+ Dsymbols *d = include(NULL);
if (d)
{
void StorageClassDeclaration::addMember(Scope *sc, ScopeDsymbol *sds)
{
- Dsymbols *d = include(sc, sds);
+ Dsymbols *d = include(sc);
if (d)
{
Scope *sc2 = newScope(sc);
if (ad)
{
- Dsymbols *decls = ad->include(NULL, NULL);
+ Dsymbols *decls = ad->include(NULL);
unsigned nestedCount = 0;
if (decls && decls->length)
//printf("ConditionalDeclaration::oneMember(), inc = %d\n", condition->inc);
if (condition->inc)
{
- Dsymbols *d = condition->include(NULL, NULL) ? decl : elsedecl;
+ Dsymbols *d = condition->include(NULL) ? decl : elsedecl;
return Dsymbol::oneMembers(d, ps, ident);
}
else
// Decide if 'then' or 'else' code should be included
-Dsymbols *ConditionalDeclaration::include(Scope *sc, ScopeDsymbol *sds)
+Dsymbols *ConditionalDeclaration::include(Scope *sc)
{
//printf("ConditionalDeclaration::include(sc = %p) _scope = %p\n", sc, _scope);
return NULL;
assert(condition);
- return condition->include(_scope ? _scope : sc, sds) ? decl : elsedecl;
+ return condition->include(_scope ? _scope : sc) ? decl : elsedecl;
}
void ConditionalDeclaration::setScope(Scope *sc)
{
- Dsymbols *d = include(sc, NULL);
+ Dsymbols *d = include(sc);
//printf("\tConditionalDeclaration::setScope '%s', d = %p\n",toChars(), d);
if (d)
* Different from other AttribDeclaration subclasses, include() call requires
* the completion of addMember and setScope phases.
*/
-Dsymbols *StaticIfDeclaration::include(Scope *sc, ScopeDsymbol *)
+Dsymbols *StaticIfDeclaration::include(Scope *sc)
{
//printf("StaticIfDeclaration::include(sc = %p) _scope = %p\n", sc, _scope);
assert(scopesym); // addMember is already done
assert(_scope); // setScope is already done
- d = ConditionalDeclaration::include(_scope, scopesym);
+ d = ConditionalDeclaration::include(_scope);
if (d && !addisdone)
{
}
else
{
- d = ConditionalDeclaration::include(sc, scopesym);
+ d = ConditionalDeclaration::include(sc);
onStack = false;
return d;
}
return false;
}
-Dsymbols *StaticForeachDeclaration::include(Scope *, ScopeDsymbol *)
+Dsymbols *StaticForeachDeclaration::include(Scope *)
{
if (errors || onStack)
return NULL;
Dsymbols *decl; // array of Dsymbol's
AttribDeclaration(Dsymbols *decl);
- virtual Dsymbols *include(Scope *sc, ScopeDsymbol *sds);
+ virtual Dsymbols *include(Scope *sc);
int apply(Dsymbol_apply_ft_t fp, void *param);
static Scope *createNewScope(Scope *sc,
StorageClass newstc, LINK linkage, CPPMANGLE cppmangle, Prot protection,
ConditionalDeclaration(Condition *condition, Dsymbols *decl, Dsymbols *elsedecl);
Dsymbol *syntaxCopy(Dsymbol *s);
bool oneMember(Dsymbol **ps, Identifier *ident);
- Dsymbols *include(Scope *sc, ScopeDsymbol *sds);
+ Dsymbols *include(Scope *sc);
void addComment(const utf8_t *comment);
void setScope(Scope *sc);
void accept(Visitor *v) { v->visit(this); }
StaticIfDeclaration(Condition *condition, Dsymbols *decl, Dsymbols *elsedecl);
Dsymbol *syntaxCopy(Dsymbol *s);
- Dsymbols *include(Scope *sc, ScopeDsymbol *sds);
+ Dsymbols *include(Scope *sc);
void addMember(Scope *sc, ScopeDsymbol *sds);
void setScope(Scope *sc);
void importAll(Scope *sc);
StaticForeachDeclaration(StaticForeach *sfe, Dsymbols *decl);
Dsymbol *syntaxCopy(Dsymbol *s);
bool oneMember(Dsymbol **ps, Identifier *ident);
- Dsymbols *include(Scope *sc, ScopeDsymbol *sds);
+ Dsymbols *include(Scope *sc);
void addMember(Scope *sc, ScopeDsymbol *sds);
void addComment(const utf8_t *comment);
void setScope(Scope *sc);
ad = s->isAttribDeclaration();
if (ad)
{
- Dsymbols *decl = ad->include(NULL, NULL);
+ Dsymbols *decl = ad->include(NULL);
if (decl && decl->length)
{
for (size_t i = 0; i < decl->length; i++)
}
-int DebugCondition::include(Scope *sc, ScopeDsymbol *)
+int DebugCondition::include(Scope *sc)
{
//printf("DebugCondition::include() level = %d, debuglevel = %d\n", level, global.params.debuglevel);
if (inc == 0)
{
}
-int VersionCondition::include(Scope *sc, ScopeDsymbol *)
+int VersionCondition::include(Scope *sc)
{
//printf("VersionCondition::include() level = %d, versionlevel = %d\n", level, global.params.versionlevel);
//if (ident) printf("\tident = '%s'\n", ident->toChars());
return new StaticIfCondition(loc, exp->syntaxCopy());
}
-int StaticIfCondition::include(Scope *sc, ScopeDsymbol *sds)
+int StaticIfCondition::include(Scope *sc)
{
if (inc == 0)
{
}
sc = sc->push(sc->scopesym);
- sc->sds = sds; // sds gets any addMember()
bool errors = false;
bool result = evalStaticCondition(sc, exp, exp, errors);
Condition(Loc loc);
virtual Condition *syntaxCopy() = 0;
- virtual int include(Scope *sc, ScopeDsymbol *sds) = 0;
+ virtual int include(Scope *sc) = 0;
virtual DebugCondition *isDebugCondition() { return NULL; }
virtual VersionCondition *isVersionCondition() { return NULL; }
virtual void accept(Visitor *v) { v->visit(this); }
DebugCondition(Module *mod, unsigned level, Identifier *ident);
- int include(Scope *sc, ScopeDsymbol *sds);
+ int include(Scope *sc);
DebugCondition *isDebugCondition() { return this; }
void accept(Visitor *v) { v->visit(this); }
};
VersionCondition(Module *mod, unsigned level, Identifier *ident);
- int include(Scope *sc, ScopeDsymbol *sds);
+ int include(Scope *sc);
VersionCondition *isVersionCondition() { return this; }
void accept(Visitor *v) { v->visit(this); }
};
StaticIfCondition(Loc loc, Expression *exp);
Condition *syntaxCopy();
- int include(Scope *sc, ScopeDsymbol *sds);
+ int include(Scope *sc);
void accept(Visitor *v) { v->visit(this); }
};
* Hence, Ddoc omits attributes from template members.
*/
- Dsymbols *d = ad->include(NULL, NULL);
+ Dsymbols *d = ad->include(NULL);
if (d)
{
}
/* If generating doc comment, be careful because if we're inside
- * a template, then include(NULL, NULL) will fail.
+ * a template, then include(NULL) will fail.
*/
Dsymbols *d = cd->decl ? cd->decl : cd->elsedecl;
for (size_t i = 0; i < d->length; i++)
//printf("Scope::Scope() %p\n", this);
this->_module = NULL;
this->scopesym = NULL;
- this->sds = NULL;
this->enclosing = NULL;
this->parent = NULL;
this->sw = NULL;
//printf("Scope::push(this = %p) new = %p\n", this, s);
assert(!(flags & SCOPEfree));
s->scopesym = NULL;
- s->sds = NULL;
s->enclosing = this;
s->slabel = NULL;
s->nofree = 0;
{ Dsymbol *s = (*members)[i];
if (AttribDeclaration *a = s->isAttribDeclaration())
- result = ScopeDsymbol_foreach(sc, a->include(sc, NULL), dg, ctx, &n);
+ result = ScopeDsymbol_foreach(sc, a->include(sc), dg, ctx, &n);
else if (TemplateMixin *tm = s->isTemplateMixin())
result = ScopeDsymbol_foreach(sc, tm->members, dg, ctx, &n);
else if (s->isTemplateInstance())
if (m <= MATCHnomatch)
goto Lno;
s->semantic(sc);
- if (sc->sds)
- s->addMember(sc, sc->sds);
- else if (!sc->insert(s))
+ if (!sc->insert(s))
e->error("declaration %s is already defined", s->toChars());
unSpeculative(sc, s);
*/
if (!tup && !sc->insert(s))
e->error("declaration %s is already defined", s->toChars());
- if (sc->sds)
- s->addMember(sc, sc->sds);
unSpeculative(sc, s);
}
void visit(AttribDeclaration *d)
{
- Dsymbols *ds = d->include(NULL, NULL);
+ Dsymbols *ds = d->include(NULL);
if (ds)
{
Module *_module; // Root module
ScopeDsymbol *scopesym; // current symbol
- ScopeDsymbol *sds; // if in static if, and declaring new symbols,
- // sds gets the addMember()
FuncDeclaration *func; // function we are in
Dsymbol *parent; // parent to use
LabelStatement *slabel; // enclosing labelled statement
void visit(ConditionalDeclaration *d)
{
- result = visitMembers(d->loc, d->include(NULL, NULL));
+ result = visitMembers(d->loc, d->include(NULL));
}
void visit(StaticForeachDeclaration *d)
{
assert(d->sfe && !!d->sfe->aggrfe ^ !!d->sfe->rangefe);
- result = visitMembers(d->loc, d->include(NULL, NULL));
+ result = visitMembers(d->loc, d->include(NULL));
}
void visit(CompileDeclaration *d)
{
- result = visitMembers(d->loc, d->include(NULL, NULL));
+ result = visitMembers(d->loc, d->include(NULL));
}
};
Statement *s;
//printf("ConditionalStatement::flatten()\n");
- if (condition->include(sc, NULL))
+ if (condition->include(sc))
{
DebugCondition *dc = condition->isDebugCondition();
if (dc)
// If we can short-circuit evaluate the if statement, don't do the
// semantic analysis of the skipped code.
// This feature allows a limited form of conditional compilation.
- if (cs->condition->include(sc, NULL))
+ if (cs->condition->include(sc))
{
DebugCondition *dc = cs->condition->isDebugCondition();
if (dc)
if (attrDecl)
{
- Dsymbols *decl = attrDecl->include(NULL, NULL);
+ Dsymbols *decl = attrDecl->include(NULL);
collectUnitTests(decl, uniqueUnitTests, unitTests);
}
}
AttribDeclaration *attrib = sym->isAttribDeclaration ();
if (attrib != NULL)
{
- Dsymbols *decls = attrib->include (NULL, NULL);
+ Dsymbols *decls = attrib->include (NULL);
if (decls != NULL)
{
fields += layout_aggregate_members (decls, context, inherited_p);