Skip to content
This repository was archived by the owner on Jun 20, 2019. It is now read-only.

Commit e5a495a

Browse files
authored
Merge pull request #765 from ibuclaw/dmd20181104
Update dmd to 3a29b2644
2 parents bc8803c + 0a1135d commit e5a495a

Some content is hidden

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

61 files changed

+2391
-739
lines changed

gcc/d/dmd/MERGE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
76d619c28590c632d01e8b0840b358acdf141357
2+
3+
The first line of this file holds the git revision number of the last
4+
merge done from the dlang/dmd repository.

gcc/d/dmd/access.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,9 @@ bool checkAccess(Loc loc, Scope* sc, Package p)
457457
}
458458
auto name = p.toPrettyChars();
459459
if (p.isPkgMod == PKG.module_ || p.isModule())
460-
deprecation(loc, "%s `%s` is not accessible here, perhaps add `static import %s;`", p.kind(), name, name);
460+
error(loc, "%s `%s` is not accessible here, perhaps add `static import %s;`", p.kind(), name, name);
461461
else
462-
deprecation(loc, "%s `%s` is not accessible here", p.kind(), name);
462+
error(loc, "%s `%s` is not accessible here", p.kind(), name);
463463
return true;
464464
}
465465

gcc/d/dmd/aliasthis.d

Lines changed: 46 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -63,50 +63,61 @@ extern (C++) final class AliasThis : Dsymbol
6363

6464
Expression resolveAliasThis(Scope* sc, Expression e, bool gag = false)
6565
{
66-
AggregateDeclaration ad = isAggregate(e.type);
67-
if (ad && ad.aliasthis)
66+
for (AggregateDeclaration ad = isAggregate(e.type); ad;)
6867
{
69-
uint olderrors = gag ? global.startGagging() : 0;
70-
Loc loc = e.loc;
71-
Type tthis = (e.op == TOK.type ? e.type : null);
72-
e = new DotIdExp(loc, e, ad.aliasthis.ident);
73-
e = e.expressionSemantic(sc);
74-
if (tthis && ad.aliasthis.needThis())
68+
if (ad.aliasthis)
7569
{
76-
if (e.op == TOK.variable)
70+
uint olderrors = gag ? global.startGagging() : 0;
71+
Loc loc = e.loc;
72+
Type tthis = (e.op == TOK.type ? e.type : null);
73+
e = new DotIdExp(loc, e, ad.aliasthis.ident);
74+
e = e.expressionSemantic(sc);
75+
if (tthis && ad.aliasthis.needThis())
7776
{
78-
if (auto fd = (cast(VarExp)e).var.isFuncDeclaration())
77+
if (e.op == TOK.variable)
7978
{
80-
// https://issues.dlang.org/show_bug.cgi?id=13009
81-
// Support better match for the overloaded alias this.
82-
bool hasOverloads;
83-
if (auto f = fd.overloadModMatch(loc, tthis, hasOverloads))
79+
if (auto fd = (cast(VarExp)e).var.isFuncDeclaration())
8480
{
85-
if (!hasOverloads)
86-
fd = f; // use exact match
87-
e = new VarExp(loc, fd, hasOverloads);
88-
e.type = f.type;
89-
e = new CallExp(loc, e);
90-
goto L1;
81+
// https://issues.dlang.org/show_bug.cgi?id=13009
82+
// Support better match for the overloaded alias this.
83+
bool hasOverloads;
84+
if (auto f = fd.overloadModMatch(loc, tthis, hasOverloads))
85+
{
86+
if (!hasOverloads)
87+
fd = f; // use exact match
88+
e = new VarExp(loc, fd, hasOverloads);
89+
e.type = f.type;
90+
e = new CallExp(loc, e);
91+
goto L1;
92+
}
9193
}
9294
}
95+
/* non-@property function is not called inside typeof(),
96+
* so resolve it ahead.
97+
*/
98+
{
99+
int save = sc.intypeof;
100+
sc.intypeof = 1; // bypass "need this" error check
101+
e = resolveProperties(sc, e);
102+
sc.intypeof = save;
103+
}
104+
L1:
105+
e = new TypeExp(loc, new TypeTypeof(loc, e));
106+
e = e.expressionSemantic(sc);
93107
}
94-
/* non-@property function is not called inside typeof(),
95-
* so resolve it ahead.
96-
*/
97-
{
98-
int save = sc.intypeof;
99-
sc.intypeof = 1; // bypass "need this" error check
100-
e = resolveProperties(sc, e);
101-
sc.intypeof = save;
102-
}
103-
L1:
104-
e = new TypeExp(loc, new TypeTypeof(loc, e));
105-
e = e.expressionSemantic(sc);
108+
e = resolveProperties(sc, e);
109+
if (gag && global.endGagging(olderrors))
110+
e = null;
111+
}
112+
113+
import dmd.dclass : ClassDeclaration;
114+
auto cd = ad.isClassDeclaration();
115+
if ((!e || !ad.aliasthis) && cd && cd.baseClass && cd.baseClass != ClassDeclaration.object)
116+
{
117+
ad = cd.baseClass;
118+
continue;
106119
}
107-
e = resolveProperties(sc, e);
108-
if (gag && global.endGagging(olderrors))
109-
e = null;
120+
break;
110121
}
111122
return e;
112123
}

gcc/d/dmd/compiler.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
#pragma once
1212

13+
#include "root/array.h"
14+
1315
// This file contains a data structure that describes a back-end compiler
1416
// and implements compiler-specific actions.
1517

@@ -18,6 +20,16 @@ class Module;
1820
class Type;
1921
struct Scope;
2022

23+
// DMD-generated module `__entrypoint` where the C main resides
24+
extern Module *entrypoint;
25+
// Module in which the D main is
26+
extern Module *rootHasMain;
27+
28+
extern bool includeImports;
29+
// array of module patterns used to include/exclude imported modules
30+
extern Array<const char*> includeModulePatterns;
31+
extern Array<Module *> compiledImports;
32+
2133
struct Compiler
2234
{
2335
// CTFE support for cross-compilation.

0 commit comments

Comments
 (0)