Commit 37482edc by Iain Buclaw

d/dmd: Merge upstream dmd d1a606599

Fixes long standing regression in the D front-end implemention, and adds
a new field to allow retrieving a list of all content imports from the
code generator.

Reviewed-on: https://github.com/dlang/dmd/pull/10913
	     https://github.com/dlang/dmd/pull/10933
parent f22712bd
b061bd744cb4eb94a7118581387d988d4ec25e97 d1a606599e7c2bea8fda8bf5e3ddceb486ae69ac
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the dlang/dmd repository. merge done from the dlang/dmd repository.
...@@ -395,7 +395,6 @@ void ClassDeclaration::semantic(Scope *sc) ...@@ -395,7 +395,6 @@ void ClassDeclaration::semantic(Scope *sc)
} }
else if (symtab && !scx) else if (symtab && !scx)
{ {
semanticRun = PASSsemanticdone;
return; return;
} }
semanticRun = PASSsemantic; semanticRun = PASSsemantic;
......
...@@ -2370,6 +2370,7 @@ public: ...@@ -2370,6 +2370,7 @@ public:
return setError(); return setError();
} }
sc->_module->contentImportedFiles.push(name);
if (global.params.verbose) if (global.params.verbose)
message("file %.*s\t(%s)", (int)se->len, (char *)se->string, name); message("file %.*s\t(%s)", (int)se->len, (char *)se->string, name);
if (global.params.moduleDeps != NULL) if (global.params.moduleDeps != NULL)
......
...@@ -76,6 +76,7 @@ public: ...@@ -76,6 +76,7 @@ public:
unsigned numlines; // number of lines in source file unsigned numlines; // number of lines in source file
int isDocFile; // if it is a documentation input file, not D source int isDocFile; // if it is a documentation input file, not D source
bool isPackageFile; // if it is a package.d bool isPackageFile; // if it is a package.d
Strings contentImportedFiles; // array of files whose content was imported
int needmoduleinfo; int needmoduleinfo;
int selfimports; // 0: don't know, 1: does not, 2: does int selfimports; // 0: don't know, 1: does not, 2: does
......
import imports.pr9471c;
class AggregateDeclaration : ScopeDsymbol { }
import imports.pr9471a;
class ClassDeclaration : AggregateDeclaration
{
void isBaseOf();
}
import imports.pr9471b;
struct Array(T)
{
static if (is(typeof(T.opCmp))) { }
}
alias ClassDeclarations = Array!ClassDeclaration;
class Dsymbol
{
void addObjcSymbols(ClassDeclarations);
}
class ScopeDsymbol : Dsymbol
{
import imports.pr9471d;
void importScope();
}
// Module needs to be imported to trigger bug.
// PERMUTE_ARGS:
// EXTRA_FILES: imports/pr9471a.d imports/pr9471b.d imports/pr9471c.d imports/pr9471d.d
import imports.pr9471a;
import imports.pr9471b;
static assert (__traits(getVirtualIndex, ClassDeclaration.isBaseOf) == 7);
...@@ -1253,7 +1253,7 @@ struct S10096X ...@@ -1253,7 +1253,7 @@ struct S10096X
this(this) {} this(this) {}
~this() {} ~this() {}
string getStr() in(str) out(r; r == str) { return str; } string getStr() in { assert(str); } out(r) { assert(r == str); } body { return str; }
} }
static assert( static assert(
[__traits(allMembers, S10096X)] == [__traits(allMembers, S10096X)] ==
...@@ -1271,7 +1271,7 @@ class C10096X ...@@ -1271,7 +1271,7 @@ class C10096X
this(int) {} this(int) {}
~this() {} ~this() {}
string getStr() in(str) out(r; r == str) { return str; string getStr() in { assert(str); } out(r) { assert(r == str); } body { return str; }
} }
static assert( static assert(
[__traits(allMembers, C10096X)] == [__traits(allMembers, C10096X)] ==
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment