Skip to content

Commit 634521a

Browse files
authored
Merge pull request #4949 from ldc-developers/merge-2.112
Upgrade frontend & libs to v2.112
2 parents 46bbe8b + 4ffe9d5 commit 634521a

File tree

245 files changed

+8772
-3488
lines changed

Some content is hidden

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

245 files changed

+8772
-3488
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.112.0](https://dlang.org/changelog/2.112.0.html). (#4949)
45
- **Breaking change for dcompute**: The special `@kernel` UDA is now a function and _**requires**_ parentheses as in `@kernel() void foo(){}`. Optionally you can provide launch dimensions, `@kernel([2,4,8])`, to specify to the compute runtime how the kernel is intended to be launched.
56

67
#### Platform support

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ include(GetLinuxDistribution)
121121
#
122122

123123
# Version information
124-
set(LDC_VERSION "1.41.0") # May be overridden by git hash tag
124+
set(LDC_VERSION "1.42.0") # May be overridden by git hash tag
125125
set(DMDFE_MAJOR_VERSION 2)
126-
set(DMDFE_MINOR_VERSION 111)
126+
set(DMDFE_MINOR_VERSION 112)
127127
set(DMDFE_PATCH_VERSION 0)
128128

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

dmd/aggregate.d

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,6 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol
187187
return fields.length - isNested() - (vthis2 !is null);
188188
}
189189

190-
abstract void finalizeSize();
191-
192190
override final uinteger_t size(Loc loc)
193191
{
194192
//printf("+AggregateDeclaration::size() %s, scope = %p, sizeok = %d\n", toChars(), _scope, sizeok);

dmd/aggregate.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ class AggregateDeclaration : public ScopeDsymbol
120120
Sizeok sizeok; // set when structsize contains valid data
121121

122122
virtual Scope *newScope(Scope *sc);
123-
virtual void finalizeSize() = 0;
124123
uinteger_t size(Loc loc) override final;
125124
Type *getType() override final;
126125
bool isDeprecated() const override final; // is aggregate deprecated?
@@ -174,7 +173,6 @@ class StructDeclaration : public AggregateDeclaration
174173
static StructDeclaration *create(Loc loc, Identifier *id, bool inObject);
175174
StructDeclaration *syntaxCopy(Dsymbol *s) override;
176175
const char *kind() const override;
177-
void finalizeSize() override final;
178176
bool isPOD();
179177
bool zeroInit() const; // !=0 if initialize with 0 fill
180178
bool zeroInit(bool v);
@@ -200,7 +198,7 @@ class StructDeclaration : public AggregateDeclaration
200198

201199
unsigned numArgTypes() const;
202200
Type *argType(unsigned index);
203-
bool hasRegularCtor(bool checkDisabled = false);
201+
bool hasRegularCtor(bool ignoreDisabled = false);
204202
};
205203

206204
class UnionDeclaration final : public StructDeclaration
@@ -293,13 +291,11 @@ class ClassDeclaration : public AggregateDeclaration
293291
virtual bool isBaseOf(ClassDeclaration *cd, int *poffset);
294292

295293
bool isBaseInfoComplete();
296-
void finalizeSize() override;
297294
bool hasMonitor();
298295
bool isCOMclass() const;
299296
virtual bool isCOMinterface() const;
300297
bool isCPPclass() const;
301298
virtual bool isCPPinterface() const;
302-
bool isAbstract();
303299
virtual int vtblOffset() const;
304300
const char *kind() const override;
305301

dmd/attrib.d

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,6 @@ extern (C++) abstract class AttribDeclaration : Dsymbol
110110
return "attribute";
111111
}
112112

113-
override final bool hasPointers()
114-
{
115-
return this.include(null).foreachDsymbol( (s) { return s.hasPointers(); } ) != 0;
116-
}
117-
118113
/****************************************
119114
*/
120115
override final void addObjcSymbols(ClassDeclarations* classes, ClassDeclarations* categories)

dmd/attrib.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class AttribDeclaration : public Dsymbol
2929
public:
3030
Dsymbols *decl; // array of Dsymbol's
3131
const char *kind() const override;
32-
bool hasPointers() override final;
3332
void accept(Visitor *v) override { v->visit(this); }
3433
};
3534

dmd/cli.d

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,8 +664,13 @@ dmd -cov -unittest myprog.d
664664
),
665665
Option("nothrow",
666666
"assume no Exceptions will be thrown",
667-
`Turns off generation of exception stack unwinding code, enables
668-
more efficient code for RAII objects.`,
667+
"Turns off generation of exception stack unwinding code, enables
668+
more efficient code for RAII objects. Note: this doesn't change
669+
function mangling, so it is possible to link `-nothrow` code with
670+
code that throws Exceptions, which can result in undefined behavior
671+
without any protection from the type system. Prefer the `nothrow`
672+
function attribute for partial disabling of Exceptions instead,
673+
and only use this flag to globally disable Exceptions.",
669674
),
670675
Option("O",
671676
"optimize",

dmd/cond.d

Lines changed: 2 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import dmd.dscope;
2424
import dmd.dsymbol;
2525
import dmd.errors;
2626
import dmd.expression;
27-
import dmd.expressionsem : evalStaticCondition;
2827
import dmd.globals;
2928
import dmd.identifier;
3029
import dmd.location;
@@ -71,8 +70,6 @@ extern (C++) abstract class Condition : ASTNode
7170

7271
abstract Condition syntaxCopy();
7372

74-
abstract int include(Scope* sc);
75-
7673
inout(DebugCondition) isDebugCondition() inout
7774
{
7875
return null;
@@ -324,39 +321,6 @@ extern (C++) final class DebugCondition : DVCondition
324321
super(loc, mod, ident);
325322
}
326323

327-
override int include(Scope* sc)
328-
{
329-
//printf("DebugCondition::include() level = %d, debuglevel = %d\n", level, global.params.debuglevel);
330-
if (inc != Include.notComputed)
331-
{
332-
return inc == Include.yes;
333-
}
334-
inc = Include.no;
335-
bool definedInModule = false;
336-
if (ident)
337-
{
338-
if (mod.debugids && findCondition(*mod.debugids, ident))
339-
{
340-
inc = Include.yes;
341-
definedInModule = true;
342-
}
343-
else if (findCondition(global.debugids, ident))
344-
inc = Include.yes;
345-
else
346-
{
347-
if (!mod.debugidsNot)
348-
mod.debugidsNot = new Identifiers();
349-
mod.debugidsNot.push(ident);
350-
}
351-
}
352-
else if (global.params.debugEnabled)
353-
inc = Include.yes;
354-
355-
if (!definedInModule)
356-
printDepsConditional(sc, this, "depsDebug ");
357-
return (inc == Include.yes);
358-
}
359-
360324
override inout(DebugCondition) isDebugCondition() inout
361325
{
362326
return this;
@@ -390,7 +354,7 @@ extern (C++) final class VersionCondition : DVCondition
390354
* Returns:
391355
* `true` if it is reserved, `false` otherwise
392356
*/
393-
extern(D) private static bool isReserved(const(char)[] ident) @safe
357+
extern(D) public static bool isReserved(const(char)[] ident) @safe
394358
{
395359
// This list doesn't include "D_*" versions, see the last return
396360
switch (ident)
@@ -599,41 +563,6 @@ extern (C++) final class VersionCondition : DVCondition
599563
super(loc, mod, ident);
600564
}
601565

602-
override int include(Scope* sc)
603-
{
604-
//printf("VersionCondition::include() level = %d, versionlevel = %d\n", level, global.params.versionlevel);
605-
//if (ident) printf("\tident = '%s'\n", ident.toChars());
606-
if (inc != Include.notComputed)
607-
{
608-
return inc == Include.yes;
609-
}
610-
611-
inc = Include.no;
612-
bool definedInModule = false;
613-
if (ident)
614-
{
615-
if (mod.versionids && findCondition(*mod.versionids, ident))
616-
{
617-
inc = Include.yes;
618-
definedInModule = true;
619-
}
620-
else if (findCondition(global.versionids, ident))
621-
inc = Include.yes;
622-
else
623-
{
624-
if (!mod.versionidsNot)
625-
mod.versionidsNot = new Identifiers();
626-
mod.versionidsNot.push(ident);
627-
}
628-
}
629-
if (!definedInModule &&
630-
(!ident || (!isReserved(ident.toString()) && ident != Id._unittest && ident != Id._assert)))
631-
{
632-
printDepsConditional(sc, this, "depsVersion ");
633-
}
634-
return (inc == Include.yes);
635-
}
636-
637566
override inout(VersionCondition) isVersionCondition() inout
638567
{
639568
return this;
@@ -662,47 +591,6 @@ extern (C++) final class StaticIfCondition : Condition
662591
return new StaticIfCondition(loc, exp.syntaxCopy());
663592
}
664593

665-
override int include(Scope* sc)
666-
{
667-
// printf("StaticIfCondition::include(sc = %p) this=%p inc = %d\n", sc, this, inc);
668-
669-
int errorReturn()
670-
{
671-
if (!global.gag)
672-
inc = Include.no; // so we don't see the error message again
673-
return 0;
674-
}
675-
676-
if (inc != Include.notComputed)
677-
{
678-
return inc == Include.yes;
679-
}
680-
681-
if (!sc)
682-
{
683-
error(loc, "`static if` conditional cannot be at global scope");
684-
inc = Include.no;
685-
return 0;
686-
}
687-
688-
import dmd.staticcond;
689-
bool errors;
690-
691-
bool result = evalStaticCondition(sc, exp, exp, errors);
692-
693-
// Prevent repeated condition evaluation.
694-
// See: fail_compilation/fail7815.d
695-
if (inc != Include.notComputed)
696-
return (inc == Include.yes);
697-
if (errors)
698-
return errorReturn();
699-
if (result)
700-
inc = Include.yes;
701-
else
702-
inc = Include.no;
703-
return (inc == Include.yes);
704-
}
705-
706594
override void accept(Visitor v)
707595
{
708596
v.visit(this);
@@ -734,7 +622,7 @@ bool findCondition(ref Identifiers ids, Identifier ident) @safe nothrow pure
734622
}
735623

736624
// Helper for printing dependency information
737-
private void printDepsConditional(Scope* sc, DVCondition condition, const(char)[] depType)
625+
public void printDepsConditional(Scope* sc, DVCondition condition, const(char)[] depType)
738626
{
739627
if (!global.params.moduleDeps.buffer || global.params.moduleDeps.name)
740628
return;

dmd/cond.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class Condition : public ASTNode
3838
DYNCAST dyncast() const override final { return DYNCAST_CONDITION; }
3939

4040
virtual Condition *syntaxCopy() = 0;
41-
virtual int include(Scope *sc) = 0;
4241
virtual DebugCondition *isDebugCondition() { return nullptr; }
4342
virtual VersionCondition *isVersionCondition() { return nullptr; }
4443
void accept(Visitor *v) override { v->visit(this); }
@@ -70,7 +69,6 @@ class DebugCondition final : public DVCondition
7069
public:
7170
static void addGlobalIdent(const char *ident);
7271

73-
int include(Scope *sc) override;
7472
void accept(Visitor *v) override { v->visit(this); }
7573
};
7674

@@ -80,7 +78,6 @@ class VersionCondition final : public DVCondition
8078
static void addGlobalIdent(const char *ident);
8179
static void addPredefinedGlobalIdent(const char *ident);
8280

83-
int include(Scope *sc) override;
8481
void accept(Visitor *v) override { v->visit(this); }
8582
};
8683

@@ -90,6 +87,5 @@ class StaticIfCondition final : public Condition
9087
Expression *exp;
9188

9289
StaticIfCondition *syntaxCopy() override;
93-
int include(Scope *sc) override;
9490
void accept(Visitor *v) override { v->visit(this); }
9591
};

0 commit comments

Comments
 (0)