diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2022-12-09 18:59:38 +0100 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2022-12-11 17:17:58 +0100 |
commit | 6d799f0aed18be25a5c908499b6411ab6d06b78c (patch) | |
tree | 3e6a91048c7fe3e78bae9f75b24eb37c5504681b /gcc/d/dmd/doc.d | |
parent | cc7f509d3c0b3ab63891cf7ca2def0fdfb3642c4 (diff) | |
download | gcc-6d799f0aed18be25a5c908499b6411ab6d06b78c.zip gcc-6d799f0aed18be25a5c908499b6411ab6d06b78c.tar.gz gcc-6d799f0aed18be25a5c908499b6411ab6d06b78c.tar.bz2 |
d: Merge upstream dmd, druntime c8ae4adb2e, phobos 792c8b7c1.
D front-end changes:
- Import dmd v2.101.0.
- Deprecate the ability to call `__traits(getAttributes)' on
overload sets.
- Deprecate non-empty `for' statement increment clause with no
effect.
- Array literals assigned to `scope' array variables can now be
allocated on the stack.
D runtime changes:
- Import druntime v2.101.0.
Phobos changes:
- Import phobos v2.101.0.
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd c8ae4adb2e.
* typeinfo.cc (check_typeinfo_type): Update for new front-end
interface.
(TypeInfoVisitor::visit (TypeInfoStructDeclaration *)): Remove warning
that toHash() must be declared 'nothrow @safe`.
libphobos/ChangeLog:
* libdruntime/MERGE: Merge upstream druntime c8ae4adb2e.
* src/MERGE: Merge upstream phobos 792c8b7c1.
Diffstat (limited to 'gcc/d/dmd/doc.d')
-rw-r--r-- | gcc/d/dmd/doc.d | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/gcc/d/dmd/doc.d b/gcc/d/dmd/doc.d index e1d5897..c04409c4 100644 --- a/gcc/d/dmd/doc.d +++ b/gcc/d/dmd/doc.d @@ -106,7 +106,7 @@ private class Section void write(Loc loc, DocComment* dc, Scope* sc, Dsymbols* a, OutBuffer* buf) { - assert(a.dim); + assert(a.length); if (name.length) { static immutable table = @@ -161,7 +161,7 @@ private final class ParamSection : Section { override void write(Loc loc, DocComment* dc, Scope* sc, Dsymbols* a, OutBuffer* buf) { - assert(a.dim); + assert(a.length); Dsymbol s = (*a)[0]; // test const(char)* p = body_.ptr; size_t len = body_.length; @@ -295,10 +295,10 @@ private final class ParamSection : Section goto L1; // write out last one buf.writestring(")"); - TypeFunction tf = a.dim == 1 ? isTypeFunction(s) : null; + TypeFunction tf = a.length == 1 ? isTypeFunction(s) : null; if (tf) { - size_t pcount = (tf.parameterList.parameters ? tf.parameterList.parameters.dim : 0) + + size_t pcount = (tf.parameterList.parameters ? tf.parameterList.parameters.length : 0) + cast(int)(tf.parameterList.varargs == VarArg.variadic); if (pcount != paramcount) { @@ -386,7 +386,7 @@ extern(C++) void gendocfile(Module m) if (p) global.params.ddoc.files.shift(p); // Override with the ddoc macro files from the command line - for (size_t i = 0; i < global.params.ddoc.files.dim; i++) + for (size_t i = 0; i < global.params.ddoc.files.length; i++) { auto buffer = readFile(m.loc, global.params.ddoc.files[i]); // BUG: convert file contents to UTF-8 before use @@ -757,9 +757,9 @@ private void emitAnchor(ref OutBuffer buf, Dsymbol s, Scope* sc, bool forHeader if (auto imp = s.isImport()) { // For example: `public import core.stdc.string : memcpy, memcmp;` - if (imp.aliases.dim > 0) + if (imp.aliases.length > 0) { - for(int i = 0; i < imp.aliases.dim; i++) + for(int i = 0; i < imp.aliases.length; i++) { // Need to distinguish between // `public import core.stdc.string : memcpy, memcmp;` and @@ -866,7 +866,7 @@ private void expandTemplateMixinComments(TemplateMixin tm, ref OutBuffer buf, Sc TemplateDeclaration td = (tm && tm.tempdecl) ? tm.tempdecl.isTemplateDeclaration() : null; if (td && td.members) { - for (size_t i = 0; i < td.members.dim; i++) + for (size_t i = 0; i < td.members.length; i++) { Dsymbol sm = (*td.members)[i]; TemplateMixin tmc = sm.isTemplateMixin(); @@ -898,7 +898,7 @@ private void emitMemberComments(ScopeDsymbol sds, ref OutBuffer buf, Scope* sc) buf.writestring(m); size_t offset2 = buf.length; // to see if we write anything sc = sc.push(sds); - for (size_t i = 0; i < sds.members.dim; i++) + for (size_t i = 0; i < sds.members.length; i++) { Dsymbol s = (*sds.members)[i]; //printf("\ts = '%s'\n", s.toChars()); @@ -998,7 +998,7 @@ private void emitComment(Dsymbol s, ref OutBuffer buf, Scope* sc) // Put previous doc comment if exists if (DocComment* dc = sc.lastdc) { - assert(dc.a.dim > 0, "Expects at least one declaration for a" ~ + assert(dc.a.length > 0, "Expects at least one declaration for a" ~ "documentation comment"); auto symbol = dc.a[0]; @@ -1010,7 +1010,7 @@ private void emitComment(Dsymbol s, ref OutBuffer buf, Scope* sc) // Put the declaration signatures as the document 'title' buf.writestring(ddoc_decl_s); - for (size_t i = 0; i < dc.a.dim; i++) + for (size_t i = 0; i < dc.a.length; i++) { Dsymbol sx = dc.a[i]; // the added linebreaks in here make looking at multiple @@ -1138,7 +1138,7 @@ private void emitComment(Dsymbol s, ref OutBuffer buf, Scope* sc) return; if (ed.isAnonymous() && ed.members) { - for (size_t i = 0; i < ed.members.dim; i++) + for (size_t i = 0; i < ed.members.length; i++) { Dsymbol s = (*ed.members)[i]; emitComment(s, *buf, sc); @@ -1176,7 +1176,7 @@ private void emitComment(Dsymbol s, ref OutBuffer buf, Scope* sc) Dsymbols* d = ad.include(null); if (d) { - for (size_t i = 0; i < d.dim; i++) + for (size_t i = 0; i < d.length; i++) { Dsymbol s = (*d)[i]; //printf("AttribDeclaration::emitComment %s\n", s.toChars()); @@ -1210,7 +1210,7 @@ private void emitComment(Dsymbol s, ref OutBuffer buf, Scope* sc) * a template, then include(null) will fail. */ Dsymbols* d = cd.decl ? cd.decl : cd.elsedecl; - for (size_t i = 0; i < d.dim; i++) + for (size_t i = 0; i < d.length; i++) { Dsymbol s = (*d)[i]; emitComment(s, *buf, sc); @@ -1324,9 +1324,9 @@ private void toDocBuffer(Dsymbol s, ref OutBuffer buf, Scope* sc) if (d.isVarDeclaration() && td) { buf.writeByte('('); - if (td.origParameters && td.origParameters.dim) + if (td.origParameters && td.origParameters.length) { - for (size_t i = 0; i < td.origParameters.dim; i++) + for (size_t i = 0; i < td.origParameters.length; i++) { if (i) buf.writestring(", "); @@ -1484,7 +1484,7 @@ private void toDocBuffer(Dsymbol s, ref OutBuffer buf, Scope* sc) buf.printf("%s %s", cd.kind(), cd.toChars()); } int any = 0; - for (size_t i = 0; i < cd.baseclasses.dim; i++) + for (size_t i = 0; i < cd.baseclasses.length; i++) { BaseClass* bc = (*cd.baseclasses)[i]; if (bc.sym && bc.sym.ident == Id.Object) @@ -1557,7 +1557,7 @@ struct DocComment if (!comment) return dc; dc.parseSections(comment); - for (size_t i = 0; i < dc.sections.dim; i++) + for (size_t i = 0; i < dc.sections.length; i++) { Section sec = dc.sections[i]; if (iequals("copyright", sec.name)) @@ -1873,7 +1873,7 @@ struct DocComment void writeSections(Scope* sc, Dsymbols* a, OutBuffer* buf) { - assert(a.dim); + assert(a.length); //printf("DocComment::writeSections()\n"); Loc loc = (*a)[0].loc; if (Module m = (*a)[0].isModule()) @@ -1884,7 +1884,7 @@ struct DocComment size_t offset1 = buf.length; buf.writestring("$(DDOC_SECTIONS "); size_t offset2 = buf.length; - for (size_t i = 0; i < sections.dim; i++) + for (size_t i = 0; i < sections.length; i++) { Section sec = sections[i]; if (sec.nooutput) @@ -1902,7 +1902,7 @@ struct DocComment else sec.write(loc, &this, sc, a, buf); } - for (size_t i = 0; i < a.dim; i++) + for (size_t i = 0; i < a.length; i++) { Dsymbol s = (*a)[i]; if (Dsymbol td = getEponymousParent(s)) @@ -2719,7 +2719,7 @@ private Parameter isEponymousFunctionParameter(Dsymbols *a, const(char)[] p) @sa */ private TemplateParameter isTemplateParameter(Dsymbols* a, const(char)* p, size_t len) { - for (size_t i = 0; i < a.dim; i++) + for (size_t i = 0; i < a.length; i++) { TemplateDeclaration td = (*a)[i].isTemplateDeclaration(); // Check for the parent, if the current symbol is not a template declaration. @@ -5004,10 +5004,10 @@ private void highlightText(Scope* sc, Dsymbols* a, Loc loc, ref OutBuffer buf, s private void highlightCode(Scope* sc, Dsymbol s, ref OutBuffer buf, size_t offset) { auto imp = s.isImport(); - if (imp && imp.aliases.dim > 0) + if (imp && imp.aliases.length > 0) { // For example: `public import core.stdc.string : memcpy, memcmp;` - for(int i = 0; i < imp.aliases.dim; i++) + for(int i = 0; i < imp.aliases.length; i++) { // Need to distinguish between // `public import core.stdc.string : memcpy, memcmp;` and @@ -5089,7 +5089,7 @@ private void highlightCode(Scope* sc, Dsymbols* a, ref OutBuffer buf, size_t off size_t previ = i; // hunt for template declarations: - foreach (symi; 0 .. a.dim) + foreach (symi; 0 .. a.length) { FuncDeclaration fd = (*a)[symi].isFuncDeclaration(); @@ -5102,14 +5102,14 @@ private void highlightCode(Scope* sc, Dsymbols* a, ref OutBuffer buf, size_t off // build the template parameters Array!(size_t) paramLens; - paramLens.reserve(td.parameters.dim); + paramLens.reserve(td.parameters.length); OutBuffer parametersBuf; HdrGenState hgs; parametersBuf.writeByte('('); - foreach (parami; 0 .. td.parameters.dim) + foreach (parami; 0 .. td.parameters.length) { TemplateParameter tp = (*td.parameters)[parami]; |