diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-06-15 17:39:12 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-06-16 23:33:58 +0200 |
commit | d873350a9c402a64cc333ef470131d427cf56b28 (patch) | |
tree | ec6eec46d4a04dfdb16d314e9e36fa69d2e93081 /gcc/d/decl.cc | |
parent | 6c4db916e28bf97a729ec06ff71da03963f0f7e4 (diff) | |
download | gcc-d873350a9c402a64cc333ef470131d427cf56b28.zip gcc-d873350a9c402a64cc333ef470131d427cf56b28.tar.gz gcc-d873350a9c402a64cc333ef470131d427cf56b28.tar.bz2 |
d: Use new isXxxxExp helpers where possible
gcc/d/ChangeLog:
* d-attribs.cc (build_attributes): Use isXxxxExp helpers instead of
explicit casts.
* d-codegen.cc (d_build_call): Likewise.
* d-compiler.cc (Compiler::paintAsType): Likewise.
* decl.cc (ExprVisitor::visit): Likewise.
(layout_class_initializer): Likewise.
* expr.cc (ExprVisitor::lvalue_p): Likewise
(ExprVisitor::visit): Likewise.
* types.cc (layout_aggregate_members): Likewise.
Diffstat (limited to 'gcc/d/decl.cc')
-rw-r--r-- | gcc/d/decl.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gcc/d/decl.cc b/gcc/d/decl.cc index a6144f7..28d1d6d 100644 --- a/gcc/d/decl.cc +++ b/gcc/d/decl.cc @@ -218,12 +218,11 @@ public: for (size_t i = 0; i < d->objects->length; i++) { RootObject *o = (*d->objects)[i]; - if ((o->dyncast () == DYNCAST_EXPRESSION) - && ((Expression *) o)->op == TOKdsymbol) + if (o->dyncast () == DYNCAST_EXPRESSION) { - Declaration *d = ((DsymbolExp *) o)->s->isDeclaration (); - if (d) - this->build_dsymbol (d); + DsymbolExp *de = ((Expression *) o)->isDsymbolExp (); + if (de != NULL && de->s->isDeclaration ()) + this->build_dsymbol (de->s); } } } @@ -2239,7 +2238,7 @@ layout_class_initializer (ClassDeclaration *cd) Expression *e = ne->ctfeInterpret (); gcc_assert (e->op == TOKclassreference); - return build_class_instance ((ClassReferenceExp *) e); + return build_class_instance (e->isClassReferenceExp ()); } tree |