Skip to content

Commit

Permalink
d: Merge upstream dmd f4be7f6f7b.
Browse files Browse the repository at this point in the history
D front-end changes:

    - Fix bootstrap failure with i686-darwin9.
      ```
      Undefined symbols for architecture i386:
          "gendocfile", referenced from:
          __ZL20d_generate_ddoc_fileP6ModuleR9OutBuffer in d-lang.o
      ld: symbol(s) not found for architecture i386
      ```
gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd f4be7f6f7b.
	* Make-lang.in (D_FRONTEND_OBJS): Rename d/root-rootobject.o to
	d/rootobject.o.
  • Loading branch information
ibuclaw committed Oct 22, 2023
1 parent 80ddcb9 commit c9ae68f
Show file tree
Hide file tree
Showing 45 changed files with 375 additions and 468 deletions.
2 changes: 1 addition & 1 deletion gcc/d/Make-lang.in
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ D_FRONTEND_OBJS = \
d/root-port.o \
d/root-region.o \
d/root-rmem.o \
d/root-rootobject.o \
d/root-speller.o \
d/root-string.o \
d/root-stringtable.o \
d/root-utf.o \
d/rootobject.o \
d/safe.o \
d/sapply.o \
d/semantic2.o \
Expand Down
2 changes: 1 addition & 1 deletion gcc/d/dmd/MERGE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
4c18eed9674e04c1ca89fbc8bd5c4e483eb5477c
f4be7f6f7bae75f1613b862940cdd533b5ae99b2

The first line of this file holds the git revision number of the last
merge done from the dlang/dmd repository.
1 change: 1 addition & 0 deletions gcc/d/dmd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Note that these groups have no strict meaning, the category assignments are a bi
| [astcodegen.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/astcodegen.d) | Namespace of AST nodes of a AST ready for code generation |
| [astenums.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/astenums.d) | Enums common to DMD and AST |
| [expression.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/expression.d) | Define expression AST nodes |
| [rootobject.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/rootobject.d) | Define an abstract root class |
| [statement.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/statement.d) | Define statement AST nodes |
| [staticassert.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/staticassert.d) | Define a `static assert` AST node |
| [aggregate.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/aggregate.d) | Define an aggregate (`struct`, `union` or `class`) AST node |
Expand Down
2 changes: 1 addition & 1 deletion gcc/d/dmd/arraytypes.d
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import dmd.identifier;
import dmd.init;
import dmd.mtype;
import dmd.root.array;
import dmd.root.rootobject;
import dmd.rootobject;
import dmd.statement;

alias Strings = Array!(const(char)*);
Expand Down
2 changes: 1 addition & 1 deletion gcc/d/dmd/ast_node.d
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
module dmd.ast_node;

import dmd.root.rootobject : RootObject;
import dmd.rootobject : RootObject;
import dmd.visitor : Visitor;

/// The base class of all AST nodes.
Expand Down
20 changes: 1 addition & 19 deletions gcc/d/dmd/blockexit.d
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,7 @@ int blockExit(Statement s, FuncDeclaration func, ErrorSink eSink)
}
}

if (!(result & BE.fallthru) && !s.comeFrom())
{
version (none) // this warning is completely useless due to insane false positive rate in real life template code
if (blockExit(s, func, eSink) != BE.halt && s.hasCode() &&
s.loc != Loc.initial) // don't emit warning for generated code
global.errorSink.warning(s.loc, "statement is not reachable");
}
else
if ((result & BE.fallthru) || s.comeFrom())
{
result &= ~BE.fallthru;
result |= blockExit(s, func, eSink);
Expand Down Expand Up @@ -447,17 +440,6 @@ int blockExit(Statement s, FuncDeclaration func, ErrorSink eSink)
blockExit(s.finalbody, func, eSink);
}

version (none)
{
// https://issues.dlang.org/show_bug.cgi?id=13201
// Mask to prevent spurious warnings for
// destructor call, exit of synchronized statement, etc.
if (result == BE.halt && finalresult != BE.halt && s.finalbody && s.finalbody.hasCode())
{
eSink.warning(s.finalbody.loc, "statement is not reachable");
}
}

if (!(finalresult & BE.fallthru))
result &= ~BE.fallthru;
result |= finalresult & ~BE.fallthru;
Expand Down
2 changes: 1 addition & 1 deletion gcc/d/dmd/cond.d
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import dmd.location;
import dmd.mtype;
import dmd.typesem;
import dmd.common.outbuffer;
import dmd.root.rootobject;
import dmd.rootobject;
import dmd.root.string;
import dmd.tokens;
import dmd.utils;
Expand Down
2 changes: 1 addition & 1 deletion gcc/d/dmd/cppmangle.d
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import dmd.mtype;
import dmd.nspace;
import dmd.root.array;
import dmd.common.outbuffer;
import dmd.root.rootobject;
import dmd.rootobject;
import dmd.root.string;
import dmd.target;
import dmd.typesem;
Expand Down
2 changes: 1 addition & 1 deletion gcc/d/dmd/declaration.d
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import dmd.intrange;
import dmd.location;
import dmd.mtype;
import dmd.common.outbuffer;
import dmd.root.rootobject;
import dmd.rootobject;
import dmd.target;
import dmd.tokens;
import dmd.typesem;
Expand Down
18 changes: 17 additions & 1 deletion gcc/d/dmd/dinterpret.d
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import dmd.root.rmem;
import dmd.root.array;
import dmd.root.ctfloat;
import dmd.root.region;
import dmd.root.rootobject;
import dmd.rootobject;
import dmd.root.utf;
import dmd.statement;
import dmd.tokens;
Expand Down Expand Up @@ -4965,6 +4965,22 @@ public:

override void visit(CommaExp e)
{
/****************************************
* Find the first non-comma expression.
* Params:
* e = Expressions connected by commas
* Returns:
* left-most non-comma expression
*/
static inout(Expression) firstComma(inout Expression e)
{
Expression ex = cast()e;
while (ex.op == EXP.comma)
ex = (cast(CommaExp)ex).e1;
return cast(inout)ex;

}

debug (LOG)
{
printf("%s CommaExp::interpret() %s\n", e.loc.toChars(), e.toChars());
Expand Down
2 changes: 1 addition & 1 deletion gcc/d/dmd/dmodule.d
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import dmd.root.filename;
import dmd.common.outbuffer;
import dmd.root.port;
import dmd.root.rmem;
import dmd.root.rootobject;
import dmd.rootobject;
import dmd.root.string;
import dmd.semantic2;
import dmd.semantic3;
Expand Down
4 changes: 3 additions & 1 deletion gcc/d/dmd/doc.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@

#pragma once

#include "root/dcompat.h" // for d_size_t

class Module;
class ErrorSink;

void gendocfile(Module *m, const char *ddoctext_ptr, size_t ddoctext_length,
void gendocfile(Module *m, const char *ddoctext_ptr, d_size_t ddoctext_length,
const char *datetime, ErrorSink *eSink, OutBuffer &outbuf);
6 changes: 0 additions & 6 deletions gcc/d/dmd/dscope.d
Original file line number Diff line number Diff line change
Expand Up @@ -479,12 +479,6 @@ extern (C++) struct Scope
s = *ps;
}
}
if (!(flags & (SearchImportsOnly | IgnoreErrors)) &&
ident == Id.length && sc.scopesym.isArrayScopeSymbol() &&
sc.enclosing && sc.enclosing.search(loc, ident, null, flags))
{
warning(s.loc, "array `length` hides other `length` name in outer scope");
}
//printMsg("\tfound local", s);
if (pscopesym)
*pscopesym = sc.scopesym;
Expand Down
2 changes: 1 addition & 1 deletion gcc/d/dmd/dsymbol.d
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import dmd.nspace;
import dmd.opover;
import dmd.root.aav;
import dmd.root.rmem;
import dmd.root.rootobject;
import dmd.rootobject;
import dmd.root.speller;
import dmd.root.string;
import dmd.statement;
Expand Down
8 changes: 1 addition & 7 deletions gcc/d/dmd/dsymbolsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import dmd.root.array;
import dmd.root.filename;
import dmd.common.outbuffer;
import dmd.root.rmem;
import dmd.root.rootobject;
import dmd.rootobject;
import dmd.root.utf;
import dmd.semantic2;
import dmd.semantic3;
Expand Down Expand Up @@ -3854,12 +3854,6 @@ private extern(C++) final class DsymbolSemanticVisitor : Visitor
*/
funcdecl.foverrides.push(fdv);

/* Should we really require 'override' when implementing
* an interface function?
*/
//if (!isOverride())
// warning(loc, "overrides base class function %s, but is not marked with 'override'", fdv.toPrettyChars());

if (fdv.tintro)
ti = fdv.tintro;
else if (!funcdecl.type.equals(fdv.type))
Expand Down
2 changes: 1 addition & 1 deletion gcc/d/dmd/dtemplate.d
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ import dmd.mtype;
import dmd.opover;
import dmd.root.array;
import dmd.common.outbuffer;
import dmd.root.rootobject;
import dmd.rootobject;
import dmd.semantic2;
import dmd.semantic3;
import dmd.tokens;
Expand Down
2 changes: 1 addition & 1 deletion gcc/d/dmd/dtoh.d
Original file line number Diff line number Diff line change
Expand Up @@ -1813,7 +1813,7 @@ public:
{
buf.writestring("::");

import dmd.root.rootobject;
import dmd.rootobject;
// Is this even possible?
if (arg.dyncast != DYNCAST.identifier)
{
Expand Down
2 changes: 1 addition & 1 deletion gcc/d/dmd/escape.d
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import dmd.init;
import dmd.location;
import dmd.mtype;
import dmd.printast;
import dmd.root.rootobject;
import dmd.rootobject;
import dmd.tokens;
import dmd.visitor;
import dmd.arraytypes;
Expand Down
Loading

0 comments on commit c9ae68f

Please sign in to comment.