diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-06-04 22:36:26 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-06-04 23:27:12 +0200 |
commit | 2cbc99d18dc411ac3fdef94e22ce86859806e63c (patch) | |
tree | 82939940413c5e726889ccd97fa2afd33e0b06be /gcc/d/dmd/parse.c | |
parent | 4e05c918d28e3fa66f5baaf556f6886447c68c9a (diff) | |
download | gcc-2cbc99d18dc411ac3fdef94e22ce86859806e63c.zip gcc-2cbc99d18dc411ac3fdef94e22ce86859806e63c.tar.gz gcc-2cbc99d18dc411ac3fdef94e22ce86859806e63c.tar.bz2 |
d: Merge upstream dmd 48d704f08
Updates the Array interface in dmd/root/array.h to use a DArray<TYPE>
internally. Splits out BitArray into a separate header.
Reviewed-on: https://github.com/dlang/dmd/pull/11219
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd 48d704f08.
* d-attribs.cc (build_attributes): Use new field name.
* d-builtins.cc (build_frontend_type): Likewise.
(maybe_set_builtin_1): Likewise.
(d_maybe_set_builtin): Likewise.
* d-codegen.cc (build_interface_binfo): Likewise.
(identity_compare_p): Likewise.
(lower_struct_comparison): Likewise.
(build_struct_comparison): Likewise.
(d_build_call): Likewise.
(build_frame_type): Likewise.
(build_closure): Likewise.
* d-compiler.cc (Compiler::paintAsType): Likewise.
(Compiler::loadModule): Likewise.
* d-incpath.cc (add_globalpaths): Likewise.
(add_filepaths): Likewise.
(add_import_paths): Likewise.
* d-lang.cc (deps_write): Likewise.
(d_parse_file): Likewise.
* decl.cc (gcc_attribute_p): Likewise.
(base_vtable_offset): Likewise.
(get_vtable_decl): Likewise.
(build_class_instance): Likewise.
* expr.cc (class ExprVisitor): Likewise.
* modules.cc (layout_moduleinfo_fields): Likewise.
(layout_moduleinfo): Likewise.
(build_module_tree): Likewise.
* toir.cc (class IRVisitor): Likewise.
* typeinfo.cc (class TypeInfoVisitor): Likewise.
(layout_classinfo_interfaces): Likewise.
* types.cc (layout_aggregate_members): Likewise.
(layout_aggregate_type): Likewise.
Diffstat (limited to 'gcc/d/dmd/parse.c')
-rw-r--r-- | gcc/d/dmd/parse.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/gcc/d/dmd/parse.c b/gcc/d/dmd/parse.c index 4921cf6..7d858d7 100644 --- a/gcc/d/dmd/parse.c +++ b/gcc/d/dmd/parse.c @@ -354,8 +354,8 @@ Dsymbols *Parser::parseDeclDefs(int once, Dsymbol **pLastDecl, PrefixAttributes case TOKtraits: Ldeclaration: a = parseDeclarations(false, pAttrs, pAttrs->comment); - if (a && a->dim) - *pLastDecl = (*a)[a->dim-1]; + if (a && a->length) + *pLastDecl = (*a)[a->length-1]; break; case TOKthis: @@ -577,8 +577,8 @@ Dsymbols *Parser::parseDeclDefs(int once, Dsymbol **pLastDecl, PrefixAttributes { a = parseAutoDeclarations(pAttrs->storageClass, pAttrs->comment); pAttrs->storageClass = STCundefined; - if (a && a->dim) - *pLastDecl = (*a)[a->dim-1]; + if (a && a->length) + *pLastDecl = (*a)[a->length-1]; if (pAttrs->udas) { s = new UserAttributeDeclaration(pAttrs->udas, a); @@ -596,8 +596,8 @@ Dsymbols *Parser::parseDeclDefs(int once, Dsymbol **pLastDecl, PrefixAttributes ) { a = parseDeclarations(true, pAttrs, pAttrs->comment); - if (a && a->dim) - *pLastDecl = (*a)[a->dim-1]; + if (a && a->length) + *pLastDecl = (*a)[a->length-1]; if (pAttrs->udas) { s = new UserAttributeDeclaration(pAttrs->udas, a); @@ -704,8 +704,8 @@ Dsymbols *Parser::parseDeclDefs(int once, Dsymbol **pLastDecl, PrefixAttributes if (idents) { assert(link == LINKcpp); - assert(idents->dim); - for (size_t i = idents->dim; i;) + assert(idents->length); + for (size_t i = idents->length; i;) { Identifier *id = (*idents)[--i]; if (s) @@ -950,7 +950,7 @@ Dsymbols *Parser::parseDeclDefs(int once, Dsymbol **pLastDecl, PrefixAttributes decldefs->push(s); addComment(s, pAttrs->comment); } - else if (a && a->dim) + else if (a && a->length) { decldefs->append(a); } @@ -3251,10 +3251,10 @@ Type *Parser::parseBasicTypeStartingAt(TypeQualified *tid, bool dontLookDotIdent break; } } - assert(dimStack.dim > 0); + assert(dimStack.length > 0); // We're good. Replay indices in the reverse order. tid = (TypeQualified *)t; - while (dimStack.dim) + while (dimStack.length) { tid->addIndex(dimStack.pop()); } @@ -4820,7 +4820,7 @@ Statement *Parser::parseForeach(Loc loc, bool *isRange, bool isDecl) check(TOKsemicolon); Expression *aggr = parseExpression(); - if (token.value == TOKslice && parameters->dim == 1) + if (token.value == TOKslice && parameters->length == 1) { Parameter *p = (*parameters)[0]; delete parameters; @@ -5073,11 +5073,11 @@ Statement *Parser::parseStatement(int flags, const utf8_t** endPtr, Loc *pEndloc Ldeclaration: { Dsymbols *a = parseDeclarations(false, NULL, NULL); - if (a->dim > 1) + if (a->length > 1) { Statements *as = new Statements(); - as->reserve(a->dim); - for (size_t i = 0; i < a->dim; i++) + as->reserve(a->length); + for (size_t i = 0; i < a->length; i++) { Dsymbol *d = (*a)[i]; s = new ExpStatement(loc, d); @@ -5085,7 +5085,7 @@ Statement *Parser::parseStatement(int flags, const utf8_t** endPtr, Loc *pEndloc } s = new CompoundDeclarationStatement(loc, as); } - else if (a->dim == 1) + else if (a->length == 1) { Dsymbol *d = (*a)[0]; s = new ExpStatement(loc, d); @@ -5500,7 +5500,7 @@ Statement *Parser::parseStatement(int flags, const utf8_t** endPtr, Loc *pEndloc */ if (token.value == TOKslice) { - if (cases.dim > 1) + if (cases.length > 1) error("only one case allowed for start of case range"); nextToken(); check(TOKcase); @@ -5531,7 +5531,7 @@ Statement *Parser::parseStatement(int flags, const utf8_t** endPtr, Loc *pEndloc else { // Keep cases in order by building the case statements backwards - for (size_t i = cases.dim; i; i--) + for (size_t i = cases.length; i; i--) { exp = cases[i - 1]; s = new CaseStatement(loc, exp, s); @@ -7154,7 +7154,7 @@ Expression *Parser::parsePrimaryExp() while (token.value != TOKrbracket && token.value != TOKeof) { e = parseAssignExp(); - if (token.value == TOKcolon && (keys || values->dim == 0)) + if (token.value == TOKcolon && (keys || values->length == 0)) { nextToken(); if (!keys) keys = new Expressions(); |