Skip to content

Commit 29230c3

Browse files
authored
Merge pull request #4854 from kinke/merge_stable
Merge upstream stable
2 parents 9285add + 91c4189 commit 29230c3

File tree

16 files changed

+95
-33
lines changed

16 files changed

+95
-33
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+
- Latest frontend and druntime patches from DMD stable (v2.110.0-rc.1+). (#4854)
45
- LLVM for prebuilt packages bumped to v19.1.7. (#4822)
56
- New prebuilt package for Alpine Linux x86_64 with musl libc. It's currently generated on Alpine v3.20, using its default LLVM 17. Most bundled executables are fully static and can be run on ~all distros. (#4826)
67
- Revived dynamic-compile (JIT) functionality (formerly unsupported since LLVM 12), supporting LLVM 18+ now. (#4774)

dmd/aggregate.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,11 @@ class ClassDeclaration : public AggregateDeclaration
307307

308308
void addObjcSymbols(ClassDeclarations *classes, ClassDeclarations *categories) override final;
309309

310+
#if !IN_LLVM
310311
// Back end
311312
Dsymbol *vtblsym;
312313
Dsymbol *vtblSymbol();
314+
#endif
313315

314316
ClassDeclaration *isClassDeclaration() override final { return (ClassDeclaration *)this; }
315317
void accept(Visitor *v) override { v->visit(this); }

dmd/dcast.d

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,12 @@ MATCH implicitConvTo(Expression e, Type t)
703703
if (!tn.isConst() && !tn.isImmutable())
704704
return MATCH.nomatch;
705705
m = MATCH.constant;
706+
707+
// After converting e.g. ubyte[] to const(ubyte)[], don't change
708+
// to MATCH.convert, return MATCH.constant
709+
// https://github.com/dlang/dmd/issues/20635
710+
if (e.type.ty == t.ty && e.type.nextOf().ty == tn.ty)
711+
return m;
706712
}
707713
if (e.type != t && e.hexString && tn.isintegral && (tn.size == e.sz || (!e.committed && (e.len % tn.size) == 0)))
708714
{

dmd/dclass.d

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,8 @@ version (IN_LLVM) {} else
922922
.objc.addSymbols(this, classes, categories);
923923
}
924924

925+
version (IN_LLVM) { /* not needed */ } else
926+
{
925927
// Back end
926928
Dsymbol vtblsym;
927929

@@ -939,6 +941,7 @@ version (IN_LLVM) {} else
939941
}
940942
return vtblsym;
941943
}
944+
}
942945

943946
extern (D) final bool isErrorException()
944947
{

dmd/dsymbolsem.d

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4169,7 +4169,8 @@ private extern(C++) class AddMemberVisitor : Visitor
41694169
}
41704170

41714171
// If using C tag/prototype/forward declaration rules
4172-
if (sc.flags & SCOPE.Cfile && !dsym.isImport())
4172+
if (sc && sc.flags & SCOPE.Cfile && !dsym.isImport())
4173+
// When merging master, replace with: if (sc && sc.inCfile && !dsym.isImport())
41734174
{
41744175
if (handleTagSymbols(*sc, dsym, s2, sds))
41754176
return;

dmd/expressionsem.d

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,11 +1363,6 @@ private Expression resolveUFCSProperties(Scope* sc, Expression e1, Expression e2
13631363
auto arguments = new Expressions(1);
13641364
(*arguments)[0] = eleft;
13651365
e = new CallExp(loc, e, arguments);
1366-
1367-
// https://issues.dlang.org/show_bug.cgi?id=24017
1368-
if (sc.flags & SCOPE.debug_)
1369-
e.isCallExp().inDebugStatement = true;
1370-
13711366
e = e.expressionSemantic(sc);
13721367
return e;
13731368
}
@@ -13364,6 +13359,11 @@ version (IN_LLVM)
1336413359
error(exp.loc, "compare not defined for complex operands");
1336513360
return setError();
1336613361
}
13362+
else if (t1.isTypeFunction() || t2.isTypeFunction())
13363+
{
13364+
error(exp.loc, "comparison is not defined for function types");
13365+
return setError();
13366+
}
1336713367
else if (t1.ty == Taarray || t2.ty == Taarray)
1336813368
{
1336913369
error(exp.loc, "`%s` is not defined for associative arrays", EXPtoString(exp.op).ptr);
@@ -13684,6 +13684,12 @@ version (IN_LLVM)
1368413684
return;
1368513685
}
1368613686

13687+
if (t1.isTypeFunction() || t2.isTypeFunction())
13688+
{
13689+
error(exp.loc, "operator `==` is not defined for function types");
13690+
return setError();
13691+
}
13692+
1368713693
if (auto tv = t1.isTypeVector())
1368813694
exp.type = tv.toBooleanVector();
1368913695

@@ -13745,6 +13751,12 @@ version (IN_LLVM)
1374513751
if (exp.e2.op == EXP.call)
1374613752
exp.e2 = (cast(CallExp)exp.e2).addDtorHook(sc);
1374713753

13754+
if (exp.e1.type.isTypeFunction() || exp.e2.type.isTypeFunction())
13755+
{
13756+
error(exp.loc, "operator `is` is not defined for function types");
13757+
return setError();
13758+
}
13759+
1374813760
if (exp.e1.type.toBasetype().ty == Tsarray ||
1374913761
exp.e2.type.toBasetype().ty == Tsarray)
1375013762
deprecation(exp.loc, "identity comparison of static arrays "

dmd/pragmasem.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ private bool pragmaMsgSemantic(Loc loc, Scope* sc, Expressions* args)
639639
else
640640
{
641641
buf.writestring("\n");
642-
fprintf(stderr, buf.extractChars);
642+
fprintf(stderr, "%s", buf.extractChars);
643643
}
644644
return true;
645645
}

dmd/statementsem.d

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,16 @@ private Expression checkAssignmentAsCondition(Expression e, Scope* sc)
134134
return e;
135135
}
136136

137-
// Performs semantic analysis in Statement AST nodes
137+
/**
138+
* Performs semantic analysis in Statement AST nodes
139+
*
140+
* Params:
141+
* s = statement to perform semantic analysis on
142+
* sc = scope in which statement resides
143+
*
144+
* Returns: statement `s` after semantic analysis.
145+
* Can be `null`, for example with `pragma(msg, "")`
146+
*/
138147
Statement statementSemantic(Statement s, Scope* sc)
139148
{
140149
import dmd.compiler;
@@ -3497,6 +3506,7 @@ version (IN_LLVM)
34973506
sc = sc.push();
34983507
sc.flags |= SCOPE.debug_;
34993508
ds.statement = ds.statement.statementSemantic(sc);
3509+
debugThrowWalker(ds.statement);
35003510
sc.pop();
35013511
}
35023512
result = ds.statement;
@@ -4804,7 +4814,6 @@ private Statements* flatten(Statement statement, Scope* sc)
48044814
if (dc)
48054815
{
48064816
s = new DebugStatement(cs.loc, cs.ifbody);
4807-
debugThrowWalker(cs.ifbody);
48084817
}
48094818
else
48104819
s = cs.ifbody;
@@ -4976,7 +4985,8 @@ Params:
49764985
*/
49774986
private void debugThrowWalker(Statement s)
49784987
{
4979-
4988+
if (!s)
4989+
return;
49804990
extern(C++) final class DebugWalker : SemanticTimeTransitiveVisitor
49814991
{
49824992
alias visit = SemanticTimeTransitiveVisitor.visit;

gen/llvmhelpers.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,13 +1491,6 @@ DValue *DtoSymbolAddress(const Loc &loc, Type *type, Declaration *decl) {
14911491
LLValue *m = DtoResolveTypeInfo(tid);
14921492
return new DImValue(type, m);
14931493
}
1494-
// special vtbl symbol, used by LDC as alias to the actual vtbl (with
1495-
// different type and mangled name)
1496-
if (vd->isClassMember() && vd == vd->isClassMember()->vtblsym) {
1497-
Logger::println("vtbl symbol");
1498-
auto cd = vd->isClassMember();
1499-
return new DLValue(type, getIrAggr(cd)->getVtblSymbol());
1500-
}
15011494
// nested variable
15021495
if (vd->nestedrefs.length) {
15031496
Logger::println("nested variable");

packaging/dlang-tools_version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2.110.0-beta.1
1+
v2.110.0-rc.1

0 commit comments

Comments
 (0)