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/escape.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/escape.c')
-rw-r--r-- | gcc/d/dmd/escape.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/gcc/d/dmd/escape.c b/gcc/d/dmd/escape.c index c7eb055..df43a7f 100644 --- a/gcc/d/dmd/escape.c +++ b/gcc/d/dmd/escape.c @@ -74,12 +74,12 @@ bool checkParamArgumentEscape(Scope *sc, FuncDeclaration *fdc, Identifier *par, escapeByValue(arg, &er); - if (!er.byref.dim && !er.byvalue.dim && !er.byfunc.dim && !er.byexp.dim) + if (!er.byref.length && !er.byvalue.length && !er.byfunc.length && !er.byexp.length) return false; bool result = false; - for (size_t i = 0; i < er.byvalue.dim; i++) + for (size_t i = 0; i < er.byvalue.length; i++) { //printf("byvalue %s\n", v->toChars()); VarDeclaration *v = er.byvalue[i]; @@ -111,7 +111,7 @@ bool checkParamArgumentEscape(Scope *sc, FuncDeclaration *fdc, Identifier *par, } } - for (size_t i = 0; i < er.byref.dim; i++) + for (size_t i = 0; i < er.byref.length; i++) { VarDeclaration *v = er.byref[i]; if (v->isDataseg()) @@ -128,14 +128,14 @@ bool checkParamArgumentEscape(Scope *sc, FuncDeclaration *fdc, Identifier *par, } } - for (size_t i = 0; i < er.byfunc.dim; i++) + for (size_t i = 0; i < er.byfunc.length; i++) { FuncDeclaration *fd = er.byfunc[i]; //printf("fd = %s, %d\n", fd->toChars(), fd->tookAddressOf); VarDeclarations vars; findAllOuterAccessedVariables(fd, &vars); - for (size_t j = 0; j < vars.dim; j++) + for (size_t j = 0; j < vars.length; j++) { VarDeclaration *v = vars[j]; //printf("v = %s\n", v->toChars()); @@ -153,7 +153,7 @@ bool checkParamArgumentEscape(Scope *sc, FuncDeclaration *fdc, Identifier *par, } } - for (size_t i = 0; i < er.byexp.dim; i++) + for (size_t i = 0; i < er.byexp.length; i++) { Expression *ee = er.byexp[i]; if (sc->func->setUnsafe()) @@ -202,7 +202,7 @@ bool checkAssignEscape(Scope *sc, Expression *e, bool gag) escapeByValue(e2, &er); - if (!er.byref.dim && !er.byvalue.dim && !er.byfunc.dim && !er.byexp.dim) + if (!er.byref.length && !er.byvalue.length && !er.byfunc.length && !er.byexp.length) return false; VarDeclaration *va = NULL; @@ -226,7 +226,7 @@ bool checkAssignEscape(Scope *sc, Expression *e, bool gag) inferScope = ((TypeFunction *)sc->func->type)->trust != TRUSTsystem; bool result = false; - for (size_t i = 0; i < er.byvalue.dim; i++) + for (size_t i = 0; i < er.byvalue.length; i++) { VarDeclaration *v = er.byvalue[i]; //printf("byvalue: %s\n", v->toChars()); @@ -309,7 +309,7 @@ bool checkAssignEscape(Scope *sc, Expression *e, bool gag) } } - for (size_t i = 0; i < er.byref.dim; i++) + for (size_t i = 0; i < er.byref.length; i++) { VarDeclaration *v = er.byref[i]; //printf("byref: %s\n", v->toChars()); @@ -352,14 +352,14 @@ bool checkAssignEscape(Scope *sc, Expression *e, bool gag) } } - for (size_t i = 0; i < er.byfunc.dim; i++) + for (size_t i = 0; i < er.byfunc.length; i++) { FuncDeclaration *fd = er.byfunc[i]; //printf("fd = %s, %d\n", fd->toChars(), fd->tookAddressOf); VarDeclarations vars; findAllOuterAccessedVariables(fd, &vars); - for (size_t j = 0; j < vars.dim; j++) + for (size_t j = 0; j < vars.length; j++) { VarDeclaration *v = vars[j]; //printf("v = %s\n", v->toChars()); @@ -392,7 +392,7 @@ bool checkAssignEscape(Scope *sc, Expression *e, bool gag) } } - for (size_t i = 0; i < er.byexp.dim; i++) + for (size_t i = 0; i < er.byexp.length; i++) { Expression *ee = er.byexp[i]; if (va && !va->isDataseg() && !va->doNotInferScope) @@ -433,11 +433,11 @@ bool checkThrowEscape(Scope *sc, Expression *e, bool gag) escapeByValue(e, &er); - if (!er.byref.dim && !er.byvalue.dim && !er.byexp.dim) + if (!er.byref.length && !er.byvalue.length && !er.byexp.length) return false; bool result = false; - for (size_t i = 0; i < er.byvalue.dim; i++) + for (size_t i = 0; i < er.byvalue.length; i++) { VarDeclaration *v = er.byvalue[i]; //printf("byvalue %s\n", v->toChars()); @@ -528,11 +528,11 @@ static bool checkReturnEscapeImpl(Scope *sc, Expression *e, bool refs, bool gag) else escapeByValue(e, &er); - if (!er.byref.dim && !er.byvalue.dim && !er.byexp.dim) + if (!er.byref.length && !er.byvalue.length && !er.byexp.length) return false; bool result = false; - for (size_t i = 0; i < er.byvalue.dim; i++) + for (size_t i = 0; i < er.byvalue.length; i++) { VarDeclaration *v = er.byvalue[i]; //printf("byvalue %s\n", v->toChars()); @@ -595,7 +595,7 @@ static bool checkReturnEscapeImpl(Scope *sc, Expression *e, bool refs, bool gag) } } - for (size_t i = 0; i < er.byref.dim; i++) + for (size_t i = 0; i < er.byref.length; i++) { VarDeclaration *v = er.byref[i]; //printf("byref %s\n", v->toChars()); @@ -665,7 +665,7 @@ static bool checkReturnEscapeImpl(Scope *sc, Expression *e, bool refs, bool gag) } } - for (size_t i = 0; i < er.byexp.dim; i++) + for (size_t i = 0; i < er.byexp.length; i++) { Expression *ee = er.byexp[i]; //printf("byexp %s\n", ee->toChars()); @@ -819,7 +819,7 @@ static void escapeByValue(Expression *e, EscapeByResults *er) { if (e->basis) e->basis->accept(this); - for (size_t i = 0; i < e->elements->dim; i++) + for (size_t i = 0; i < e->elements->length; i++) { Expression *el = (*e->elements)[i]; if (el) @@ -832,7 +832,7 @@ static void escapeByValue(Expression *e, EscapeByResults *er) { if (e->elements) { - for (size_t i = 0; i < e->elements->dim; i++) + for (size_t i = 0; i < e->elements->length; i++) { Expression *ex = (*e->elements)[i]; if (ex) @@ -846,7 +846,7 @@ static void escapeByValue(Expression *e, EscapeByResults *er) Type *tb = e->newtype->toBasetype(); if (tb->ty == Tstruct && !e->member && e->arguments) { - for (size_t i = 0; i < e->arguments->dim; i++) + for (size_t i = 0; i < e->arguments->length; i++) { Expression *ex = (*e->arguments)[i]; if (ex) @@ -945,13 +945,13 @@ static void escapeByValue(Expression *e, EscapeByResults *er) else return; - if (e->arguments && e->arguments->dim) + if (e->arguments && e->arguments->length) { /* j=1 if _arguments[] is first argument, * skip it because it is not passed by ref */ size_t j = (tf->linkage == LINKd && tf->varargs == 1); - for (size_t i = j; i < e->arguments->dim; ++i) + for (size_t i = j; i < e->arguments->length; ++i) { Expression *arg = (*e->arguments)[i]; size_t nparams = Parameter::dim(tf->parameters); @@ -1141,14 +1141,14 @@ static void escapeByRef(Expression *e, EscapeByResults *er) return; if (tf->isref) { - if (e->arguments && e->arguments->dim) + if (e->arguments && e->arguments->length) { /* j=1 if _arguments[] is first argument, * skip it because it is not passed by ref */ size_t j = (tf->linkage == LINKd && tf->varargs == 1); - for (size_t i = j; i < e->arguments->dim; ++i) + for (size_t i = j; i < e->arguments->length; ++i) { Expression *arg = (*e->arguments)[i]; size_t nparams = Parameter::dim(tf->parameters); @@ -1216,10 +1216,10 @@ void findAllOuterAccessedVariables(FuncDeclaration *fd, VarDeclarations *vars) FuncDeclaration *fdp = p->isFuncDeclaration(); if (fdp) { - for (size_t i = 0; i < fdp->closureVars.dim; i++) + for (size_t i = 0; i < fdp->closureVars.length; i++) { VarDeclaration *v = fdp->closureVars[i]; - for (size_t j = 0; j < v->nestedrefs.dim; j++) + for (size_t j = 0; j < v->nestedrefs.length; j++) { FuncDeclaration *fdv = v->nestedrefs[j]; if (fdv == fd) |