Skip to content

Commit 49e5732

Browse files
authored
Merge pull request #4660 from kinke/merge-2.109
Upgrade frontend & libs to v2.109
2 parents 5310185 + b88f991 commit 49e5732

File tree

203 files changed

+9374
-3793
lines changed

Some content is hidden

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

203 files changed

+9374
-3793
lines changed

.github/actions/5-install/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ runs:
2929
cp build-cross/bin/ldc2_install.conf install/etc/ldc2.conf
3030
cp -R ldc/packaging/bash_completion.d install/etc/
3131
mkdir install/import
32-
cp -R ldc/runtime/druntime/src/{core,etc,ldc,object.d,__builtins.di,importc.h} install/import/
32+
cp -R ldc/runtime/druntime/src/{core,etc,ldc,object.d,__importc_builtins.di,importc.h} install/import/
3333
cp bootstrap-ldc/runtime/import/ldc/gccbuiltins_*.di install/import/ldc/
3434
cp -R ldc/runtime/phobos/etc/c install/import/etc/
3535
rm -rf install/import/etc/c/zlib

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.109.0](https://dlang.org/changelog/2.109.0.html). (#4660)
45
- LLVM for prebuilt packages bumped to v18.1.6 (except for macOS arm64). (#4678)
56

67
#### Platform support

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.38.0") # May be overridden by git hash tag
120+
set(LDC_VERSION "1.39.0") # May be overridden by git hash tag
121121
set(DMDFE_MAJOR_VERSION 2)
122-
set(DMDFE_MINOR_VERSION 108)
123-
set(DMDFE_PATCH_VERSION 1)
122+
set(DMDFE_MINOR_VERSION 109)
123+
set(DMDFE_PATCH_VERSION 0)
124124

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

dmd/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ Note that these groups have no strict meaning, the category assignments are a bi
109109

110110
| File | Purpose |
111111
|-------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
112+
| [attribsem.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/attribsem.d) | Attribute semantics |
112113
| [dsymbolsem.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/dsymbolsem.d) | Do semantic 1 pass (symbol identifiers/types) |
113114
| [enumsem.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/enumsem.d) | Enum semantics |
114115
| [funcsem.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/funcsem.d) | Function semantics |

dmd/argtypes_aarch64.d

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import dmd.mtype;
1818
* This breaks a type down into 'simpler' types that can be passed to a function
1919
* in registers, and returned in registers.
2020
* This is the implementation for the AAPCS64 ABI, based on
21-
* https://github.com/ARM-software/abi-aa/blob/master/aapcs64/aapcs64.rst.
21+
* $(LINK https://github.com/ARM-software/abi-aa/blob/master/aapcs64/aapcs64.rst).
2222
* Params:
2323
* t = type to break down
2424
* Returns:

dmd/arrayop.d

+4-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@ Expression arrayOp(BinExp e, Scope* sc)
145145
if (auto te = id.isTemplateExp())
146146
arrayOp = te.td;
147147
else
148-
ObjectNotFound(idArrayOp); // fatal error
148+
{
149+
ObjectNotFound(e.loc, idArrayOp); // fatal error
150+
return ErrorExp.get();
151+
}
149152
}
150153

151154
auto fd = resolveFuncCall(e.loc, sc, arrayOp, tiargs, null, ArgumentList(args), FuncResolveFlag.standard);

dmd/astenums.d

+27
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ enum Sizeok : ubyte
1818
done, /// size of aggregate is set correctly
1919
}
2020

21+
/// D Language version
22+
enum Edition : ubyte
23+
{
24+
none,
25+
legacy, /// Before the introduction of editions
26+
v2024, /// Experimental first new edition
27+
latest = v2024 /// Newest edition that this compiler knows of
28+
}
29+
2130
enum Baseok : ubyte
2231
{
2332
none, /// base classes not computed yet
@@ -441,6 +450,24 @@ enum FileType : ubyte
441450
c, /// C source file
442451
}
443452

453+
/// In which context checks for assertions, contracts, bounds checks etc. are enabled
454+
enum CHECKENABLE : ubyte
455+
{
456+
_default, /// initial value
457+
off, /// never do checking
458+
on, /// always do checking
459+
safeonly, /// do checking only in @safe functions
460+
}
461+
462+
/// What should happend when an assertion fails
463+
enum CHECKACTION : ubyte
464+
{
465+
D, /// call D assert on failure
466+
C, /// call C assert on failure
467+
halt, /// cause program halt on failure
468+
context, /// call D assert with the error context on failure
469+
}
470+
444471
extern (C++) struct structalign_t
445472
{
446473
private:

dmd/attrib.d

-53
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import dmd.dsymbol;
3535
import dmd.dsymbolsem;
3636
import dmd.errors;
3737
import dmd.expression;
38-
import dmd.expressionsem;
3938
import dmd.func;
4039
import dmd.globals;
4140
import dmd.hdrgen : visibilityToBuffer;
@@ -1142,21 +1141,6 @@ extern (C++) final class UserAttributeDeclaration : AttribDeclaration
11421141
return udas;
11431142
}
11441143

1145-
Expressions* getAttributes()
1146-
{
1147-
if (auto sc = _scope)
1148-
{
1149-
_scope = null;
1150-
arrayExpressionSemantic(atts.peekSlice(), sc);
1151-
}
1152-
auto exps = new Expressions();
1153-
if (userAttribDecl && userAttribDecl !is this)
1154-
exps.push(new TupleExp(Loc.initial, userAttribDecl.getAttributes()));
1155-
if (atts && atts.length)
1156-
exps.push(new TupleExp(Loc.initial, atts));
1157-
return exps;
1158-
}
1159-
11601144
override const(char)* kind() const
11611145
{
11621146
return "UserAttribute";
@@ -1252,43 +1236,6 @@ bool isCoreUda(Dsymbol sym, Identifier ident)
12521236
return _module && _module.isCoreModule(Id.attribute);
12531237
}
12541238

1255-
/**
1256-
* Iterates the UDAs attached to the given symbol.
1257-
*
1258-
* Params:
1259-
* sym = the symbol to get the UDAs from
1260-
* sc = scope to use for semantic analysis of UDAs
1261-
* dg = called once for each UDA
1262-
*
1263-
* Returns:
1264-
* If `dg` returns `!= 0`, stops the iteration and returns that value.
1265-
* Otherwise, returns 0.
1266-
*/
1267-
int foreachUda(Dsymbol sym, Scope* sc, int delegate(Expression) dg)
1268-
{
1269-
if (!sym.userAttribDecl)
1270-
return 0;
1271-
1272-
auto udas = sym.userAttribDecl.getAttributes();
1273-
arrayExpressionSemantic(udas.peekSlice(), sc, true);
1274-
1275-
return udas.each!((uda) {
1276-
if (!uda.isTupleExp())
1277-
return 0;
1278-
1279-
auto exps = uda.isTupleExp().exps;
1280-
1281-
return exps.each!((e) {
1282-
assert(e);
1283-
1284-
if (auto result = dg(e))
1285-
return result;
1286-
1287-
return 0;
1288-
});
1289-
});
1290-
}
1291-
12921239
/**
12931240
* Iterates the UDAs attached to the given symbol, without performing semantic
12941241
* analysis.

dmd/attrib.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ class Expression;
1717
class Condition;
1818
class StaticForeach;
1919

20+
namespace dmd
21+
{
22+
Expressions *getAttributes(UserAttributeDeclaration *a);
23+
}
24+
2025
/**************************************************************/
2126

2227
class AttribDeclaration : public Dsymbol
@@ -226,7 +231,6 @@ class UserAttributeDeclaration final : public AttribDeclaration
226231

227232
UserAttributeDeclaration *syntaxCopy(Dsymbol *s) override;
228233
Scope *newScope(Scope *sc) override;
229-
Expressions *getAttributes();
230234
const char *kind() const override;
231235
void accept(Visitor *v) override { v->visit(this); }
232236
};

dmd/attribsem.d

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/**
2+
* Does semantic analysis for attributes.
3+
*
4+
* The term 'attribute' refers to things that can apply to a larger scope than a single declaration.
5+
* Among them are:
6+
* - Alignment (`align(8)`)
7+
* - User defined attributes (`@UDA`)
8+
* - Function Attributes (`@safe`)
9+
* - Storage classes (`static`, `__gshared`)
10+
* - Mixin declarations (`mixin("int x;")`)
11+
* - Conditional compilation (`static if`, `static foreach`)
12+
* - Linkage (`extern(C)`)
13+
* - Anonymous structs / unions
14+
* - Protection (`private`, `public`)
15+
* - Deprecated declarations (`@deprecated`)
16+
*
17+
* Copyright: Copyright (C) 1999-2024 by The D Language Foundation, All Rights Reserved
18+
* Authors: $(LINK2 https://www.digitalmars.com, Walter Bright)
19+
* License: $(LINK2 https://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
20+
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/attribsem.d, _attrib.d)
21+
* Documentation: https://dlang.org/phobos/dmd_attribsem.html
22+
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/attribsem.d
23+
*/
24+
25+
module dmd.attribsem;
26+
27+
import dmd.arraytypes;
28+
import dmd.attrib;
29+
import dmd.dscope;
30+
import dmd.dsymbol;
31+
import dmd.expression;
32+
import dmd.expressionsem;
33+
import dmd.location;
34+
import dmd.root.array; // for each
35+
36+
37+
Expressions* getAttributes(UserAttributeDeclaration a)
38+
{
39+
if (auto sc = a._scope)
40+
{
41+
a._scope = null;
42+
arrayExpressionSemantic(a.atts.peekSlice(), sc);
43+
}
44+
auto exps = new Expressions();
45+
if (a.userAttribDecl && a.userAttribDecl !is a)
46+
exps.push(new TupleExp(Loc.initial, a.userAttribDecl.getAttributes()));
47+
if (a.atts && a.atts.length)
48+
exps.push(new TupleExp(Loc.initial, a.atts));
49+
return exps;
50+
}
51+
52+
/**
53+
* Iterates the UDAs attached to the given symbol.
54+
*
55+
* Params:
56+
* sym = the symbol to get the UDAs from
57+
* sc = scope to use for semantic analysis of UDAs
58+
* dg = called once for each UDA
59+
*
60+
* Returns:
61+
* If `dg` returns `!= 0`, stops the iteration and returns that value.
62+
* Otherwise, returns 0.
63+
*/
64+
int foreachUda(Dsymbol sym, Scope* sc, int delegate(Expression) dg)
65+
{
66+
if (!sym.userAttribDecl)
67+
return 0;
68+
69+
auto udas = sym.userAttribDecl.getAttributes();
70+
arrayExpressionSemantic(udas.peekSlice(), sc, true);
71+
72+
return udas.each!((uda) {
73+
if (!uda.isTupleExp())
74+
return 0;
75+
76+
auto exps = uda.isTupleExp().exps;
77+
78+
return exps.each!((e) {
79+
assert(e);
80+
81+
if (auto result = dg(e))
82+
return result;
83+
84+
return 0;
85+
});
86+
});
87+
}

0 commit comments

Comments
 (0)