]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
d: Merge upstream dmd 108ca1bcd.
authorIain Buclaw <ibuclaw@gdcproject.org>
Sun, 7 Jun 2020 17:42:58 +0000 (19:42 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Sun, 7 Jun 2020 17:44:20 +0000 (19:44 +0200)
Renames OutBuffer::peekString to OutBuffer::peekChars, and
OutBuffer::extractString to OutBuffer::extractChars.  All callers have
been updated as appropriate.

Reviewed-on: https://github.com/dlang/dmd/pull/11247

gcc/d/ChangeLog:

* dmd/MERGE: Merge upstream dmd 108ca1bcd.
* d-diagnostic.cc (expand_d_format): Adjust to use extractChars().
* d-frontend.cc (Loc::toChars): Likewise.
* d-lang.cc (deps_write): Likewise.
(d_parse_file): Likewise.
* decl.cc (d_mangle_decl): Likewise.
* intrinsics.cc (maybe_set_intrinsic): Likewise.

29 files changed:
gcc/d/d-diagnostic.cc
gcc/d/d-frontend.cc
gcc/d/d-lang.cc
gcc/d/decl.cc
gcc/d/dmd/MERGE
gcc/d/dmd/arrayop.c
gcc/d/dmd/attrib.c
gcc/d/dmd/cppmangle.c
gcc/d/dmd/declaration.c
gcc/d/dmd/dmangle.c
gcc/d/dmd/dmodule.c
gcc/d/dmd/doc.c
gcc/d/dmd/dscope.c
gcc/d/dmd/dtemplate.c
gcc/d/dmd/dversion.c
gcc/d/dmd/expression.c
gcc/d/dmd/expressionsem.c
gcc/d/dmd/func.c
gcc/d/dmd/hdrgen.c
gcc/d/dmd/identifier.c
gcc/d/dmd/init.c
gcc/d/dmd/mtype.c
gcc/d/dmd/parse.c
gcc/d/dmd/root/filename.c
gcc/d/dmd/root/outbuffer.c
gcc/d/dmd/root/outbuffer.h
gcc/d/dmd/statement.c
gcc/d/dmd/tokens.c
gcc/d/intrinsics.cc

index 6af35f71c31851491e3fdc0e54e1fbcbedd1dd83..bf10b11d600f4d43b2e7a79a18ace0348fbb231d 100644 (file)
@@ -110,7 +110,7 @@ expand_d_format (const char *format)
     }
 
   gcc_assert (!inbacktick);
-  return buf.extractString ();
+  return buf.extractChars ();
 }
 
 /* Helper routine for all error routines.  Reports a diagnostic specified by
index 28756161b93867233988128549bc691e3264ef78..90cf74a0f61c5a300ebb2b2753677545684b888d 100644 (file)
@@ -122,7 +122,7 @@ Loc::toChars (void) const
        buf.printf (":%u", this->charnum);
     }
 
-  return buf.extractString ();
+  return buf.extractChars ();
 }
 
 bool
index 41921934fdd4f281c55a43f97d42c063fdbc6307..2bc0def02c34b0953e6f6bd51eb3cd34a2f777a6 100644 (file)
@@ -163,7 +163,7 @@ deps_write (Module *module, OutBuffer *buffer, unsigned colmax = 72)
   /* Write out make target module name.  */
   if (d_option.deps_target)
     {
-      buffer->writestring (d_option.deps_target->extractString ());
+      buffer->writestring (d_option.deps_target->extractChars ());
       column = d_option.deps_target->offset;
     }
   else
@@ -1262,7 +1262,7 @@ d_parse_file (void)
         to make the middle-end fully deterministic.  */
       OutBuffer buf;
       mangleToBuffer (Module::rootModule, &buf);
-      first_global_object_name = buf.extractString ();
+      first_global_object_name = buf.extractChars ();
     }
 
   /* Make dependencies.  */
index f2d39a74cc8d9867e2e4749990062dd11d333044..a2a21428a265661baff5f9c52c2a95d9c05e732d 100644 (file)
@@ -68,7 +68,7 @@ d_mangle_decl (Dsymbol *decl)
     {
       OutBuffer buf;
       mangleToBuffer (decl, &buf);
-      return buf.extractString ();
+      return buf.extractChars ();
     }
 }
 
index 6ccb79c643bf0f8e887d0d2f55135ccaefce7763..96d579b90fc71de870433415db0fd4b25ac102f2 100644 (file)
@@ -1,4 +1,4 @@
-b0df0e982cc44bd09a9061acfc8160f29767334a
+108ca1bcde2096a2c6173c567a204d749538dd74
 
 The first line of this file holds the git revision number of the last
 merge done from the dlang/dmd repository.
index 3ec07e2b06825bf96850e9910a2b641110bf0f64..3beba9a206b7cbc08bfde6d08f4ee6ef312fcab8 100644 (file)
@@ -203,7 +203,7 @@ Expression *arrayOp(BinExp *e, Scope *sc)
      */
     buf.writestring(e->type->toBasetype()->nextOf()->toBasetype()->mutableOf()->deco);
 
-    char *name = buf.peekString();
+    char *name = buf.peekChars();
     Identifier *ident = Identifier::idPool(name);
 
     FuncDeclaration **pFd = (FuncDeclaration **)dmd_aaGet(&arrayfuncs, (void *)ident);
index f4ca06d296a9942f3c2462378da6d5b552687fa3..81b2da11e5634a76fc9bcdc6100cf48fc682daaf 100644 (file)
@@ -654,7 +654,7 @@ const char *ProtDeclaration::toPrettyChars(bool)
     buf.writeByte('\'');
     protectionToBuffer(&buf, protection);
     buf.writeByte('\'');
-    return buf.extractString();
+    return buf.extractChars();
 }
 
 /********************************* AlignDeclaration ****************************/
@@ -1132,7 +1132,7 @@ void PragmaDeclaration::semantic(Scope *sc)
                 if (args->length)
                     buf.writeByte(')');
             }
-            message("pragma    %s", buf.peekString());
+            message("pragma    %s", buf.peekChars());
         }
         goto Lnodecl;
     }
index ee19bd1932a1551a304708d2ec6e85d6434d6c87..b361d37f75d302b2aacb9767ef29040439f70ab6 100644 (file)
@@ -632,7 +632,7 @@ class CppMangleVisitor : public Visitor
                  *          ::= <prefix> <data-member-prefix>
                  */
                 prefix_name(p);
-                //printf("p: %s\n", buf.peekString());
+                //printf("p: %s\n", buf.peekChars());
 
                 if (d->isCtorDeclaration())
                 {
@@ -1110,7 +1110,7 @@ public:
     {
         buf->writestring("_ZTI");
         cpp_mangle_name(s, false);
-        return buf->extractString();
+        return buf->extractChars();
     }
 };
 
@@ -1120,7 +1120,7 @@ const char *toCppMangleItanium(Dsymbol *s)
     OutBuffer buf;
     CppMangleVisitor v(&buf, s->loc);
     v.mangleOf(s);
-    return buf.extractString();
+    return buf.extractChars();
 }
 
 const char *cppTypeInfoMangleItanium(Dsymbol *s)
@@ -1130,5 +1130,5 @@ const char *cppTypeInfoMangleItanium(Dsymbol *s)
     buf.writestring("_ZTI");    // "TI" means typeinfo structure
     CppMangleVisitor v(&buf, s->loc);
     v.cpp_mangle_name(s, false);
-    return buf.extractString();
+    return buf.extractChars();
 }
index 04f7a34ea9761d30ed9878a68c56f5cec41ec8a5..aa48195794b4040b720600b56ee0509a7f57eeb7 100644 (file)
@@ -1119,7 +1119,7 @@ Lnomatch:
 
             OutBuffer buf;
             buf.printf("__%s_field_%llu", ident->toChars(), (ulonglong)i);
-            const char *name = buf.extractString();
+            const char *name = buf.extractChars();
             Identifier *id = Identifier::idPool(name);
 
             Initializer *ti;
@@ -1190,7 +1190,7 @@ Lnomatch:
         {
             OutBuffer buf;
             stcToBuffer(&buf, stc);
-            error("cannot be %s", buf.peekString());
+            error("cannot be %s", buf.peekChars());
         }
         storage_class &= ~stc;  // strip off
     }
@@ -1202,7 +1202,7 @@ Lnomatch:
         {
             OutBuffer buf;
             stcToBuffer(&buf, stc);
-            error("cannot be 'scope' and '%s'", buf.peekString());
+            error("cannot be 'scope' and '%s'", buf.peekChars());
         }
         else if (isMember())
         {
@@ -2246,7 +2246,7 @@ const char *TypeInfoDeclaration::toChars()
     buf.writestring("typeid(");
     buf.writestring(tinfo->toChars());
     buf.writeByte(')');
-    return buf.extractString();
+    return buf.extractChars();
 }
 
 /***************************** TypeInfoConstDeclaration **********************/
index d6acafee5de034889b4d5375d41d4a9952389693..1c564b70e685ddc2459914a5b976766b5991a51e 100644 (file)
@@ -307,7 +307,7 @@ public:
         buf2.reserve(32);
         Mangler v(&buf2);
         v.paramsToDecoBuffer(t->arguments);
-        const char *s = buf2.peekString();
+        const char *s = buf2.peekChars();
         int len = (int)buf2.offset;
         buf->printf("%d%.*s", len, len, s);
     }
@@ -839,7 +839,7 @@ const char *mangleExact(FuncDeclaration *fd)
         OutBuffer buf;
         Mangler v(&buf);
         v.mangleExact(fd);
-        fd->mangleString = buf.extractString();
+        fd->mangleString = buf.extractChars();
     }
     return fd->mangleString;
 }
index 5bb544746ecaaada0c46c2fe035d7a6b59affd2c..f9f59a20224b340a490bb97298d6fa5916b63994 100644 (file)
@@ -202,7 +202,7 @@ static void checkModFileAlias(OutBuffer *buf, OutBuffer *dotmods,
         const char *m = (*ms)[j];
         const char *q = strchr(m, '=');
         assert(q);
-        if (dotmods->offset <= (size_t)(q - m) && memcmp(dotmods->peekString(), m, q - m) == 0)
+        if (dotmods->offset <= (size_t)(q - m) && memcmp(dotmods->peekChars(), m, q - m) == 0)
         {
             buf->reset();
             size_t qlen = strlen(q + 1);
@@ -283,7 +283,7 @@ Module *Module::load(Loc loc, Identifiers *packages, Identifier *ident)
             }
         }
         buf.printf("%s\t(%s)", ident->toChars(), m->srcfile->toChars());
-        message("import    %s", buf.peekString());
+        message("import    %s", buf.peekChars());
     }
 
     m = m->parse();
@@ -1129,7 +1129,7 @@ const char *ModuleDeclaration::toChars()
         }
     }
     buf.writestring(id->toChars());
-    return buf.extractString();
+    return buf.extractChars();
 }
 
 /* =========================== Package ===================== */
index 0738f4202d922be12ab631069857fe5d20a647ee..afe5c4bc00b67de76f4cd90eb531cde61b24464b 100644 (file)
@@ -622,7 +622,7 @@ static void emitAnchor(OutBuffer *buf, Dsymbol *s, Scope *sc)
     {
         OutBuffer anc;
         emitAnchorName(&anc, s, skipNonQualScopes(sc));
-        ident = Identifier::idPool(anc.peekString());
+        ident = Identifier::idPool(anc.peekChars());
     }
     size_t *count = (size_t*)dmd_aaGet(&sc->anchorCounts, (void *)ident);
     TemplateDeclaration *td = getEponymousParent(s);
index a5d56b2e4a7573dbf82ce53d8b96048ee9bc2a66..d7460a07d7b4a78fd89abb7c6ed48c932fec15a6 100644 (file)
@@ -661,7 +661,7 @@ void Scope::deprecation10378(Loc loc, Dsymbol *sold, Dsymbol *snew)
     else
         buf.writestring("nothing");
 
-    deprecation(loc, "%s", buf.peekString());
+    deprecation(loc, "%s", buf.peekChars());
 }
 
 Dsymbol *Scope::search_correct(Identifier *ident)
index 34fd621a9f9d133cd92813ccbacd40425c7bbb2b..5ec9a4b609c7d21ad8822adea3d616752e44f2d0 100644 (file)
@@ -2765,7 +2765,7 @@ const char *TemplateDeclaration::toChars()
         ::toCBuffer(constraint, &buf, &hgs);
         buf.writeByte(')');
     }
-    return buf.extractString();
+    return buf.extractChars();
 }
 
 Prot TemplateDeclaration::prot()
@@ -7571,7 +7571,7 @@ Identifier *TemplateInstance::genIdent(Objects *args)
 
             OutBuffer bufsa;
             mangleToBuffer(sa, &bufsa);
-            const char *s = bufsa.extractString();
+            const char *s = bufsa.extractChars();
 
             /* Bugzilla 3043: if the first character of s is a digit this
              * causes ambiguity issues because the digits of the two numbers are adjacent.
@@ -7592,7 +7592,7 @@ Identifier *TemplateInstance::genIdent(Objects *args)
             assert(0);
     }
     buf.writeByte('Z');
-    id = buf.peekString();
+    id = buf.peekChars();
     //printf("\tgenIdent = %s\n", id);
     return Identifier::idPool(id);
 }
@@ -7860,14 +7860,14 @@ const char *TemplateInstance::toChars()
 {
     OutBuffer buf;
     toCBufferInstance(this, &buf);
-    return buf.extractString();
+    return buf.extractChars();
 }
 
 const char *TemplateInstance::toPrettyCharsHelper()
 {
     OutBuffer buf;
     toCBufferInstance(this, &buf, true);
-    return buf.extractString();
+    return buf.extractChars();
 }
 
 /*************************************
@@ -8599,5 +8599,5 @@ const char *TemplateMixin::toChars()
 {
     OutBuffer buf;
     toCBufferInstance(this, &buf);
-    return buf.extractString();
+    return buf.extractChars();
 }
index 3c539a7ff83e131b0bba778000160d157cd5a58e..f88fca561c5448e5be3a2c338f3c90e525e7c84c 100644 (file)
@@ -47,7 +47,7 @@ const char *DebugSymbol::toChars()
     {
         OutBuffer buf;
         buf.printf("%d", level);
-        return buf.extractString();
+        return buf.extractChars();
     }
 }
 
@@ -137,7 +137,7 @@ const char *VersionSymbol::toChars()
     {
         OutBuffer buf;
         buf.printf("%d", level);
-        return buf.extractString();
+        return buf.extractChars();
     }
 }
 
index ca4a6e97d21d5b5b0992fd841b868b9e96fa4381..d15081763dfe082b29872b6099ccafeee4987f68 100644 (file)
@@ -2058,7 +2058,7 @@ const char *Expression::toChars()
     OutBuffer buf;
     HdrGenState hgs;
     toCBuffer(this, &buf, &hgs);
-    return buf.extractString();
+    return buf.extractChars();
 }
 
 void Expression::error(const char *format, ...) const
@@ -2557,7 +2557,7 @@ bool Expression::checkPurity(Scope *sc, VarDeclaration *v)
                     MODMatchToBuffer(&ffbuf, ff->type->mod, v->type->mod);
                     MODMatchToBuffer(&vbuf, v->type->mod, ff->type->mod);
                     error("%s%s '%s' cannot access %sdata '%s'",
-                        ffbuf.peekString(), ff->kind(), ff->toPrettyChars(), vbuf.peekString(), v->toChars());
+                        ffbuf.peekChars(), ff->kind(), ff->toPrettyChars(), vbuf.peekChars(), v->toChars());
                     err = true;
                     break;
                 }
@@ -6754,7 +6754,7 @@ Expression *PrettyFuncInitExp::resolveLoc(Loc loc, Scope *sc)
         const char *funcStr = fd->Dsymbol::toPrettyChars();
         OutBuffer buf;
         functionToBufferWithIdent((TypeFunction *)fd->type, &buf, funcStr);
-        s = buf.extractString();
+        s = buf.extractChars();
     }
     else
     {
index 9112b7bc307ca6992cae3d696abc5460b7e6e64a..25f4bd51a598c573b6bf3d9d1bb422f197b8592b 100644 (file)
@@ -2678,7 +2678,7 @@ public:
                 MODMatchToBuffer(&thisBuf, e->e1->type->mod, tf->mod);
                 MODMatchToBuffer(&funcBuf, tf->mod, e->e1->type->mod);
                 e->error("%smethod %s is not callable using a %s%s",
-                    funcBuf.peekString(), f->toPrettyChars(), thisBuf.peekString(), e->e1->toChars());
+                    funcBuf.peekChars(), f->toPrettyChars(), thisBuf.peekChars(), e->e1->toChars());
                 return setError();
             }
         }
@@ -3420,7 +3420,7 @@ public:
                 //printf("tf = %s, args = %s\n", tf->deco, (*exp->arguments)[0]->type->deco);
                 ::error(exp->loc, "%s %s %s is not callable using argument types %s",
                         p, exp->e1->toChars(), parametersTypeToChars(tf->parameterList),
-                        buf.peekString());
+                        buf.peekChars());
 
                 return setError();
             }
@@ -3493,7 +3493,7 @@ public:
                     //printf("tf = %s, args = %s\n", tf->deco, (*exp->arguments)[0]->type->deco);
                     ::error(exp->loc, "%s %s is not callable using argument types %s",
                             exp->e1->toChars(), parametersTypeToChars(tf->parameterList),
-                            buf.peekString());
+                            buf.peekChars());
 
                     exp->f = NULL;
                 }
@@ -8250,7 +8250,7 @@ Expression *semanticX(DotIdExp *exp, Scope *sc)
                     }
                     OutBuffer buf;
                     mangleToBuffer(ds, &buf);
-                    const char *s = buf.extractString();
+                    const char *s = buf.extractChars();
                     Expression *e = new StringExp(exp->loc, const_cast<char*>(s), strlen(s));
                     e = semantic(e, sc);
                     return e;
index aa09f3e7f650c42f1fba9b396a26f18edbfe92f2..276303a285103aa7e8044e7e08937ee2cafbd613 100644 (file)
@@ -618,7 +618,7 @@ void FuncDeclaration::semantic(Scope *sc)
         {
             OutBuffer buf;
             MODtoBuffer(&buf, tf->mod);
-            error("without 'this' cannot be %s", buf.peekString());
+            error("without 'this' cannot be %s", buf.peekChars());
             tf->mod = 0;    // remove qualifiers
         }
 
@@ -3258,7 +3258,7 @@ FuncDeclaration *FuncDeclaration::overloadModMatch(Loc loc, Type *tthis, bool &h
             MODMatchToBuffer(&thisBuf, tthis->mod, tf->mod);
             MODMatchToBuffer(&funcBuf, tf->mod, tthis->mod);
             ::error(loc, "%smethod %s is not callable using a %sobject",
-                funcBuf.peekString(), this->toPrettyChars(), thisBuf.peekString());
+                funcBuf.peekChars(), this->toPrettyChars(), thisBuf.peekChars());
         }
     }
 
@@ -3551,7 +3551,7 @@ FuncDeclaration *resolveFuncCall(Loc loc, Scope *sc, Dsymbol *s,
         {
             ::error(loc, "%s %s.%s cannot deduce function from argument types !(%s)%s, candidates are:",
                     td->kind(), td->parent->toPrettyChars(), td->ident->toChars(),
-                    tiargsBuf.peekString(), fargsBuf.peekString());
+                    tiargsBuf.peekChars(), fargsBuf.peekChars());
 
             // Display candidate templates (even if there are no multiple overloads)
             TemplateCandidateWalker tcw;
@@ -3562,7 +3562,7 @@ FuncDeclaration *resolveFuncCall(Loc loc, Scope *sc, Dsymbol *s,
         else if (od)
         {
             ::error(loc, "none of the overloads of '%s' are callable using argument types !(%s)%s",
-                od->ident->toChars(), tiargsBuf.peekString(), fargsBuf.peekString());
+                od->ident->toChars(), tiargsBuf.peekChars(), fargsBuf.peekChars());
         }
         else
         {
@@ -3577,22 +3577,22 @@ FuncDeclaration *resolveFuncCall(Loc loc, Scope *sc, Dsymbol *s,
                 MODMatchToBuffer(&funcBuf, tf->mod, tthis->mod);
                 if (hasOverloads)
                     ::error(loc, "none of the overloads of '%s' are callable using a %sobject, candidates are:",
-                        fd->ident->toChars(), thisBuf.peekString());
+                        fd->ident->toChars(), thisBuf.peekChars());
                 else
                     ::error(loc, "%smethod %s is not callable using a %sobject",
-                        funcBuf.peekString(), fd->toPrettyChars(), thisBuf.peekString());
+                        funcBuf.peekChars(), fd->toPrettyChars(), thisBuf.peekChars());
             }
             else
             {
                 //printf("tf = %s, args = %s\n", tf->deco, (*fargs)[0]->type->deco);
                 if (hasOverloads)
                     ::error(loc, "none of the overloads of '%s' are callable using argument types %s, candidates are:",
-                            fd->ident->toChars(), fargsBuf.peekString());
+                            fd->ident->toChars(), fargsBuf.peekChars());
                 else
                     fd->error(loc, "%s%s is not callable using argument types %s",
                         parametersTypeToChars(tf->parameterList),
                         tf->modToChars(),
-                        fargsBuf.peekString());
+                        fargsBuf.peekChars());
             }
 
             // Display candidate functions
@@ -3614,7 +3614,7 @@ FuncDeclaration *resolveFuncCall(Loc loc, Scope *sc, Dsymbol *s,
         ::error(loc, "%s.%s called with argument types %s matches both:\n"
                      "%s:     %s%s\nand:\n%s:     %s%s",
                 s->parent->toPrettyChars(), s->ident->toChars(),
-                fargsBuf.peekString(),
+                fargsBuf.peekChars(),
                 m.lastf->loc.toChars(), m.lastf->toPrettyChars(), lastprms,
                 m.nextf->loc.toChars(), m.nextf->toPrettyChars(), nextprms);
     }
@@ -3725,7 +3725,7 @@ const char *FuncDeclaration::toFullSignature()
 {
     OutBuffer buf;
     functionToBufferWithIdent(type->toTypeFunction(), &buf, toChars());
-    return buf.extractString();
+    return buf.extractChars();
 }
 
 bool FuncDeclaration::isMain()
@@ -5421,7 +5421,7 @@ static Identifier *unitTestId(Loc loc)
 {
     OutBuffer buf;
     buf.printf("__unittestL%u_", loc.linnum);
-    return Identifier::generateId(buf.peekString());
+    return Identifier::generateId(buf.peekChars());
 }
 
 UnitTestDeclaration::UnitTestDeclaration(Loc loc, Loc endloc, StorageClass stc, char *codedoc)
index af933bd2e88d94fce383850bcbb0aeb71f11d3fc..2c88ef597c6d25fca57f2fcc6aec0a1aca0d1edd 100644 (file)
@@ -3475,5 +3475,5 @@ const char *parametersTypeToChars(ParameterList pl)
     HdrGenState hgs;
     PrettyPrintVisitor v(&buf, &hgs);
     v.parametersToBuffer(pl.parameters, pl.varargs);
-    return buf.extractString();
+    return buf.extractChars();
 }
index d5c927c12b04d22b7317208f35c8ba63215635fd..1bd453fc53c222133966d299d909527c32f1031f 100644 (file)
@@ -110,7 +110,7 @@ Identifier *Identifier::generateId(const char *prefix, size_t i)
     buf.writestring(prefix);
     buf.printf("%llu", (ulonglong)i);
 
-    char *id = buf.peekString();
+    char *id = buf.peekChars();
     return idPool(id);
 }
 
index c4a496f8b5d4ff0ffa2f8944ac372b8254866778..28b4187b2e6c0e224d2b65179402e521cbe3c32c 100644 (file)
@@ -53,7 +53,7 @@ const char *Initializer::toChars()
     OutBuffer buf;
     HdrGenState hgs;
     ::toCBuffer(this, &buf, &hgs);
-    return buf.extractString();
+    return buf.extractChars();
 }
 
 /********************************** ErrorInitializer ***************************/
index d7144879fbad71d3ad706114b30507ec9baac378..30fd54da1853ba5f64c734f10903a0b0254e68a6 100644 (file)
@@ -1455,7 +1455,7 @@ char *MODtoChars(MOD mod)
     OutBuffer buf;
     buf.reserve(16);
     MODtoBuffer(&buf, mod);
-    return buf.extractString();
+    return buf.extractChars();
 }
 
 /********************************
@@ -1470,7 +1470,7 @@ const char *Type::toChars()
     hgs.fullQual = (ty == Tclass && !mod);
 
     ::toCBuffer(this, &buf, NULL, &hgs);
-    return buf.extractString();
+    return buf.extractChars();
 }
 
 char *Type::toPrettyChars(bool QualifyTypes)
@@ -1481,7 +1481,7 @@ char *Type::toPrettyChars(bool QualifyTypes)
     hgs.fullQual = QualifyTypes;
 
     ::toCBuffer(this, &buf, NULL, &hgs);
-    return buf.extractString();
+    return buf.extractChars();
 }
 
 /*********************************
@@ -1504,7 +1504,7 @@ char *Type::modToChars()
     OutBuffer buf;
     buf.reserve(16);
     modToBuffer(&buf);
-    return buf.extractString();
+    return buf.extractChars();
 }
 
 /** For each active modifier (MODconst, MODimmutable, etc) call fp with a
@@ -5715,7 +5715,7 @@ Type *TypeFunction::semantic(Loc loc, Scope *sc)
                             OutBuffer buf2;  stcToBuffer(&buf2, stc2);
 
                             error(loc, "incompatible parameter storage classes '%s' and '%s'",
-                                      buf1.peekString(), buf2.peekString());
+                                      buf1.peekChars(), buf2.peekChars());
                             errors = true;
                             stc = stc1 | (stc & ~(STCref | STCout | STClazy));
                         }
index e983501bde128d43b980a5b2ab48b4e437fdfead..38da580848445855e3da73246e0511997862d8be 100644 (file)
@@ -803,7 +803,7 @@ Dsymbols *Parser::parseDeclDefs(int once, Dsymbol **pLastDecl, PrefixAttributes
                     if (e)
                     {
                         buf1.printf("(%s)", e->toChars());
-                        s1 = buf1.peekString();
+                        s1 = buf1.peekChars();
                     }
                     error("redundant alignment attribute align%s", s1);
                 }
@@ -977,9 +977,9 @@ StorageClass Parser::appendStorageClass(StorageClass storageClass, StorageClass
         OutBuffer buf;
         stcToBuffer(&buf, stc);
         if (deprec)
-            deprecation("redundant attribute '%s'", buf.peekString());
+            deprecation("redundant attribute '%s'", buf.peekChars());
         else
-            error("redundant attribute '%s'", buf.peekString());
+            error("redundant attribute '%s'", buf.peekChars());
         return storageClass | stc;
     }
 
@@ -1712,7 +1712,7 @@ Dsymbol *Parser::parseStaticCtor(PrefixAttributes *pAttrs)
     {
         OutBuffer buf;
         stcToBuffer(&buf, modStc);
-        error(loc, "static constructor cannot be %s", buf.peekString());
+        error(loc, "static constructor cannot be %s", buf.peekChars());
     }
     stc &= ~(STCstatic | STC_TYPECTOR);
 
@@ -1750,7 +1750,7 @@ Dsymbol *Parser::parseStaticDtor(PrefixAttributes *pAttrs)
     {
         OutBuffer buf;
         stcToBuffer(&buf, modStc);
-        error(loc, "static destructor cannot be %s", buf.peekString());
+        error(loc, "static destructor cannot be %s", buf.peekChars());
     }
     stc &= ~(STCstatic | STC_TYPECTOR);
 
@@ -1792,7 +1792,7 @@ Dsymbol *Parser::parseSharedStaticCtor(PrefixAttributes *pAttrs)
     {
         OutBuffer buf;
         stcToBuffer(&buf, modStc);
-        error(loc, "shared static constructor cannot be %s", buf.peekString());
+        error(loc, "shared static constructor cannot be %s", buf.peekChars());
     }
     stc &= ~(STCstatic | STC_TYPECTOR);
 
@@ -1829,7 +1829,7 @@ Dsymbol *Parser::parseSharedStaticDtor(PrefixAttributes *pAttrs)
     {
         OutBuffer buf;
         stcToBuffer(&buf, modStc);
-        error(loc, "shared static destructor cannot be %s", buf.peekString());
+        error(loc, "shared static destructor cannot be %s", buf.peekChars());
     }
     stc &= ~(STCstatic | STC_TYPECTOR);
 
@@ -4206,7 +4206,7 @@ Dsymbol *Parser::parseFunctionLiteral()
                 {
                     OutBuffer buf;
                     stcToBuffer(&buf, modStc);
-                    error("function literal cannot be %s", buf.peekString());
+                    error("function literal cannot be %s", buf.peekChars());
                 }
                 else
                     save = TOKdelegate;
index 88391df0f28473264a5d941c5e17dad16bff81c6..667efb941b7cfc707d9581853f8fab2781eb95e1 100644 (file)
@@ -127,7 +127,7 @@ Strings *FileName::splitPath(const char *path)
             }
             if (buf.offset)             // if path is not empty
             {
-                array->push(buf.extractString());
+                array->push(buf.extractChars());
             }
         } while (c);
     }
index db09ca2904583e0574764613b815d446230b1cae..d25a14b4872d69740c61b8ccf7b21ceac04e52b2 100644 (file)
@@ -374,7 +374,7 @@ void OutBuffer::remove(size_t offset, size_t nbytes)
     this->offset -= nbytes;
 }
 
-char *OutBuffer::peekString()
+char *OutBuffer::peekChars()
 {
     if (!offset || data[offset-1] != '\0')
     {
@@ -384,7 +384,7 @@ char *OutBuffer::peekString()
     return (char *)data;
 }
 
-char *OutBuffer::extractString()
+char *OutBuffer::extractChars()
 {
     if (!offset || data[offset-1] != '\0')
         writeByte(0);
index e1bada8728b5728244e94ab00982610083100d9a..fbc3f32d4564d2670b1eb80e0dab41d67da0fedb 100644 (file)
@@ -68,7 +68,7 @@ public:
     size_t insert(size_t offset, const void *data, size_t nbytes);
     void remove(size_t offset, size_t nbytes);
     // Append terminating null if necessary and get view of internal buffer
-    char *peekString();
+    char *peekChars();
     // Append terminating null if necessary and take ownership of data
-    char *extractString();
+    char *extractChars();
 };
index b0daed514b75aa8fab36a4332bfc87a957664f49..7a0fd6db06994d0501550875c286d4c1d2a210f0 100644 (file)
@@ -49,7 +49,7 @@ Identifier *fixupLabelName(Scope *sc, Identifier *ident)
         OutBuffer buf;
         buf.printf("%s%s", prefix, ident->toChars());
 
-        const char *name = buf.extractString();
+        const char *name = buf.extractChars();
         ident = Identifier::idPool(name);
     }
     return ident;
@@ -121,7 +121,7 @@ const char *Statement::toChars()
 
     OutBuffer buf;
     ::toCBuffer(this, &buf, &hgs);
-    return buf.extractString();
+    return buf.extractChars();
 }
 
 
index 9509ffd3cff63ae388e5839931213c06a8a0e659..9db1e33c1da7f08ea60d9f63b4d15f913560c6f1 100644 (file)
@@ -133,7 +133,7 @@ const char *Token::toChars() const
             buf.writeByte('"');
             if (postfix)
                 buf.writeByte(postfix);
-            p = buf.extractString();
+            p = buf.extractChars();
         }
             break;
 
index c7bde88e5cdf68423b2477e47e6b36c7e7d01a7e..ba7e6aef6eddc7166db7e897ccf6b21881885cb9 100644 (file)
@@ -118,7 +118,7 @@ maybe_set_intrinsic (FuncDeclaration *decl)
 
          OutBuffer buf;
          mangleToBuffer (fd->type, &buf);
-         tdeco = buf.extractString ();
+         tdeco = buf.extractChars ();
        }
 
       /* Matching the type deco may be a bit too strict, as it means that all