Skip to content
This repository was archived by the owner on Jun 20, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 21 additions & 0 deletions gcc/d/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
2018-08-25 Eugene Wissner <belka@caraus.de>

* Make-lang.in (D_FRONTEND_OBJS): Add iasm.o, iasmgcc.o
(d.tags): Scan dmd/root/*.h
* d-builtins.cc (build_frontend_type): Update callers for new
front-end signatures.
(d_init_versions): Add D_ModuleInfo, D_Exceptions, D_TypeInfo.
* d-diagnostic.cc (vwarning): Increment gagged warnings error if
gagging turned on.
(vdeprecation): Likewise.
* d-frontend.cc (asmSemantic): Remove function.
* d-lang.cc (d_handle_option): Remove case for OPT_fproperty.
* d-target.cc (Target::_init): Remove int64Mangle and uint64Mangle.
* lang.opt (fproperty): Remove option.
* toir.cc (IRVisitor::visit(ExtAsmStatement)): Rename override to
GccAsmStatement.
* typeinfo.cc (TypeInfoVisitor::visit(TypeInfoClassDeclaration)): Use
int for collecting ClassFlags.
* (TypeInfoVisitor::visit(TypeInfoClassDeclaration)): Use int for
collecting StructFlags.

2018-07-23 Eugene Wissner <belka@caraus.de>

* d-lang.cc (d_handle_option): Change function argument to HOST_WIDE_INT.
Expand Down
4 changes: 3 additions & 1 deletion gcc/d/Make-lang.in
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ D_FRONTEND_OBJS = \
d/gluelayer.o \
d/hash.o \
d/hdrgen.o \
d/iasm.o \
d/iasmgcc.o \
d/id.o \
d/identifier.o \
d/impcnvtab.o \
Expand Down Expand Up @@ -237,7 +239,7 @@ d.srcextra:

d.tags: force
cd $(srcdir)/d; \
etags -o TAGS.sub *.c *.cc *.h dmd/*.h; \
etags -o TAGS.sub *.c *.cc *.h dmd/*.h dmd/root/*.h; \
etags --include TAGS.sub --include ../TAGS.sub

d.man: doc/gdc.1
Expand Down
13 changes: 12 additions & 1 deletion gcc/d/d-builtins.cc
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ build_frontend_type (tree type)
return NULL;
}

args->push (Parameter::create (sc, targ, NULL, NULL));
args->push (Parameter::create (sc, targ, NULL, NULL, NULL));
}

/* GCC generic and placeholder builtins are marked as variadic, yet
Expand Down Expand Up @@ -430,16 +430,27 @@ d_init_versions (void)
VersionCondition::addPredefinedGlobalIdent ("D_Coverage");
if (flag_pic)
VersionCondition::addPredefinedGlobalIdent ("D_PIC");

if (global.params.doDocComments)
VersionCondition::addPredefinedGlobalIdent ("D_Ddoc");

if (global.params.useUnitTests)
VersionCondition::addPredefinedGlobalIdent ("unittest");

if (global.params.useAssert == CHECKENABLEon)
VersionCondition::addPredefinedGlobalIdent ("assert");

if (global.params.useArrayBounds == CHECKENABLEoff)
VersionCondition::addPredefinedGlobalIdent ("D_NoBoundsChecks");

if (global.params.betterC)
VersionCondition::addPredefinedGlobalIdent ("D_BetterC");
else
{
VersionCondition::addPredefinedGlobalIdent ("D_ModuleInfo");
VersionCondition::addPredefinedGlobalIdent ("D_Exceptions");
VersionCondition::addPredefinedGlobalIdent ("D_TypeInfo");
}

VersionCondition::addPredefinedGlobalIdent ("all");

Expand Down
8 changes: 6 additions & 2 deletions gcc/d/d-diagnostic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,16 @@ verrorSupplemental (const Loc& loc, const char *format, va_list ap)
void ATTRIBUTE_GCC_DIAG(2,0)
vwarning (const Loc& loc, const char *format, va_list ap)
{
if (global.params.warnings && !global.gag)
if (!global.gag && global.params.warnings)
{
/* Warnings don't count if gagged. */
/* Warnings don't count if not treated as errors. */
if (global.params.warnings == 1)
global.warnings++;

d_diagnostic_report_diagnostic (loc, 0, format, ap, DK_WARNING, false);
}
else if (global.gag)
global.gaggedWarnings++;
}

/* Print supplementary message about the last warning with explicit location
Expand Down Expand Up @@ -241,6 +243,8 @@ vdeprecation (const Loc& loc, const char *format, va_list ap,
DK_WARNING, false);
free (xformat);
}
else if (global.gag)
global.gaggedWarnings++;
}

/* Print supplementary message about the last deprecation with explicit
Expand Down
9 changes: 0 additions & 9 deletions gcc/d/d-frontend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -368,15 +368,6 @@ CTFloat::hash (real_t r)

/* Implements backend-specific interfaces used by the frontend. */

/* Semantically analyze AsmStatement where SC is the scope. */

Statement *
asmSemantic (AsmStatement *s, Scope *sc)
{
sc->func->hasReturnExp |= 8;
return s;
}

/* Determine if function FD is a builtin one that we can evaluate in CTFE. */

BUILTIN
Expand Down
4 changes: 0 additions & 4 deletions gcc/d/d-lang.cc
Original file line number Diff line number Diff line change
Expand Up @@ -516,10 +516,6 @@ d_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value,
global.params.useIn = value;
break;

case OPT_fproperty:
global.params.enforcePropertySyntax = value;
break;

case OPT_frelease:
global.params.release = value;
break;
Expand Down
2 changes: 0 additions & 2 deletions gcc/d/d-target.cc
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ Target::_init (void)
/* Set-up target C++ ABI. */
Target::reverseCppOverloads = false;
Target::cppExceptions = true;
Target::int64Mangle = 'l';
Target::uint64Mangle = 'm';
Target::twoDtorInVtable = true;

/* Initialize all compile-time properties for floating point types.
Expand Down
16 changes: 5 additions & 11 deletions gcc/d/dmd/access.d
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ private Prot getAccess(AggregateDeclaration ad, Dsymbol smember)
}
if (ClassDeclaration cd = ad.isClassDeclaration())
{
for (size_t i = 0; i < cd.baseclasses.dim; i++)
foreach (b; *cd.baseclasses)
{
BaseClass* b = (*cd.baseclasses)[i];
Prot access = getAccess(b.sym, smember);
final switch (access.kind)
{
Expand Down Expand Up @@ -101,10 +100,9 @@ private bool isAccessible(Dsymbol smember, Dsymbol sfunc, AggregateDeclaration d
return true;
if (ClassDeclaration cdthis = dthis.isClassDeclaration())
{
for (size_t i = 0; i < cdthis.baseclasses.dim; i++)
foreach (b; *cdthis.baseclasses)
{
BaseClass* b = (*cdthis.baseclasses)[i];
Prot access = getAccess(b.sym, smember);
const Prot access = getAccess(b.sym, smember);
if (access.kind >= Prot.Kind.protected_ || isAccessible(smember, sfunc, b.sym, cdscope))
{
return true;
Expand All @@ -118,12 +116,9 @@ private bool isAccessible(Dsymbol smember, Dsymbol sfunc, AggregateDeclaration d
{
if (ClassDeclaration cdthis = dthis.isClassDeclaration())
{
for (size_t i = 0; i < cdthis.baseclasses.dim; i++)
{
BaseClass* b = (*cdthis.baseclasses)[i];
foreach (b; *cdthis.baseclasses)
if (isAccessible(smember, sfunc, b.sym, cdscope))
return true;
}
}
}
}
Expand Down Expand Up @@ -423,8 +418,7 @@ extern (C++) bool checkAccess(Loc loc, Scope* sc, Expression e, Declaration d)
ClassDeclaration cd = (cast(TypeClass)e.type).sym;
if (e.op == TOK.super_)
{
ClassDeclaration cd2 = sc.func.toParent().isClassDeclaration();
if (cd2)
if (ClassDeclaration cd2 = sc.func.toParent().isClassDeclaration())
cd = cd2;
}
return checkAccess(cd, loc, sc, d);
Expand Down
3 changes: 2 additions & 1 deletion gcc/d/dmd/aggregate.d
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import dmd.mtype;
import dmd.semantic2;
import dmd.semantic3;
import dmd.tokens;
import dmd.typesem;
import dmd.visitor;

enum Sizeok : int
Expand Down Expand Up @@ -117,7 +118,7 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol

Expression getRTInfo; // pointer to GC info generated by object.RTInfo(this)

final extern (D) this(Loc loc, Identifier id)
final extern (D) this(const ref Loc loc, Identifier id)
{
super(id);
this.loc = loc;
Expand Down
18 changes: 9 additions & 9 deletions gcc/d/dmd/aggregate.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#pragma once
#endif /* __DMC__ */

#include "root.h"
#include "root/root.h"

#include "dsymbol.h"
#include "declaration.h"
Expand Down Expand Up @@ -79,11 +79,11 @@ struct ClassKind
{
enum Type
{
/// the class is a d(efault) class
/// the aggregate is a d(efault) struct/class/interface
d,
/// the class is a C++ interface
/// the aggregate is a C++ struct/class/interface
cpp,
/// the class is an Objective-C class/interface
/// the aggregate is an Objective-C class/interface
objc
};
};
Expand All @@ -101,7 +101,7 @@ class AggregateDeclaration : public ScopeDsymbol
Dsymbol *deferred; // any deferred semantic2() or semantic3() symbol
bool isdeprecated; // true if deprecated

ClassKind classKind; // specifies the linkage type
ClassKind::Type classKind; // specifies the linkage type

/* !=NULL if is nested
* pointing to the dsymbol that directly enclosing it.
Expand Down Expand Up @@ -168,9 +168,9 @@ class AggregateDeclaration : public ScopeDsymbol

struct StructFlags
{
typedef unsigned Type;
enum Enum
enum Type
{
none = 0x0,
hasPointers = 0x1, // NB: should use noPointers as in ClassFlags
};
};
Expand Down Expand Up @@ -248,9 +248,9 @@ struct BaseClass

struct ClassFlags
{
typedef unsigned Type;
enum Enum
enum Type
{
none = 0x0,
isCOMclass = 0x1,
noPointers = 0x2,
hasOffTi = 0x4,
Expand Down
2 changes: 1 addition & 1 deletion gcc/d/dmd/aliasthis.d
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ extern (C++) final class AliasThis : Dsymbol
{
Identifier ident;

extern (D) this(Loc loc, Identifier ident)
extern (D) this(const ref Loc loc, Identifier ident)
{
super(null); // it's anonymous (no identifier)
this.loc = loc;
Expand Down
13 changes: 5 additions & 8 deletions gcc/d/dmd/arrayop.d
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,11 @@ extern (C++) bool isArrayOpValid(Expression e)
BinExp be = cast(BinExp)e;
return be.e1.op == TOK.slice && isArrayOpValid(be.e2);
}
if (e.op == TOK.call)
{
return false; // TODO: Decide if [] is required after arrayop calls.
}
else
{
return false;
}
// if (e.op == TOK.call)
// {
// TODO: Decide if [] is required after arrayop calls.
// }
return false;
}
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion gcc/d/dmd/arraytypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#endif /* __DMC__ */


#include "root.h"
#include "root/root.h"

typedef Array<class TemplateParameter *> TemplateParameters;

Expand Down
12 changes: 7 additions & 5 deletions gcc/d/dmd/attrib.d
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import dmd.dscope;
import dmd.dsymbol;
import dmd.dsymbolsem;
import dmd.expression;
import dmd.expressionsem;
import dmd.func;
import dmd.globals;
import dmd.hdrgen;
Expand Down Expand Up @@ -595,7 +596,7 @@ extern (C++) final class ProtDeclaration : AttribDeclaration
return buf.extractString();
}

override final inout(ProtDeclaration) isProtDeclaration() inout
override inout(ProtDeclaration) isProtDeclaration() inout
{
return this;
}
Expand Down Expand Up @@ -751,7 +752,7 @@ extern (C++) final class AnonDeclaration : AttribDeclaration
return (isunion ? "anonymous union" : "anonymous struct");
}

override final inout(AnonDeclaration) isAnonDeclaration() inout
override inout(AnonDeclaration) isAnonDeclaration() inout
{
return this;
}
Expand Down Expand Up @@ -956,7 +957,7 @@ extern (C++) final class StaticIfDeclaration : ConditionalDeclaration
onStack = true;
scope(exit) onStack = false;

if (condition.inc == 0)
if (sc && condition.inc == 0)
{
assert(scopesym); // addMember is already done
assert(_scope); // setScope is already done
Expand Down Expand Up @@ -1060,7 +1061,7 @@ extern (C++) final class StaticForeachDeclaration : AttribDeclaration
Dsymbol.arraySyntaxCopy(decl));
}

override final bool oneMember(Dsymbol* ps, Identifier ident)
override bool oneMember(Dsymbol* ps, Identifier ident)
{
// Required to support IFTI on a template that contains a
// `static foreach` declaration. `super.oneMember` calls
Expand Down Expand Up @@ -1125,7 +1126,7 @@ extern (C++) final class StaticForeachDeclaration : AttribDeclaration
this.scopesym = sds;
}

override final void addComment(const(char)* comment)
override void addComment(const(char)* comment)
{
// do nothing
// change this to give semantics to documentation comments on static foreach declarations
Expand Down Expand Up @@ -1263,6 +1264,7 @@ extern (C++) final class CompileDeclaration : AttribDeclaration

/***********************************************************
* User defined attributes look like:
* @foo(args, ...)
* @(args, ...)
*/
extern (C++) final class UserAttributeDeclaration : AttribDeclaration
Expand Down
Loading