Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c51c2c0
Merge 2.075.0 front-end and stdlibs
kinke Jul 29, 2017
e347413
Bump LDC and front-end versions
kinke Jul 30, 2017
fd1ee05
Fix missing console colors
kinke Aug 3, 2017
8177581
LDMD: Hide `-gc` switch
kinke Aug 3, 2017
c7d91cf
druntime: Make LDC-specific alloca() pure too
kinke Aug 3, 2017
58ef634
Phobos: Simplify 2 LDC-specific conditions
kinke Aug 3, 2017
2616261
Revise all LDC-specific errors/warnings/deprecs and insert backticks
kinke Aug 3, 2017
988444c
dmd-testsuite: Adapt to backticks in error messages
kinke Aug 4, 2017
db8797e
Allow vectors to be compared for (not-)equality
kinke Aug 4, 2017
980c562
Merge branch 'master' into merge-2.075
kinke Aug 4, 2017
befd05e
Optimize lhs = structliteral.ctor(args)
kinke Aug 10, 2017
b085be1
Merge branch 'master' into merge-2.075
kinke Aug 12, 2017
219de8b
Merge 2.075.1 front-end and stdlibs
kinke Aug 20, 2017
923e30e
Merge branch 'master' into merge-2.075
kinke Aug 20, 2017
41aae46
Merge branch 'master' into merge-2.075
kinke Sep 12, 2017
1fa90a0
Fix parameter-less out contracts of virtual methods with auto return …
kinke Sep 22, 2017
610a1c3
Handle multiple function definitions with same mangled name
kinke Sep 23, 2017
3bcdf09
Fix warnings about unhandled new linkage type LINKsystem
kinke Sep 23, 2017
cd1fbc8
Phobos: Limit optimization for a new benchmarking unittest
kinke Sep 23, 2017
960dfd5
[Windows] druntime: LDC doesn't support precise GC scanning yet
kinke Sep 24, 2017
0c0c8d7
Clean up IRState initialization
kinke Sep 24, 2017
4515474
Fix Objective-C initialization regression
kinke Sep 27, 2017
c49464a
OSX: Make sure T.mangleof matches the final mangle for C++ symbols
kinke Sep 27, 2017
3e554f2
Revert "OSX: Make sure T.mangleof matches the final mangle for C++ sy…
kinke Sep 29, 2017
8df2fb7
dmd-testsuite: Adapt OSX C++ mangling tests
kinke Sep 29, 2017
d7f68db
Merge branch 'master' into merge-2.075
kinke Oct 1, 2017
2ec62ab
CircleCI: Exclude std.process unittests for now
kinke Oct 1, 2017
fc54e81
Phobos: Cherry-pick std.windows.registry fix
kinke Oct 5, 2017
aee6ba6
AppVeyor: Upgrade to LDC-LLVM 5.0.0
kinke Oct 6, 2017
5d449c2
dmd-testsuite: Disable a test to work around issue #2361
kinke Oct 6, 2017
31169ec
Relax tests/debuginfo/nested_cdb.d for Win32
kinke Oct 6, 2017
a37dc8b
Adapt lit test
kinke Oct 6, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,8 @@ jobs:
when: always
- run:
name: Run stdlib unittests
command: cd build && ctest -j3 --output-on-failure -E "dmd-testsuite|ldc2-unittest|lit-tests"
# FIXME: Exclude std.process unittests for now.
# CircleCI doesn't throw an expected ProcessException when spawning a
# process in a working dir with 0400 permissions (no search permissions).
command: cd build && ctest -j3 --output-on-failure -E "std\.process|dmd-testsuite|ldc2-unittest|lit-tests"
when: always
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ endfunction()
set(LDC_VERSION "1.5.0") # May be overridden by git hash tag
set(DMDFE_MAJOR_VERSION 2)
set(DMDFE_MINOR_VERSION 0)
set(DMDFE_PATCH_VERSION 74)
set(DMDFE_PATCH_VERSION 75)
set(DMDFE_FIX_LEVEL 1) # Comment out if not used

set(DMD_VERSION ${DMDFE_MAJOR_VERSION}.${DMDFE_MINOR_VERSION}${DMDFE_PATCH_VERSION})
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ install:
- make --version
- cd ..
# Download & extract a pre-built LLVM (CMAKE_BUILD_TYPE=Release, LLVM_ENABLE_ASSERTIONS=ON)
- appveyor DownloadFile "https://github.com/ldc-developers/llvm/releases/download/ldc-v4.0.1/appveyor-llvm-4.0.1-%APPVEYOR_JOB_ARCH%.7z" -FileName llvm.7z
- appveyor DownloadFile "https://github.com/ldc-developers/llvm/releases/download/ldc-v5.0.0/appveyor-llvm-5.0.0-%APPVEYOR_JOB_ARCH%.7z" -FileName llvm.7z
- md llvm
- cd llvm
- 7z x ..\llvm.7z > nul
Expand Down
6 changes: 3 additions & 3 deletions ddmd/access.d
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ extern (C++) bool checkAccess(AggregateDeclaration ad, Loc loc, Scope* sc, Dsymb
}
if (!result)
{
ad.error(loc, "member %s is not accessible", smember.toChars());
ad.error(loc, "member `%s` is not accessible", smember.toChars());
//printf("smember = %s %s, prot = %d, semanticRun = %d\n",
// smember.kind(), smember.toPrettyChars(), smember.prot(), smember.semanticRun);
return true;
Expand Down Expand Up @@ -412,7 +412,7 @@ extern (C++) bool checkAccess(Loc loc, Scope* sc, Expression e, Declaration d)
{
if (d.prot().kind == PROTprivate && d.getAccessModule() != sc._module || d.prot().kind == PROTpackage && !hasPackageAccess(sc, d))
{
error(loc, "%s %s is not accessible from module %s", d.kind(), d.toPrettyChars(), sc._module.toChars());
error(loc, "%s `%s` is not accessible from module `%s`", d.kind(), d.toPrettyChars(), sc._module.toChars());
return true;
}
}
Expand Down Expand Up @@ -448,7 +448,7 @@ extern (C++) bool checkAccess(Loc loc, Scope* sc, Expression e, Declaration d)
*
* Because a global symbol table tree is used for imported packages/modules,
* access to them needs to be checked based on the imports in the scope chain
* (see Bugzilla 313).
* (see https://issues.dlang.org/show_bug.cgi?id=313).
*
*/
extern (C++) bool checkAccess(Loc loc, Scope* sc, Package p)
Expand Down
33 changes: 22 additions & 11 deletions ddmd/aggregate.d
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol
// Might need a scope to resolve forward references. The check for
// semanticRun prevents unnecessary setting of _scope during deferred
// setScope phases for aggregates which already finished semantic().
// Also see https://issues.dlang.org/show_bug.cgi?id=16607
// See https://issues.dlang.org/show_bug.cgi?id=16607
if (semanticRun < PASSsemanticdone)
ScopeDsymbol.setScope(sc);
}
Expand Down Expand Up @@ -164,7 +164,7 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol

override final void semantic3(Scope* sc)
{
//printf("AggregateDeclaration::semantic3(%s) type = %s, errors = %d\n", toChars(), type.toChars(), errors);
//printf("AggregateDeclaration::semantic3(sc=%p, %s) type = %s, errors = %d\n", sc, toChars(), type.toChars(), errors);
if (!members)
return;

Expand Down Expand Up @@ -213,6 +213,7 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol
}
if (sd)
sd.semanticTypeInfoMembers();
semanticRun = PASSsemantic3done;
}

/***************************************
Expand Down Expand Up @@ -245,7 +246,7 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol

auto ad = cast(AggregateDeclaration)param;

if (v._scope)
if (v.semanticRun < PASSsemanticdone)
v.semantic(null);
// Return in case a recursive determineFields triggered by v.semantic already finished
if (ad.sizeok != SIZEOKnone)
Expand All @@ -269,7 +270,7 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol
if (ad == (cast(TypeStruct)tv).sym)
{
const(char)* psz = (v.type.toBasetype().ty == Tsarray) ? "static array of " : "";
ad.error("cannot have field %s with %ssame struct type", v.toChars(), psz);
ad.error("cannot have field `%s` with %ssame struct type", v.toChars(), psz);
ad.type = Type.terror;
ad.errors = true;
return 1;
Expand Down Expand Up @@ -389,7 +390,10 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol
{
auto vd = fields[i];
if (vd.errors)
{
errors = true;
continue;
}

auto vx = vd;
if (vd._init && vd._init.isVoidInitializer())
Expand All @@ -401,6 +405,11 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol
if (i == j)
continue;
auto v2 = fields[j];
if (v2.errors)
{
errors = true;
continue;
}
if (!vd.isOverlappedWith(v2))
continue;

Expand All @@ -420,7 +429,7 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol

if (vx._init && v2._init)
{
.error(loc, "overlapping default initialization for field %s and %s", v2.toChars(), vd.toChars());
.error(loc, "overlapping default initialization for field `%s` and `%s`", v2.toChars(), vd.toChars());
errors = true;
}
}
Expand Down Expand Up @@ -493,13 +502,13 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol
}
else if (v2._init)
{
.error(loc, "overlapping initialization for field %s and %s", v2.toChars(), vd.toChars());
.error(loc, "overlapping initialization for field `%s` and `%s`", v2.toChars(), vd.toChars());
errors = true;
}
}
else
{
// Will fix Bugzilla 1432 by enabling this path always
// fixes https://issues.dlang.org/show_bug.cgi?id=1432 by enabling this path always

/* Prefer explicitly initialized field
* union U { int a; int b = 2; }
Expand All @@ -516,7 +525,7 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol
}
else if (vx._init && v2._init)
{
.error(loc, "overlapping default initialization for field %s and %s",
.error(loc, "overlapping default initialization for field `%s` and `%s`",
v2.toChars(), vd.toChars());
errors = true;
}
Expand All @@ -540,11 +549,12 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol
{
if ((vx.storage_class & STCnodefaultctor) && !ctorinit)
{
.error(loc, "field %s.%s must be initialized because it has no default constructor",
.error(loc, "field `%s.%s` must be initialized because it has no default constructor",
type.toChars(), vx.toChars());
errors = true;
}
/* Bugzilla 12509: Get the element of static array type.
/* https://issues.dlang.org/show_bug.cgi?id=12509
* Get the element of static array type.
*/
Type telem = vx.type;
if (telem.ty == Tsarray)
Expand Down Expand Up @@ -690,7 +700,8 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol
{
enclosing = fd;

/* Bugzilla 14422: If a nested class parent is a function, its
/* https://issues.dlang.org/show_bug.cgi?id=14422
* If a nested class parent is a function, its
* context pointer (== `outer`) should be void* always.
*/
t = Type.tvoidptr;
Expand Down
2 changes: 1 addition & 1 deletion ddmd/aggregate.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,11 @@ class ClassDeclaration : public AggregateDeclaration
TypeInfoClassDeclaration *vclassinfo; // the ClassInfo object for this ClassDeclaration
bool com; // true if this is a COM class (meaning it derives from IUnknown)
bool cpp; // true if this is a C++ interface
bool isobjc; // true if this is an Objective-C class/interface
bool isscope; // true if this is a scope class
Abstract isabstract; // 0: fwdref, 1: is abstract class, 2: not abstract
int inuse; // to prevent recursive attempts
Baseok baseok; // set the progress of base classes resolving
Objc_ClassDeclaration objc;
Symbol *cpp_type_info_ptr_sym; // cached instance of class Id.cpp_type_info_ptr

Dsymbol *syntaxCopy(Dsymbol *s);
Expand Down
31 changes: 22 additions & 9 deletions ddmd/aliasthis.d
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,30 @@ extern (C++) final class AliasThis : Dsymbol
override Dsymbol syntaxCopy(Dsymbol s)
{
assert(!s);
/* Since there is no semantic information stored here,
* we don't need to copy it.
*/
return this;
return new AliasThis(loc, ident);
}

override void semantic(Scope* sc)
{
if (semanticRun != PASSinit)
return;

if (_scope)
{
sc = _scope;
_scope = null;
}

if (!sc)
return;

semanticRun = PASSsemantic;

Dsymbol p = sc.parent.pastMixin();
AggregateDeclaration ad = p.isAggregateDeclaration();
if (!ad)
{
.error(loc, "alias this can only be a member of aggregate, not %s %s", p.kind(), p.toChars());
.error(loc, "alias this can only be a member of aggregate, not %s `%s`", p.kind(), p.toChars());
return;
}

Expand All @@ -63,9 +74,9 @@ extern (C++) final class AliasThis : Dsymbol
{
s = sc.search(loc, ident, null);
if (s)
.error(loc, "%s is not a member of %s", s.toChars(), ad.toChars());
.error(loc, "`%s` is not a member of `%s`", s.toChars(), ad.toChars());
else
.error(loc, "undefined identifier %s", ident.toChars());
.error(loc, "undefined identifier `%s`", ident.toChars());
return;
}
if (ad.aliasthis && s != ad.aliasthis)
Expand All @@ -89,11 +100,12 @@ extern (C++) final class AliasThis : Dsymbol
assert(t);
if (ad.type.implicitConvTo(t) > MATCHnomatch)
{
.error(loc, "alias this is not reachable as %s already converts to %s", ad.toChars(), t.toChars());
.error(loc, "alias this is not reachable as `%s` already converts to `%s`", ad.toChars(), t.toChars());
}
}

ad.aliasthis = s;
semanticRun = PASSsemanticdone;
}

override const(char)* kind() const
Expand Down Expand Up @@ -128,7 +140,8 @@ extern (C++) Expression resolveAliasThis(Scope* sc, Expression e, bool gag = fal
{
if (auto fd = (cast(VarExp)e).var.isFuncDeclaration())
{
// Bugzilla 13009: Support better match for the overloaded alias this.
// https://issues.dlang.org/show_bug.cgi?id=13009
// Support better match for the overloaded alias this.
bool hasOverloads;
if (auto f = fd.overloadModMatch(loc, tthis, hasOverloads))
{
Expand Down
6 changes: 4 additions & 2 deletions ddmd/arrayop.d
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ extern (C++) void buildArrayIdent(Expression e, OutBuffer* buf, Expressions* arg
(t2.ty == Tarray && !t1.equivalent(tb) ||
t2.ty != Tarray && !t1.nextOf().equivalent(e.e2.type)))
{
// Bugzilla 12780: if A is narrower than B
// https://issues.dlang.org/show_bug.cgi?id=12780
// if A is narrower than B:
// A[] op B[]
// A[] op B
buf.writestring("Of");
Expand All @@ -399,7 +400,8 @@ extern (C++) void buildArrayIdent(Expression e, OutBuffer* buf, Expressions* arg
(t1.ty == Tarray && !t2.equivalent(tb) ||
t1.ty != Tarray && !t2.nextOf().equivalent(e.e1.type)))
{
// Bugzilla 12780: if B is narrower than A:
// https://issues.dlang.org/show_bug.cgi?id=12780
// if B is narrower than A:
// A[] op B[]
// A op B[]
buf.writestring("Of");
Expand Down
86 changes: 86 additions & 0 deletions ddmd/astcodegen.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
module ddmd.astcodegen;

struct ASTCodegen
{
import ddmd.aggregate;
import ddmd.aliasthis;
import ddmd.arraytypes;
import ddmd.attrib;
import ddmd.cond;
import ddmd.dclass;
import ddmd.declaration;
import ddmd.denum;
import ddmd.dimport;
import ddmd.dmodule;
import ddmd.dstruct;
import ddmd.dsymbol;
import ddmd.dtemplate;
import ddmd.dversion;
import ddmd.expression;
import ddmd.func;
import ddmd.hdrgen;
import ddmd.init;
import ddmd.mtype;
import ddmd.nspace;
import ddmd.statement;
import ddmd.staticassert;

alias UserAttributeDeclaration = ddmd.attrib.UserAttributeDeclaration;

alias MODconst = ddmd.mtype.MODconst;
alias MODimmutable = ddmd.mtype.MODimmutable;
alias MODshared = ddmd.mtype.MODshared;
alias MODwild = ddmd.mtype.MODwild;
alias Type = ddmd.mtype.Type;
alias Tident = ddmd.mtype.Tident;
alias Tfunction = ddmd.mtype.Tfunction;
alias Parameter = ddmd.mtype.Parameter;
alias Taarray = ddmd.mtype.Taarray;
alias Tsarray = ddmd.mtype.Tsarray;

alias STCconst = ddmd.declaration.STCconst;
alias STCimmutable = ddmd.declaration.STCimmutable;
alias STCshared = ddmd.declaration.STCshared;
alias STCwild = ddmd.declaration.STCwild;
alias STCin = ddmd.declaration.STCin;
alias STCout = ddmd.declaration.STCout;
alias STCref = ddmd.declaration.STCref;
alias STClazy = ddmd.declaration.STClazy;
alias STCscope = ddmd.declaration.STCscope;
alias STCfinal = ddmd.declaration.STCfinal;
alias STCauto = ddmd.declaration.STCauto;
alias STCreturn = ddmd.declaration.STCreturn;
alias STCmanifest = ddmd.declaration.STCmanifest;
alias STCgshared = ddmd.declaration.STCgshared;
alias STCtls = ddmd.declaration.STCtls;
alias STCsafe = ddmd.declaration.STCsafe;
alias STCsystem = ddmd.declaration.STCsystem;
alias STCtrusted = ddmd.declaration.STCtrusted;
alias STCnothrow = ddmd.declaration.STCnothrow;
alias STCpure = ddmd.declaration.STCpure;
alias STCproperty = ddmd.declaration.STCproperty;
alias STCnogc = ddmd.declaration.STCnogc;
alias STCdisable = ddmd.declaration.STCdisable;
alias STCundefined = ddmd.declaration.STCundefined;
alias STC_TYPECTOR = ddmd.declaration.STC_TYPECTOR;
alias STCoverride = ddmd.declaration.STCoverride;
alias STCabstract = ddmd.declaration.STCabstract;
alias STCsynchronized = ddmd.declaration.STCsynchronized;
alias STCdeprecated = ddmd.declaration.STCdeprecated;
alias STCstatic = ddmd.declaration.STCstatic;
alias STCextern = ddmd.declaration.STCextern;

alias Dsymbol = ddmd.dsymbol.Dsymbol;
alias Dsymbols = ddmd.dsymbol.Dsymbols;
alias PROTprivate = ddmd.dsymbol.PROTprivate;
alias PROTpackage = ddmd.dsymbol.PROTpackage;
alias PROTprotected = ddmd.dsymbol.PROTprotected;
alias PROTpublic = ddmd.dsymbol.PROTpublic;
alias PROTexport = ddmd.dsymbol.PROTexport;
alias PROTundefined = ddmd.dsymbol.PROTundefined;
alias Prot = ddmd.dsymbol.Prot;

alias stcToBuffer = ddmd.hdrgen.stcToBuffer;
alias linkageToChars = ddmd.hdrgen.linkageToChars;
alias protectionToChars = ddmd.hdrgen.protectionToChars;
}
Loading