Skip to content

Commit 6bd5d9a

Browse files
authored
Merge pull request #4707 from kinke/merge-2.110
Upgrade frontend & libs to v2.110
2 parents 843844d + dd8d0e1 commit 6bd5d9a

File tree

262 files changed

+3437
-4433
lines changed

Some content is hidden

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

262 files changed

+3437
-4433
lines changed

.cirrus.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ packaging_steps_template: &PACKAGING_STEPS_TEMPLATE
126126
# Build & copy reggae
127127
build_reggae_script: |
128128
cd $CIRRUS_WORKING_DIR/..
129-
git clone --recursive https://github.com/atilaneves/reggae.git
129+
git clone --recursive https://github.com/kinke/reggae.git
130130
cd reggae
131131
git checkout "$(cat $CIRRUS_WORKING_DIR/packaging/reggae_version)"
132132
# needs rdmd in PATH

.github/actions/7-package/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ runs:
6060
run: |
6161
set -eux
6262
cd ..
63-
git clone --recursive https://github.com/atilaneves/reggae.git
63+
git clone --recursive https://github.com/kinke/reggae.git
6464
cd reggae
6565
git checkout "$(cat ../ldc/packaging/reggae_version)"
6666

CHANGELOG.md

+1
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.110.0](https://dlang.org/changelog/2.110.0.html). (#4707)
45
- LLVM for prebuilt packages bumped to v18.1.8 (incl. macOS arm64). (#4712)
56
- Android: NDK for prebuilt package bumped from r26d to r27. (#4711)
67
- ldc2.conf: %%ldcconfigpath%% placeholder added - specifies the directory where current configuration file is located. (#4717)

CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ include(GetLinuxDistribution)
117117
#
118118

119119
# Version information
120-
set(LDC_VERSION "1.39.0") # May be overridden by git hash tag
120+
set(LDC_VERSION "1.40.0") # May be overridden by git hash tag
121121
set(DMDFE_MAJOR_VERSION 2)
122-
set(DMDFE_MINOR_VERSION 109)
123-
set(DMDFE_PATCH_VERSION 1)
122+
set(DMDFE_MINOR_VERSION 110)
123+
set(DMDFE_PATCH_VERSION 0)
124124

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

dmd/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,9 @@ Note that these groups have no strict meaning, the category assignments are a bi
201201
| [libelf.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/libelf.d) | Library in ELF format (Unix) |
202202
| [libmach.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/libmach.d) | Library in Mach-O format (macOS) |
203203
| [libmscoff.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/libmscoff.d) | Library in COFF format (32/64-bit Windows) |
204-
| [libomf.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/libomf.d) | Library in OMF format (legacy 32-bit Windows) |
205204
| [scanelf.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/scanelf.d) | Extract symbol names from a library in ELF format |
206205
| [scanmach.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/scanmach.d) | Extract symbol names from a library in Mach-O format |
207206
| [scanmscoff.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/scanmscoff.d) | Extract symbol names from a library in COFF format |
208-
| [scanomf.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/scanomf.d) | Extract symbol names from a library in OMF format |
209207

210208
### Code generation / back-end interfacing
211209

@@ -253,6 +251,8 @@ Note that these groups have no strict meaning, the category assignments are a bi
253251
| [hdrgen.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/hdrgen.d) | Convert an AST into D source code for `.di` header generation, as well as `-vcg-ast` and error messages |
254252
| [json.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/json.d) | Describe the module in a `.json` file for the `-X` flag |
255253
| [dtoh.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/dtoh.d) | C++ header generation from D source files |
254+
| [disasm86.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/backend/disasm86.d) | x86-64 dissassembly generation
255+
| [disasmarm.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/backend/arm/disasmarm.d) | AArch64 disassembly generation
256256

257257
### Utility
258258

dmd/aggregate.d

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import dmd.identifier;
3737
import dmd.location;
3838
import dmd.mtype;
3939
import dmd.tokens;
40-
import dmd.typesem : defaultInit, addMod;
40+
import dmd.typesem : defaultInit, addMod, size;
4141
import dmd.visitor;
4242

4343
/**

dmd/argtypes_aarch64.d

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module dmd.argtypes_aarch64;
1313

1414
import dmd.astenums;
1515
import dmd.mtype;
16+
import dmd.typesem;
1617

1718
/****************************************************
1819
* This breaks a type down into 'simpler' types that can be passed to a function

dmd/argtypes_sysv_x64.d

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import dmd.astenums;
1515
import dmd.declaration;
1616
import dmd.globals;
1717
import dmd.mtype;
18+
import dmd.typesem;
1819
import dmd.target;
1920
import dmd.visitor;
2021

dmd/argtypes_x86.d

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import dmd.declaration;
1919
import dmd.globals;
2020
import dmd.location;
2121
import dmd.mtype;
22+
import dmd.typesem;
2223
import dmd.target;
2324
import dmd.visitor;
2425

dmd/arrayop.d

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ module dmd.arrayop;
1616
import core.stdc.stdio;
1717
import dmd.arraytypes;
1818
import dmd.astenums;
19+
import dmd.dcast : implicitConvTo;
1920
import dmd.declaration;
2021
import dmd.dscope;
2122
import dmd.dsymbol;

dmd/chkformat.d

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import dmd.globals;
2121
import dmd.identifier;
2222
import dmd.location;
2323
import dmd.mtype;
24+
import dmd.typesem;
2425
import dmd.target;
2526

2627

dmd/cli.d

+8-9
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ dmd -cov -unittest myprog.d
692692
Option("P=<preprocessorflag>",
693693
"pass preprocessorflag to C preprocessor",
694694
`Pass $(I preprocessorflag) to
695-
$(WINDOWS sppn.exe or cl.exe)
695+
$(WINDOWS cl.exe)
696696
$(UNIX cpp)`,
697697
),
698698
Option("preview=<name>",
@@ -775,12 +775,11 @@ dmd -cov -unittest myprog.d
775775
`darwin` or `osx` for MacOS, `dragonfly` or `dragonflybsd` for DragonflyBSD,
776776
`freebsd`, `openbsd`, `linux`, `solaris` or `windows` for their respective operating systems.
777777
$(I cenv) is the C runtime environment and is optional: `musl` for musl-libc,
778-
`msvc` for the MSVC runtime (the default for windows with this option),
779-
`bionic` for the Andriod libc, `digital_mars` for the Digital Mars runtime for Windows
780-
`gnu` or `glibc` for the GCC C runtime, `newlib` or `uclibc` for their respective C runtimes.
781-
($ I cppenv) is the C++ runtime environment: `clang` for the LLVM C++ runtime
782-
`gcc` for GCC's C++ runtime, `msvc` for microsoft's MSVC C++ runtime (the default for windows with this switch),
783-
`sun` for Sun's C++ runtime and `digital_mars` for the Digital Mars C++ runtime for windows.
778+
`msvc` for the MSVC runtime, `bionic` for the Andriod libc, `gnu` or `glibc`
779+
for the GCC C runtime, `newlib` or `uclibc` for their respective C runtimes.
780+
($ I cppenv) is the C++ runtime environment: `clang` for the LLVM C++ runtime,
781+
`gcc` for GCC's C++ runtime, `msvc` for microsoft's MSVC C++ runtime,
782+
`sun` for Sun's C++ runtime.
784783
"
785784
),
786785
Option("transition=<name>",
@@ -965,8 +964,8 @@ dmd -cov -unittest myprog.d
965964
"allow use of => for methods and top-level functions in addition to lambdas",
966965
"https://dlang.org/spec/function.html#ShortenedFunctionBody", false, true),
967966
Feature("fixImmutableConv", "fixImmutableConv",
968-
"disallow functions with a mutable `void[]` parameter to be strongly pure",
969-
"https://dlang.org/changelog/2.101.0.html#dmd.fix-immutable-conv"),
967+
"disallow `void[]` data from holding immutable data",
968+
"https://dlang.org/changelog/2.101.0.html#dmd.fix-immutable-conv, https://issues.dlang.org/show_bug.cgi?id=17148"),
970969
Feature("systemVariables", "systemVariables",
971970
"disable access to variables marked '@system' from @safe code",
972971
"https://dlang.org/spec/attribute.html#system-variables"),

dmd/clone.d

+5-5
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ StorageClass mergeFuncAttrs(StorageClass s1, const FuncDeclaration f) pure
5757
return s1;
5858
StorageClass s2 = (f.storage_class & STC.disable);
5959

60-
TypeFunction tf = cast(TypeFunction)f.type;
60+
auto tf = cast(TypeFunction)f.type;
6161
if (tf.trust == TRUST.safe)
6262
s2 |= STC.safe;
6363
else if (tf.trust == TRUST.system)
@@ -177,7 +177,7 @@ private bool needOpAssign(StructDeclaration sd)
177177
Type tv = v.type.baseElemOf();
178178
if (tv.ty == Tstruct)
179179
{
180-
TypeStruct ts = cast(TypeStruct)tv;
180+
auto ts = cast(TypeStruct)tv;
181181
if (ts.sym.isUnionDeclaration())
182182
continue;
183183
if (needOpAssign(ts.sym))
@@ -314,7 +314,7 @@ FuncDeclaration buildOpAssign(StructDeclaration sd, Scope* sc)
314314
else if (sd.dtor)
315315
{
316316
//printf("\tswap copy\n");
317-
TypeFunction tdtor = cast(TypeFunction)sd.dtor.type;
317+
auto tdtor = cast(TypeFunction)sd.dtor.type;
318318
assert(tdtor.ty == Tfunction);
319319

320320
auto idswap = Identifier.generateId("__swap");
@@ -435,7 +435,7 @@ bool needOpEquals(StructDeclaration sd)
435435
auto tvbase = tv.baseElemOf();
436436
if (tvbase.ty == Tstruct)
437437
{
438-
TypeStruct ts = cast(TypeStruct)tvbase;
438+
auto ts = cast(TypeStruct)tvbase;
439439
if (ts.sym.isUnionDeclaration() && ts.sym.fields.length != 1)
440440
continue;
441441
if (needOpEquals(ts.sym))
@@ -762,7 +762,7 @@ private bool needToHash(StructDeclaration sd)
762762
auto tvbase = tv.baseElemOf();
763763
if (tvbase.ty == Tstruct)
764764
{
765-
TypeStruct ts = cast(TypeStruct)tvbase;
765+
auto ts = cast(TypeStruct)tvbase;
766766
if (ts.sym.isUnionDeclaration())
767767
continue;
768768
if (needToHash(ts.sym))

dmd/compiler.d

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import dmd.globals;
2323
import dmd.id;
2424
import dmd.identifier;
2525
import dmd.mtype;
26+
import dmd.typesem;
2627
import dmd.root.array;
2728
import dmd.root.ctfloat;
2829

dmd/cond.d

+2-2
Original file line numberDiff line numberDiff line change
@@ -659,9 +659,9 @@ extern (C++) final class VersionCondition : DVCondition
659659
case "AVR":
660660
case "BigEndian":
661661
case "BSD":
662-
case "CppRuntime_Clang":
662+
case "CppRuntime_LLVM":
663663
case "CppRuntime_DigitalMars":
664-
case "CppRuntime_Gcc":
664+
case "CppRuntime_GNU":
665665
case "CppRuntime_Microsoft":
666666
case "CppRuntime_Sun":
667667
case "CRuntime_Bionic":

dmd/constfold.d

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import dmd.root.utf;
3636
import dmd.sideeffect;
3737
import dmd.target;
3838
import dmd.tokens;
39-
import dmd.typesem : toDsymbol, equivalent, sarrayOf;
39+
import dmd.typesem : toDsymbol, equivalent, sarrayOf, size;
4040

4141
private enum LOG = false;
4242

dmd/cparse.d

+47-13
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import dmd.root.array;
2727
import dmd.common.outbuffer;
2828
import dmd.root.rmem;
2929
import dmd.tokens;
30+
import dmd.typesem : size;
3031

3132
version (LDC) private enum LDC_pre_2084 = __VERSION__ < 2084; // workaround bug with LDC < v1.14 host compilers
3233
else private enum LDC_pre_2084 = false;
@@ -1875,22 +1876,30 @@ final class CParser(AST) : Parser!AST
18751876
* init-declarator:
18761877
* declarator simple-asm-expr (opt) gnu-attributes (opt)
18771878
* declarator simple-asm-expr (opt) gnu-attributes (opt) = initializer
1879+
*
1880+
* Clang also allows simple-asm-expr after gnu-attributes.
18781881
*/
1882+
while (1)
1883+
{
1884+
if (token.value == TOK.asm_)
1885+
{
1886+
asmName = cparseGnuAsmLabel();
1887+
/* This is a data definition, there cannot now be a
1888+
* function definition.
1889+
*/
1890+
first = false;
1891+
}
1892+
else if (token.value == TOK.__attribute__)
1893+
cparseGnuAttributes(specifier);
1894+
else
1895+
break;
1896+
}
1897+
18791898
switch (token.value)
18801899
{
18811900
case TOK.assign:
18821901
case TOK.comma:
18831902
case TOK.semicolon:
1884-
case TOK.asm_:
1885-
case TOK.__attribute__:
1886-
if (token.value == TOK.asm_)
1887-
asmName = cparseGnuAsmLabel();
1888-
if (token.value == TOK.__attribute__)
1889-
{
1890-
cparseGnuAttributes(specifier);
1891-
if (token.value == TOK.leftCurly)
1892-
break; // function definition
1893-
}
18941903
/* This is a data definition, there cannot now be a
18951904
* function definition.
18961905
*/
@@ -3629,6 +3638,12 @@ final class CParser(AST) : Parser!AST
36293638
* type on the target machine. It's the opposite of __attribute__((packed))
36303639
*/
36313640
}
3641+
else if (token.ident == Id.packed)
3642+
{
3643+
specifier.packalign.set(1);
3644+
specifier.packalign.setPack(true);
3645+
nextToken();
3646+
}
36323647
else if (token.ident == Id.always_inline) // https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
36333648
{
36343649
specifier.scw |= SCW.xinline;
@@ -3977,7 +3992,7 @@ final class CParser(AST) : Parser!AST
39773992
members = new AST.Dsymbols(); // so `members` will be non-null even with 0 members
39783993
while (token.value != TOK.rightCurly)
39793994
{
3980-
cparseStructDeclaration(members);
3995+
cparseStructDeclaration(members, packalign);
39813996

39823997
if (token.value == TOK.endOfFile)
39833998
break;
@@ -3991,6 +4006,24 @@ final class CParser(AST) : Parser!AST
39914006
* struct-declarator (opt)
39924007
*/
39934008
}
4009+
4010+
/* GNU Extensions
4011+
* Parse the postfix gnu-attributes (opt)
4012+
*/
4013+
Specifier specifier;
4014+
if (token.value == TOK.__attribute__)
4015+
cparseGnuAttributes(specifier);
4016+
if (!specifier.packalign.isUnknown)
4017+
{
4018+
packalign.set(specifier.packalign.get());
4019+
packalign.setPack(specifier.packalign.isPack());
4020+
foreach (ref d; (*members)[])
4021+
{
4022+
auto decls = new AST.Dsymbols(1);
4023+
(*decls)[0] = d;
4024+
d = new AST.AlignDeclaration(d.loc, specifier.packalign, decls);
4025+
}
4026+
}
39944027
}
39954028
else if (!tag)
39964029
error("missing tag `identifier` after `%s`", Token.toChars(structOrUnion));
@@ -4022,8 +4055,9 @@ final class CParser(AST) : Parser!AST
40224055
* declarator (opt) : constant-expression
40234056
* Params:
40244057
* members = where to put the fields (members)
4058+
* packalign = alignment to use for struct members
40254059
*/
4026-
void cparseStructDeclaration(AST.Dsymbols* members)
4060+
void cparseStructDeclaration(AST.Dsymbols* members, structalign_t packalign)
40274061
{
40284062
//printf("cparseStructDeclaration()\n");
40294063
if (token.value == TOK._Static_assert)
@@ -4034,7 +4068,7 @@ final class CParser(AST) : Parser!AST
40344068
}
40354069

40364070
Specifier specifier;
4037-
specifier.packalign = this.packalign;
4071+
specifier.packalign = packalign.isUnknown ? this.packalign : packalign;
40384072
auto tspec = cparseSpecifierQualifierList(LVL.member, specifier);
40394073
if (!tspec)
40404074
{

dmd/cppmangle.d

+1-1
Original file line numberDiff line numberDiff line change
@@ -2197,7 +2197,7 @@ private extern(C++) final class ComponentVisitor : Visitor
21972197
/// Set to the result of the comparison
21982198
private bool result;
21992199

2200-
public this(RootObject base) @safe
2200+
public this(RootObject base) @trusted
22012201
{
22022202
switch (base.dyncast())
22032203
{

0 commit comments

Comments
 (0)