Skip to content

Commit d70f676

Browse files
authored
Merge pull request #4476 from kinke/merge-2.105
Upgrade frontend & libs to v2.105.1
2 parents 16b3c7e + 7ed24a6 commit d70f676

File tree

331 files changed

+12443
-1891
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

331 files changed

+12443
-1891
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# LDC master
22

33
#### Big news
4+
- Frontend, druntime and Phobos are at version [2.105.1+](https://dlang.org/changelog/2.105.0.html). (#4476)
45

56
#### Platform support
67

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ include(GetLinuxDistribution)
117117
#
118118

119119
# Version information
120-
set(LDC_VERSION "1.34.0") # May be overridden by git hash tag
120+
set(LDC_VERSION "1.35.0") # May be overridden by git hash tag
121121
set(DMDFE_MAJOR_VERSION 2)
122-
set(DMDFE_MINOR_VERSION 104)
123-
set(DMDFE_PATCH_VERSION 2)
122+
set(DMDFE_MINOR_VERSION 105)
123+
set(DMDFE_PATCH_VERSION 1)
124124

125125
set(DMD_VERSION ${DMDFE_MAJOR_VERSION}.${DMDFE_MINOR_VERSION}.${DMDFE_PATCH_VERSION})
126126

dmd/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ this license for that file.
1919
| Folder | Purpose |
2020
|--------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
2121
| [dmd/](https://github.com/dlang/dmd/tree/master/compiler/src/dmd) | The dmd driver and front-end |
22-
| [dmd/backend/](https://github.com/dlang/dmd/tree/master/compiler/src/dmd/backend) | Code generation for x86 or x86-64. Shared by the [Digital Mars C compiler](https://github.com/DigitalMars/Compiler/), but not [LDC](https://github.com/ldc-developers/ldc) or [GDC](https://gdcproject.org/). |
22+
| [dmd/backend/](https://github.com/dlang/dmd/tree/master/compiler/src/dmd/backend) | Code generation for x86 or x86-64. Based on [DMC](https://github.com/DigitalMars/Compiler/)'s backend, but not kept in sync anymore. Not used by [LDC](https://github.com/ldc-developers/ldc) or [GDC](https://gdcproject.org/). |
2323
| [dmd/common/](https://github.com/dlang/dmd/tree/master/compiler/src/dmd/common) | Code shared by the front-end and back-end |
2424
| [dmd/root/](https://github.com/dlang/dmd/tree/master/compiler/src/dmd/root) | Meant as a portable utility library, but ["it wasn't very good and the only project left using it is dmd"](https://github.com/dlang/dmd/pull/9844#issuecomment-498479516). |
2525

@@ -99,7 +99,7 @@ Note that these groups have no strict meaning, the category assignments are a bi
9999
| [strictvisitor.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/strictvisitor.d) | Visitor that forces derived classes to implement `visit` for every possible node |
100100
| [visitor.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/visitor.d) | A visitor implementing `visit` for all nodes present in the compiler |
101101
| [transitivevisitor.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/transitivevisitor.d) | Provide a mixin template with visit methods for the parse time AST |
102-
| [apply.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/apply.d) | Depth-first expression visitor |
102+
| [postordervisitor.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/postordervisitor.d) | Depth-first expression visitor |
103103
| [sapply.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/sapply.d) | Depth-first statement visitor |
104104
| [statement_rewrite_walker.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/statement_rewrite_walker.d) | Statement visitor that allows replacing the currently visited node |
105105

@@ -174,7 +174,6 @@ Note that these groups have no strict meaning, the category assignments are a bi
174174
| [cond.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/cond.d) | Evaluate `static if`, `version` `debug ` |
175175
| [staticcond.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/staticcond.d) | Lazily evaluate static conditions for `static if`, `static assert` and template constraints |
176176
| [delegatize.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/delegatize.d) | Converts expression to delegates for `lazy` parameters |
177-
| [eh.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/eh.d) | Generate tables for exception handling |
178177
| [nspace.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/nspace.d) | Namespace for `extern (C++, Module)` |
179178
| [intrange.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/intrange.d) | [Value range propagation](https://digitalmars.com/articles/b62.html) |
180179
| [dimport.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/dimport.d) | Renamed imports (`import aliasSymbol = pkg1.pkg2.symbol`) |

dmd/access.d

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,13 @@ module dmd.access;
1616
import dmd.aggregate;
1717
import dmd.astenums;
1818
import dmd.dclass;
19-
import dmd.declaration;
2019
import dmd.dmodule;
2120
import dmd.dscope;
2221
import dmd.dstruct;
2322
import dmd.dsymbol;
24-
import dmd.errors;
2523
import dmd.expression;
26-
import dmd.func;
2724
import dmd.globals;
2825
import dmd.location;
29-
import dmd.mtype;
3026
import dmd.tokens;
3127

3228
private enum LOG = false;

dmd/aggregate.d

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import core.stdc.stdio;
1818
import core.checkedint;
1919

2020
import dmd.aliasthis;
21-
import dmd.apply;
2221
import dmd.arraytypes;
2322
import dmd.astenums;
2423
import dmd.attrib;
@@ -764,21 +763,18 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol
764763
if (s)
765764
{
766765
// Finish all constructors semantics to determine this.noDefaultCtor.
767-
struct SearchCtor
766+
static int searchCtor(Dsymbol s, void*)
768767
{
769-
extern (C++) static int fp(Dsymbol s, void* ctxt)
770-
{
771-
auto f = s.isCtorDeclaration();
772-
if (f && f.semanticRun == PASS.initial)
773-
f.dsymbolSemantic(null);
774-
return 0;
775-
}
768+
auto f = s.isCtorDeclaration();
769+
if (f && f.semanticRun == PASS.initial)
770+
f.dsymbolSemantic(null);
771+
return 0;
776772
}
777773

778774
for (size_t i = 0; i < members.length; i++)
779775
{
780776
auto sm = (*members)[i];
781-
sm.apply(&SearchCtor.fp, null);
777+
sm.apply(&searchCtor, null);
782778
}
783779
}
784780
return s;
@@ -817,3 +813,36 @@ version (IN_LLVM) {} else
817813
v.visit(this);
818814
}
819815
}
816+
817+
/*********************************
818+
* Iterate this dsymbol or members of this scoped dsymbol, then
819+
* call `fp` with the found symbol and `params`.
820+
* Params:
821+
* symbol = the dsymbol or parent of members to call fp on
822+
* fp = function pointer to process the iterated symbol.
823+
* If it returns nonzero, the iteration will be aborted.
824+
* ctx = context parameter passed to fp.
825+
* Returns:
826+
* nonzero if the iteration is aborted by the return value of fp,
827+
* or 0 if it's completed.
828+
*/
829+
int apply(Dsymbol symbol, int function(Dsymbol, void*) fp, void* ctx)
830+
{
831+
if (auto nd = symbol.isNspace())
832+
{
833+
return nd.members.foreachDsymbol( (s) { return s && s.apply(fp, ctx); } );
834+
}
835+
if (auto ad = symbol.isAttribDeclaration())
836+
{
837+
return ad.include(ad._scope).foreachDsymbol( (s) { return s && s.apply(fp, ctx); } );
838+
}
839+
if (auto tm = symbol.isTemplateMixin())
840+
{
841+
if (tm._scope) // if fwd reference
842+
dsymbolSemantic(tm, null); // try to resolve it
843+
844+
return tm.members.foreachDsymbol( (s) { return s && s.apply(fp, ctx); } );
845+
}
846+
847+
return fp(symbol, ctx);
848+
}

dmd/asttypename.d

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import dmd.mtype;
3535
import dmd.typinf;
3636
import dmd.identifier;
3737
import dmd.init;
38-
import dmd.doc;
3938
import dmd.root.complex;
4039
import dmd.root.rootobject;
4140
import dmd.statement;

dmd/attrib.d

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,8 @@ extern (C++) final class VisibilityDeclaration : AttribDeclaration
653653
{
654654
Module m = sc._module;
655655

656-
// While isAncestorPackageOf does an equality check, the fix for issue 17441 adds a check to see if
656+
// https://issues.dlang.org/show_bug.cgi?id=17441
657+
// While isAncestorPackageOf does an equality check, the fix for the issue adds a check to see if
657658
// each package's .isModule() properites are equal.
658659
//
659660
// Properties generated from `package(foo)` i.e. visibility.pkg have .isModule() == null.

dmd/canthrow.d

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
module dmd.canthrow;
1515

1616
import dmd.aggregate;
17-
import dmd.apply;
1817
import dmd.arraytypes;
1918
import dmd.attrib;
2019
import dmd.astenums;
@@ -26,6 +25,7 @@ import dmd.func;
2625
import dmd.globals;
2726
import dmd.init;
2827
import dmd.mtype;
28+
import dmd.postordervisitor;
2929
import dmd.root.rootobject;
3030
import dmd.tokens;
3131
import dmd.visitor;
@@ -80,7 +80,7 @@ extern (C++) /* CT */ BE canThrow(Expression e, FuncDeclaration func, bool mustN
8080
if (!f.isDtorDeclaration())
8181
errorSupplementalInferredAttr(f, 10, false, STC.nothrow_);
8282

83-
e.checkOverridenDtor(null, f, dd => dd.type.toTypeFunction().isnothrow, "not nothrow");
83+
e.checkOverriddenDtor(null, f, dd => dd.type.toTypeFunction().isnothrow, "not nothrow");
8484
}
8585
else if (func)
8686
{
@@ -133,16 +133,9 @@ extern (C++) /* CT */ BE canThrow(Expression e, FuncDeclaration func, bool mustN
133133
*/
134134
if (ce.f && ce.f == func)
135135
return;
136-
Type t = ce.e1.type.toBasetype();
137-
auto tf = t.isTypeFunction();
136+
const tf = ce.calledFunctionType();
138137
if (tf && tf.isnothrow)
139138
return;
140-
else
141-
{
142-
auto td = t.isTypeDelegate();
143-
if (td && td.nextOf().isTypeFunction().isnothrow)
144-
return;
145-
}
146139

147140
if (ce.f)
148141
checkFuncThrows(ce, ce.f);

dmd/chkformat.d

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ bool checkPrintfFormat(ref const Loc loc, scope const char[] format, scope Expre
177177
errorMsg(null, e, (c_longsize == 4 ? "uint" : "ulong"), t);
178178
else
179179
errorMsg(null, e, (c_longsize == 4 ? "int" : "long"), t);
180+
if (t.isintegral() && t.size() != c_longsize)
181+
errorSupplemental(e.loc, "C `long` is %d bytes on your system", c_longsize);
180182
}
181183
break;
182184

dmd/cli.d

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ version (IN_LLVM) {} else
220220
$(LI $(B in): in contracts)
221221
$(LI $(B invariant): class/struct invariants)
222222
$(LI $(B out): out contracts)
223-
$(LI $(B switch): finalswitch failure checking)
223+
$(LI $(B switch): $(D final switch) failure checking)
224224
)
225225
$(UL
226226
$(LI $(B on) or not specified: specified check is enabled.)
@@ -232,8 +232,8 @@ version (IN_LLVM) {} else
232232
),
233233
Option("checkaction=[D|C|halt|context]",
234234
"behavior on assert/boundscheck/finalswitch failure",
235-
`Sets behavior when an assert fails, and array boundscheck fails,
236-
or a final switch errors.
235+
`Sets behavior when an assert or an array bounds check fails,
236+
or a $(D final switch) errors.
237237
$(UL
238238
$(LI $(B D): Default behavior, which throws an unrecoverable $(D AssertError).)
239239
$(LI $(B C): Calls the C runtime library assert failure function.)
@@ -400,7 +400,7 @@ dmd -cov -unittest myprog.d
400400
),
401401
Option("Hd=<directory>",
402402
"write 'header' file to directory",
403-
`Write D interface file to $(I dir) directory. $(SWLINK -op)
403+
`Write D interface file to $(I directory). $(SWLINK -op)
404404
can be used if the original package hierarchy should
405405
be retained.`,
406406
),
@@ -435,7 +435,7 @@ dmd -cov -unittest myprog.d
435435
q"{$(P Enables "include imports" mode, where the compiler will include imported
436436
modules in the compilation, as if they were given on the command line. By default, when
437437
this option is enabled, all imported modules are included except those in
438-
druntime/phobos. This behavior can be overriden by providing patterns via `-i=<pattern>`.
438+
druntime/phobos. This behavior can be overridden by providing patterns via `-i=<pattern>`.
439439
A pattern of the form `-i=<package>` is an "inclusive pattern", whereas a pattern
440440
of the form `-i=-<package>` is an "exclusive pattern". Inclusive patterns will include
441441
all module's whose names match the pattern, whereas exclusive patterns will exclude them.
@@ -445,14 +445,14 @@ dmd -cov -unittest myprog.d
445445
446446
$(P The default behavior of excluding druntime/phobos is accomplished by internally adding a
447447
set of standard exclusions, namely, `-i=-std -i=-core -i=-etc -i=-object`. Note that these
448-
can be overriden with `-i=std -i=core -i=etc -i=object`.)
448+
can be overridden with `-i=std -i=core -i=etc -i=object`.)
449449
450450
$(P When a module matches multiple patterns, matches are prioritized by their component length, where
451451
a match with more components takes priority (i.e. pattern `foo.bar.baz` has priority over `foo.bar`).)
452452
453453
$(P By default modules that don't match any pattern will be included. However, if at
454454
least one inclusive pattern is given, then modules not matching any pattern will
455-
be excluded. This behavior can be overriden by usig `-i=.` to include by default or `-i=-.` to
455+
be excluded. This behavior can be overridden by usig `-i=.` to include by default or `-i=-.` to
456456
exclude by default.)
457457
458458
$(P Note that multiple `-i=...` options are allowed, each one adds a pattern.)}"
@@ -826,6 +826,11 @@ dmd -cov -unittest myprog.d
826826
`Enable $(LINK2 $(ROOT_DIR)articles/warnings.html, informational warnings (i.e. compilation
827827
still proceeds normally))`,
828828
),
829+
Option("wo",
830+
"warnings about use of obsolete features (compilation will continue)",
831+
`Enable warnings about use of obsolete features that may be problematic (compilation
832+
still proceeds normally)`,
833+
),
829834
Option("X",
830835
"generate JSON file"
831836
),
@@ -1033,8 +1038,8 @@ version (IN_LLVM) {} else
10331038
/// Options supported by -HC
10341039
enum hcUsage = "Available header generation modes:
10351040
=[h|help|?] List information on all available choices
1036-
=silent Silently ignore non-exern(C[++]) declarations
1037-
=verbose Add a comment for ignored non-exern(C[++]) declarations
1041+
=silent Silently ignore non-extern(C[++]) declarations
1042+
=verbose Add a comment for ignored non-extern(C[++]) declarations
10381043
";
10391044

10401045
/// Options supported by -gdwarf

0 commit comments

Comments
 (0)