Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Merged the 2.064 frontend #519

Closed
wants to merge 74 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
f67cbcd
DtoType -> DtoFunctionType.
dnadlinger Oct 18, 2013
5ac894c
Diff reduction: Remove unnecessary forward declarations.
dnadlinger Oct 18, 2013
01b6d55
Diff reduction: Remove Scope::ignoreTemplates and friends.
dnadlinger Oct 18, 2013
c400d18
Immediately exit on function type mismatch to avoid LLVM crash.
dnadlinger Oct 19, 2013
cb34158
First merge of 2.064 beta.
dnadlinger Oct 19, 2013
1d14212
Handle "initializer outlining" for loop rewrites in 2.064.
dnadlinger Oct 19, 2013
d918115
Remove assertion triggered due to qualifier mismatch.
dnadlinger Oct 19, 2013
e363852
Do not leave __xopEquals for structs undefined.
dnadlinger Oct 19, 2013
55c02f7
Fix IRLandingPadCatchInfo initialization order warning.
dnadlinger Oct 20, 2013
2b800b8
Fix catch clause codegen.
dnadlinger Oct 20, 2013
82c202b
Adjust _d_assert_msg return type.
dnadlinger Oct 20, 2013
d9b137b
Implement new ModuleInfo discovery/druntime startup scheme on Linux.
dnadlinger Oct 21, 2013
4041855
Update use of Typeinfo.
redstar Oct 28, 2013
3a85bbe
Merge latest druntime/phobos changes.
redstar Oct 29, 2013
72f34e3
Update source to eb1b004.
redstar Oct 30, 2013
d48c72d
Enable delete again.
redstar Oct 31, 2013
054d789
Update to b52c07.
redstar Nov 1, 2013
81775df
Fix version number
redstar Nov 1, 2013
a225ee9
_d_hidden_func needs a parameter.
redstar Nov 1, 2013
27ccce3
Make std.math.ldexp @trusted
redstar Nov 1, 2013
1310337
Add more IN_LLVM sections and minimize more differences to DMD.
redstar Nov 2, 2013
bf4c6f8
Fix CR/LF horror which prevents compiling with MSVC
redstar Nov 2, 2013
ecefd81
Possible fix for the current segfaults.
redstar Nov 3, 2013
f7f62a6
Declare more TypeClass instances as builtin.
redstar Nov 3, 2013
2f8f68f
Update to DMD@a9eedd1.
redstar Nov 3, 2013
f772efa
Merge branch 'master' into merge-2.064
redstar Nov 4, 2013
248d3f2
Merge branch 'master' into merge-2.064
redstar Nov 5, 2013
254579d
Correct issues found by AddressSanitizer.
redstar Nov 5, 2013
2cdc483
Merge remote-tracking branch 'origin/master' into merge-2.064
redstar Nov 5, 2013
b7d8096
Mark more differences between DMD and LDC.
redstar Nov 6, 2013
e029471
Merge remote-tracking branch 'origin/merge-2.064' into merge-2.064
redstar Nov 7, 2013
cef5b27
Revert "Declare more TypeClass instances as builtin."
redstar Nov 7, 2013
4d856b8
Update test suite to 2.064
redstar Nov 8, 2013
9ecd0da
Add new testsuite.
redstar Nov 8, 2013
7743f56
Fix for the tuple assignment error in test aliasthis.d
redstar Nov 10, 2013
015cf20
Fix cast problem with implicit constructors.
redstar Nov 12, 2013
ba8caa7
Merge branch 'master' into merge-2.064
redstar Nov 14, 2013
b22b7ae
Merge branch 'master' into merge-2.064
redstar Nov 14, 2013
3ef3e35
Wrong break target choosen for labeled break.
redstar Nov 20, 2013
18d53f8
Enable NRVO for static arrays.
redstar Nov 20, 2013
f662221
Update to LLVM 3.5
redstar Nov 25, 2013
711a04b
Added new LLVM 3.4 intrinsics
redstar Nov 25, 2013
87965cd
Merge branch 'master' into merge-2.064
redstar Nov 26, 2013
eb85713
Merge branch 'master' into merge-2.064
redstar Nov 27, 2013
e1464fe
CCP classes do not have a monitor.
redstar Nov 28, 2013
1a36f9b
Replace general error with more accurate error message (does not reso…
redstar Nov 28, 2013
5e6f696
Fix logic to decide which new/delete operator to use.
redstar Dec 2, 2013
08e3112
Fix issue with unions and initializers
redstar Dec 3, 2013
133ae1b
Fix a failure in runnable/funclit.d
redstar Dec 3, 2013
9c590a1
Merge branch 'master' into merge-2.064
redstar Dec 3, 2013
c0673fe
Merge branch 'master' into merge-2.064
redstar Dec 5, 2013
4faa8d8
Merge branch 'master' into merge-2.064
redstar Dec 5, 2013
2fa997e
Fix wrong #if
redstar Dec 6, 2013
d235e4c
Fix DMD Issue 10425 - Link error with templates.
AlexeyProkhin Dec 7, 2013
5a181d9
Update struct type info generation to reflect changes in dmd frontend
AlexeyProkhin Dec 7, 2013
5a10a23
Remove redundant FuncDeclaration::nestedVars.
AlexeyProkhin Dec 7, 2013
dcf0052
Implement cast to void
AlexeyProkhin Dec 8, 2013
9e724b3
Implement ClassReferenceExp::toElem
AlexeyProkhin Dec 8, 2013
89573a7
Fix DMD Issue 10451 - Array of pointers to opaque struct gives forwar…
AlexeyProkhin Dec 8, 2013
ffe26e4
Fix DMD Issue 11238 - Codegen error when this is a ref parameter to …
AlexeyProkhin Dec 8, 2013
669319b
Fix DMD Issue 8360 - Destruction of uninitialized temporary struct wi…
AlexeyProkhin Dec 8, 2013
bdc1f44
Merge remote-tracking branch 'origin/master' into merge-2.064
redstar Dec 8, 2013
d25d28f
Extend error message if -noruntime is used.
redstar Dec 8, 2013
bea0b59
Add -nogc switch.
redstar Dec 10, 2013
038855e
Deprecate -noruntime switch (which has now no function).
redstar Dec 12, 2013
2188ef9
Merge branch 'master' into merge-2.064
redstar Dec 16, 2013
dd3cc5f
Fix for issue #553.
redstar Dec 16, 2013
e7fdbaf
Fix generation of position-independent code.
redstar Dec 18, 2013
c231ae0
Merge remote-tracking branch 'origin/master' into merge-2.064
redstar Dec 19, 2013
68f8e38
Merge branch 'master' into merge-2.064.
dnadlinger Dec 26, 2013
bcbb133
Added test for GitHub #556.
dnadlinger Dec 26, 2013
6a17b38
Merge branch 'master' into merge-2.064.
dnadlinger Dec 26, 2013
3ec084d
Return undef instead of null on toConstElem failure.
dnadlinger Dec 26, 2013
33e5909
Merge pull request #560 from klickverbot/assoc-literal
dnadlinger Dec 27, 2013
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
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ include(GetLinuxDistribution)
#

# Version information
set(LDC_VERSION "0.12.0") # May be overridden by git hash tag
set(LDC_VERSION "0.13.0") # May be overridden by git hash tag
set(DMDFE_MAJOR_VERSION 2)
set(DMDFE_MINOR_VERSION 0)
set(DMDFE_PATCH_VERSION 63)
set(DMDFE_FIX_LEVEL 2) # Comment out if not used
set(DMDFE_PATCH_VERSION 64)
#set(DMDFE_FIX_LEVEL 2) # Comment out if not used

set(DMD_VERSION ${DMDFE_MAJOR_VERSION}.${DMDFE_MINOR_VERSION}${DMDFE_PATCH_VERSION})
if(DEFINED DMDFE_FIX_LEVEL)
Expand Down
76 changes: 58 additions & 18 deletions dmd2/access.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ int hasPackageAccess(Scope *sc, Dsymbol *s);
* Return PROT access for Dsymbol smember in this declaration.
*/

enum PROT AggregateDeclaration::getAccess(Dsymbol *smember)
PROT AggregateDeclaration::getAccess(Dsymbol *smember)
{
return PROTpublic;
}

enum PROT StructDeclaration::getAccess(Dsymbol *smember)
PROT StructDeclaration::getAccess(Dsymbol *smember)
{
enum PROT access_ret = PROTnone;
PROT access_ret = PROTnone;

#if LOG
printf("+StructDeclaration::getAccess(this = '%s', smember = '%s')\n",
Expand All @@ -62,9 +62,9 @@ enum PROT StructDeclaration::getAccess(Dsymbol *smember)
return access_ret;
}

enum PROT ClassDeclaration::getAccess(Dsymbol *smember)
PROT ClassDeclaration::getAccess(Dsymbol *smember)
{
enum PROT access_ret = PROTnone;
PROT access_ret = PROTnone;

#if LOG
printf("+ClassDeclaration::getAccess(this = '%s', smember = '%s')\n",
Expand All @@ -84,7 +84,7 @@ enum PROT ClassDeclaration::getAccess(Dsymbol *smember)
for (size_t i = 0; i < baseclasses->dim; i++)
{ BaseClass *b = (*baseclasses)[i];

enum PROT access = b->base->getAccess(smember);
PROT access = b->base->getAccess(smember);
switch (access)
{
case PROTnone:
Expand Down Expand Up @@ -152,7 +152,7 @@ static int accessCheckX(
{
for (size_t i = 0; i < cdthis->baseclasses->dim; i++)
{ BaseClass *b = (*cdthis->baseclasses)[i];
enum PROT access = b->base->getAccess(smember);
PROT access = b->base->getAccess(smember);
if (access >= PROTprotected ||
accessCheckX(smember, sfunc, b->base, cdscope)
)
Expand Down Expand Up @@ -192,7 +192,7 @@ void AggregateDeclaration::accessCheck(Loc loc, Scope *sc, Dsymbol *smember)

FuncDeclaration *f = sc->func;
AggregateDeclaration *cdscope = sc->getStructClassScope();
enum PROT access;
PROT access;

#if LOG
printf("AggregateDeclaration::accessCheck() for %s.%s in function %s() in scope %s\n",
Expand All @@ -214,7 +214,7 @@ void AggregateDeclaration::accessCheck(Loc loc, Scope *sc, Dsymbol *smember)
//assert(smember->parent->isBaseOf(this, NULL));

if (smemberparent == this)
{ enum PROT access2 = smember->prot();
{ PROT access2 = smember->prot();

result = access2 >= PROTpublic ||
hasPrivateAccess(f) ||
Expand Down Expand Up @@ -290,25 +290,60 @@ int hasPackageAccess(Scope *sc, Dsymbol *s)
printf("hasPackageAccess(s = '%s', sc = '%p')\n", s->toChars(), sc);
#endif

Package *pkg = NULL;
for (; s; s = s->parent)
{
if (s->isPackage() && !s->isModule())
if (Module *m = s->isModule())
{
DsymbolTable *dst = Package::resolve(m->md ? m->md->packages : NULL, NULL, NULL);
assert(dst);
Dsymbol *s2 = dst->lookup(m->ident);
assert(s2);
Package *p = s2->isPackage();
if (p && p->isPkgMod == PKGmodule)
{
assert(p->mod == m);
pkg = p;
break;
}
}
else if ((pkg = s->isPackage()) != NULL)
break;
}
#if LOG
if (s)
printf("\tthis is in package '%s'\n", s->toChars());
if (pkg)
printf("\tthis is in package '%s'\n", pkg->toChars());
#endif

if (s && s == sc->module->parent)
if (pkg)
{
if (pkg == sc->module->parent)
{
#if LOG
printf("\ts is in same package as sc\n");
printf("\ts is in same package as sc\n");
#endif
return 1;
return 1;
}
if (pkg->isPkgMod == PKGmodule && pkg->mod == sc->module)
{
#if LOG
printf("\ts is in same package.d module as sc\n");
#endif
return 1;
}
s = sc->module->parent;
for (; s; s = s->parent)
{
if (s == pkg)
{
#if LOG
printf("\ts is in ancestor package of sc\n");
#endif
return 1;
}
}
}


#if LOG
printf("\tno package access\n");
#endif
Expand Down Expand Up @@ -375,6 +410,9 @@ int AggregateDeclaration::hasPrivateAccess(Dsymbol *smember)

void accessCheck(Loc loc, Scope *sc, Expression *e, Declaration *d)
{
if (sc->flags & SCOPEnoaccesscheck)
return;

#if LOG
if (e)
{ printf("accessCheck(%s . %s)\n", e->toChars(), d->toChars());
Expand All @@ -395,7 +433,8 @@ void accessCheck(Loc loc, Scope *sc, Expression *e, Declaration *d)
}
}
else if (e->type->ty == Tclass)
{ // Do access check
{
// Do access check
ClassDeclaration *cd = (ClassDeclaration *)(((TypeClass *)e->type)->sym);
if (e->op == TOKsuper)
{
Expand All @@ -406,7 +445,8 @@ void accessCheck(Loc loc, Scope *sc, Expression *e, Declaration *d)
cd->accessCheck(loc, sc, d);
}
else if (e->type->ty == Tstruct)
{ // Do access check
{
// Do access check
StructDeclaration *cd = (StructDeclaration *)(((TypeStruct *)e->type)->sym);
cd->accessCheck(loc, sc, d);
}
Expand Down
Loading