Skip to content

Commit

Permalink
Merge pull request #4707 from kinke/merge-2.110
Browse files Browse the repository at this point in the history
Upgrade frontend & libs to v2.110
  • Loading branch information
kinke authored Aug 10, 2024
2 parents 843844d + dd8d0e1 commit 6bd5d9a
Show file tree
Hide file tree
Showing 262 changed files with 3,437 additions and 4,433 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ packaging_steps_template: &PACKAGING_STEPS_TEMPLATE
# Build & copy reggae
build_reggae_script: |
cd $CIRRUS_WORKING_DIR/..
git clone --recursive https://github.com/atilaneves/reggae.git
git clone --recursive https://github.com/kinke/reggae.git
cd reggae
git checkout "$(cat $CIRRUS_WORKING_DIR/packaging/reggae_version)"
# needs rdmd in PATH
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/7-package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ runs:
run: |
set -eux
cd ..
git clone --recursive https://github.com/atilaneves/reggae.git
git clone --recursive https://github.com/kinke/reggae.git
cd reggae
git checkout "$(cat ../ldc/packaging/reggae_version)"
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# LDC master

#### Big news
- Frontend, druntime and Phobos are at version [2.110.0](https://dlang.org/changelog/2.110.0.html). (#4707)
- LLVM for prebuilt packages bumped to v18.1.8 (incl. macOS arm64). (#4712)
- Android: NDK for prebuilt package bumped from r26d to r27. (#4711)
- ldc2.conf: %%ldcconfigpath%% placeholder added - specifies the directory where current configuration file is located. (#4717)
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ include(GetLinuxDistribution)
#

# Version information
set(LDC_VERSION "1.39.0") # May be overridden by git hash tag
set(LDC_VERSION "1.40.0") # May be overridden by git hash tag
set(DMDFE_MAJOR_VERSION 2)
set(DMDFE_MINOR_VERSION 109)
set(DMDFE_PATCH_VERSION 1)
set(DMDFE_MINOR_VERSION 110)
set(DMDFE_PATCH_VERSION 0)

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

Expand Down
4 changes: 2 additions & 2 deletions dmd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,9 @@ Note that these groups have no strict meaning, the category assignments are a bi
| [libelf.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/libelf.d) | Library in ELF format (Unix) |
| [libmach.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/libmach.d) | Library in Mach-O format (macOS) |
| [libmscoff.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/libmscoff.d) | Library in COFF format (32/64-bit Windows) |
| [libomf.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/libomf.d) | Library in OMF format (legacy 32-bit Windows) |
| [scanelf.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/scanelf.d) | Extract symbol names from a library in ELF format |
| [scanmach.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/scanmach.d) | Extract symbol names from a library in Mach-O format |
| [scanmscoff.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/scanmscoff.d) | Extract symbol names from a library in COFF format |
| [scanomf.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/scanomf.d) | Extract symbol names from a library in OMF format |

### Code generation / back-end interfacing

Expand Down Expand Up @@ -253,6 +251,8 @@ Note that these groups have no strict meaning, the category assignments are a bi
| [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 |
| [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 |
| [dtoh.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/dtoh.d) | C++ header generation from D source files |
| [disasm86.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/backend/disasm86.d) | x86-64 dissassembly generation
| [disasmarm.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/backend/arm/disasmarm.d) | AArch64 disassembly generation

### Utility

Expand Down
2 changes: 1 addition & 1 deletion dmd/aggregate.d
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import dmd.identifier;
import dmd.location;
import dmd.mtype;
import dmd.tokens;
import dmd.typesem : defaultInit, addMod;
import dmd.typesem : defaultInit, addMod, size;
import dmd.visitor;

/**
Expand Down
1 change: 1 addition & 0 deletions dmd/argtypes_aarch64.d
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module dmd.argtypes_aarch64;

import dmd.astenums;
import dmd.mtype;
import dmd.typesem;

/****************************************************
* This breaks a type down into 'simpler' types that can be passed to a function
Expand Down
1 change: 1 addition & 0 deletions dmd/argtypes_sysv_x64.d
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import dmd.astenums;
import dmd.declaration;
import dmd.globals;
import dmd.mtype;
import dmd.typesem;
import dmd.target;
import dmd.visitor;

Expand Down
1 change: 1 addition & 0 deletions dmd/argtypes_x86.d
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import dmd.declaration;
import dmd.globals;
import dmd.location;
import dmd.mtype;
import dmd.typesem;
import dmd.target;
import dmd.visitor;

Expand Down
1 change: 1 addition & 0 deletions dmd/arrayop.d
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module dmd.arrayop;
import core.stdc.stdio;
import dmd.arraytypes;
import dmd.astenums;
import dmd.dcast : implicitConvTo;
import dmd.declaration;
import dmd.dscope;
import dmd.dsymbol;
Expand Down
1 change: 1 addition & 0 deletions dmd/chkformat.d
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import dmd.globals;
import dmd.identifier;
import dmd.location;
import dmd.mtype;
import dmd.typesem;
import dmd.target;


Expand Down
17 changes: 8 additions & 9 deletions dmd/cli.d
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ dmd -cov -unittest myprog.d
Option("P=<preprocessorflag>",
"pass preprocessorflag to C preprocessor",
`Pass $(I preprocessorflag) to
$(WINDOWS sppn.exe or cl.exe)
$(WINDOWS cl.exe)
$(UNIX cpp)`,
),
Option("preview=<name>",
Expand Down Expand Up @@ -775,12 +775,11 @@ dmd -cov -unittest myprog.d
`darwin` or `osx` for MacOS, `dragonfly` or `dragonflybsd` for DragonflyBSD,
`freebsd`, `openbsd`, `linux`, `solaris` or `windows` for their respective operating systems.
$(I cenv) is the C runtime environment and is optional: `musl` for musl-libc,
`msvc` for the MSVC runtime (the default for windows with this option),
`bionic` for the Andriod libc, `digital_mars` for the Digital Mars runtime for Windows
`gnu` or `glibc` for the GCC C runtime, `newlib` or `uclibc` for their respective C runtimes.
($ I cppenv) is the C++ runtime environment: `clang` for the LLVM C++ runtime
`gcc` for GCC's C++ runtime, `msvc` for microsoft's MSVC C++ runtime (the default for windows with this switch),
`sun` for Sun's C++ runtime and `digital_mars` for the Digital Mars C++ runtime for windows.
`msvc` for the MSVC runtime, `bionic` for the Andriod libc, `gnu` or `glibc`
for the GCC C runtime, `newlib` or `uclibc` for their respective C runtimes.
($ I cppenv) is the C++ runtime environment: `clang` for the LLVM C++ runtime,
`gcc` for GCC's C++ runtime, `msvc` for microsoft's MSVC C++ runtime,
`sun` for Sun's C++ runtime.
"
),
Option("transition=<name>",
Expand Down Expand Up @@ -965,8 +964,8 @@ dmd -cov -unittest myprog.d
"allow use of => for methods and top-level functions in addition to lambdas",
"https://dlang.org/spec/function.html#ShortenedFunctionBody", false, true),
Feature("fixImmutableConv", "fixImmutableConv",
"disallow functions with a mutable `void[]` parameter to be strongly pure",
"https://dlang.org/changelog/2.101.0.html#dmd.fix-immutable-conv"),
"disallow `void[]` data from holding immutable data",
"https://dlang.org/changelog/2.101.0.html#dmd.fix-immutable-conv, https://issues.dlang.org/show_bug.cgi?id=17148"),
Feature("systemVariables", "systemVariables",
"disable access to variables marked '@system' from @safe code",
"https://dlang.org/spec/attribute.html#system-variables"),
Expand Down
10 changes: 5 additions & 5 deletions dmd/clone.d
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ StorageClass mergeFuncAttrs(StorageClass s1, const FuncDeclaration f) pure
return s1;
StorageClass s2 = (f.storage_class & STC.disable);

TypeFunction tf = cast(TypeFunction)f.type;
auto tf = cast(TypeFunction)f.type;
if (tf.trust == TRUST.safe)
s2 |= STC.safe;
else if (tf.trust == TRUST.system)
Expand Down Expand Up @@ -177,7 +177,7 @@ private bool needOpAssign(StructDeclaration sd)
Type tv = v.type.baseElemOf();
if (tv.ty == Tstruct)
{
TypeStruct ts = cast(TypeStruct)tv;
auto ts = cast(TypeStruct)tv;
if (ts.sym.isUnionDeclaration())
continue;
if (needOpAssign(ts.sym))
Expand Down Expand Up @@ -314,7 +314,7 @@ FuncDeclaration buildOpAssign(StructDeclaration sd, Scope* sc)
else if (sd.dtor)
{
//printf("\tswap copy\n");
TypeFunction tdtor = cast(TypeFunction)sd.dtor.type;
auto tdtor = cast(TypeFunction)sd.dtor.type;
assert(tdtor.ty == Tfunction);

auto idswap = Identifier.generateId("__swap");
Expand Down Expand Up @@ -435,7 +435,7 @@ bool needOpEquals(StructDeclaration sd)
auto tvbase = tv.baseElemOf();
if (tvbase.ty == Tstruct)
{
TypeStruct ts = cast(TypeStruct)tvbase;
auto ts = cast(TypeStruct)tvbase;
if (ts.sym.isUnionDeclaration() && ts.sym.fields.length != 1)
continue;
if (needOpEquals(ts.sym))
Expand Down Expand Up @@ -762,7 +762,7 @@ private bool needToHash(StructDeclaration sd)
auto tvbase = tv.baseElemOf();
if (tvbase.ty == Tstruct)
{
TypeStruct ts = cast(TypeStruct)tvbase;
auto ts = cast(TypeStruct)tvbase;
if (ts.sym.isUnionDeclaration())
continue;
if (needToHash(ts.sym))
Expand Down
1 change: 1 addition & 0 deletions dmd/compiler.d
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import dmd.globals;
import dmd.id;
import dmd.identifier;
import dmd.mtype;
import dmd.typesem;
import dmd.root.array;
import dmd.root.ctfloat;

Expand Down
4 changes: 2 additions & 2 deletions dmd/cond.d
Original file line number Diff line number Diff line change
Expand Up @@ -659,9 +659,9 @@ extern (C++) final class VersionCondition : DVCondition
case "AVR":
case "BigEndian":
case "BSD":
case "CppRuntime_Clang":
case "CppRuntime_LLVM":
case "CppRuntime_DigitalMars":
case "CppRuntime_Gcc":
case "CppRuntime_GNU":
case "CppRuntime_Microsoft":
case "CppRuntime_Sun":
case "CRuntime_Bionic":
Expand Down
2 changes: 1 addition & 1 deletion dmd/constfold.d
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import dmd.root.utf;
import dmd.sideeffect;
import dmd.target;
import dmd.tokens;
import dmd.typesem : toDsymbol, equivalent, sarrayOf;
import dmd.typesem : toDsymbol, equivalent, sarrayOf, size;

private enum LOG = false;

Expand Down
60 changes: 47 additions & 13 deletions dmd/cparse.d
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import dmd.root.array;
import dmd.common.outbuffer;
import dmd.root.rmem;
import dmd.tokens;
import dmd.typesem : size;

version (LDC) private enum LDC_pre_2084 = __VERSION__ < 2084; // workaround bug with LDC < v1.14 host compilers
else private enum LDC_pre_2084 = false;
Expand Down Expand Up @@ -1875,22 +1876,30 @@ final class CParser(AST) : Parser!AST
* init-declarator:
* declarator simple-asm-expr (opt) gnu-attributes (opt)
* declarator simple-asm-expr (opt) gnu-attributes (opt) = initializer
*
* Clang also allows simple-asm-expr after gnu-attributes.
*/
while (1)
{
if (token.value == TOK.asm_)
{
asmName = cparseGnuAsmLabel();
/* This is a data definition, there cannot now be a
* function definition.
*/
first = false;
}
else if (token.value == TOK.__attribute__)
cparseGnuAttributes(specifier);
else
break;
}

switch (token.value)
{
case TOK.assign:
case TOK.comma:
case TOK.semicolon:
case TOK.asm_:
case TOK.__attribute__:
if (token.value == TOK.asm_)
asmName = cparseGnuAsmLabel();
if (token.value == TOK.__attribute__)
{
cparseGnuAttributes(specifier);
if (token.value == TOK.leftCurly)
break; // function definition
}
/* This is a data definition, there cannot now be a
* function definition.
*/
Expand Down Expand Up @@ -3629,6 +3638,12 @@ final class CParser(AST) : Parser!AST
* type on the target machine. It's the opposite of __attribute__((packed))
*/
}
else if (token.ident == Id.packed)
{
specifier.packalign.set(1);
specifier.packalign.setPack(true);
nextToken();
}
else if (token.ident == Id.always_inline) // https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
{
specifier.scw |= SCW.xinline;
Expand Down Expand Up @@ -3977,7 +3992,7 @@ final class CParser(AST) : Parser!AST
members = new AST.Dsymbols(); // so `members` will be non-null even with 0 members
while (token.value != TOK.rightCurly)
{
cparseStructDeclaration(members);
cparseStructDeclaration(members, packalign);

if (token.value == TOK.endOfFile)
break;
Expand All @@ -3991,6 +4006,24 @@ final class CParser(AST) : Parser!AST
* struct-declarator (opt)
*/
}

/* GNU Extensions
* Parse the postfix gnu-attributes (opt)
*/
Specifier specifier;
if (token.value == TOK.__attribute__)
cparseGnuAttributes(specifier);
if (!specifier.packalign.isUnknown)
{
packalign.set(specifier.packalign.get());
packalign.setPack(specifier.packalign.isPack());
foreach (ref d; (*members)[])
{
auto decls = new AST.Dsymbols(1);
(*decls)[0] = d;
d = new AST.AlignDeclaration(d.loc, specifier.packalign, decls);
}
}
}
else if (!tag)
error("missing tag `identifier` after `%s`", Token.toChars(structOrUnion));
Expand Down Expand Up @@ -4022,8 +4055,9 @@ final class CParser(AST) : Parser!AST
* declarator (opt) : constant-expression
* Params:
* members = where to put the fields (members)
* packalign = alignment to use for struct members
*/
void cparseStructDeclaration(AST.Dsymbols* members)
void cparseStructDeclaration(AST.Dsymbols* members, structalign_t packalign)
{
//printf("cparseStructDeclaration()\n");
if (token.value == TOK._Static_assert)
Expand All @@ -4034,7 +4068,7 @@ final class CParser(AST) : Parser!AST
}

Specifier specifier;
specifier.packalign = this.packalign;
specifier.packalign = packalign.isUnknown ? this.packalign : packalign;
auto tspec = cparseSpecifierQualifierList(LVL.member, specifier);
if (!tspec)
{
Expand Down
2 changes: 1 addition & 1 deletion dmd/cppmangle.d
Original file line number Diff line number Diff line change
Expand Up @@ -2197,7 +2197,7 @@ private extern(C++) final class ComponentVisitor : Visitor
/// Set to the result of the comparison
private bool result;

public this(RootObject base) @safe
public this(RootObject base) @trusted
{
switch (base.dyncast())
{
Expand Down
Loading

0 comments on commit 6bd5d9a

Please sign in to comment.