From 326aedd0e4290456d47e5cf6f6736a41bb485d83 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Thu, 3 Jan 2013 21:31:39 +0100 Subject: [PATCH] Align AlignDeclaration constructor signature to upstream version. If there still are error messages benefiting from the added location information, the change should be upstreamed, as usual. --- dmd2/attrib.c | 7 ++----- dmd2/attrib.h | 2 +- dmd2/parse.c | 5 +---- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/dmd2/attrib.c b/dmd2/attrib.c index a21213f9..39d2e7ae 100644 --- a/dmd2/attrib.c +++ b/dmd2/attrib.c @@ -722,10 +722,9 @@ void ProtDeclaration::toCBuffer(OutBuffer *buf, HdrGenState *hgs) /********************************* AlignDeclaration ****************************/ -AlignDeclaration::AlignDeclaration(Loc loc, unsigned sa, Dsymbols *decl) +AlignDeclaration::AlignDeclaration(unsigned sa, Dsymbols *decl) : AttribDeclaration(decl) { - this->loc = loc; salign = sa; } @@ -734,7 +733,7 @@ Dsymbol *AlignDeclaration::syntaxCopy(Dsymbol *s) AlignDeclaration *ad; assert(!s); - ad = new AlignDeclaration(loc, salign, Dsymbol::arraySyntaxCopy(decl)); + ad = new AlignDeclaration(salign, Dsymbol::arraySyntaxCopy(decl)); return ad; } @@ -754,8 +753,6 @@ void AlignDeclaration::semantic(Scope *sc) { semanticNewSc(sc, sc->stc, sc->linkage, sc->protection, sc->explicitProtection, salign); } - else - assert(0 && "what kind of align use triggers this?"); } diff --git a/dmd2/attrib.h b/dmd2/attrib.h index aa8d0447..2f929fee 100644 --- a/dmd2/attrib.h +++ b/dmd2/attrib.h @@ -112,7 +112,7 @@ struct AlignDeclaration : AttribDeclaration { unsigned salign; - AlignDeclaration(Loc loc, unsigned sa, Dsymbols *decl); + AlignDeclaration(unsigned sa, Dsymbols *decl); Dsymbol *syntaxCopy(Dsymbol *s); void setScope(Scope *sc); void semantic(Scope *sc); diff --git a/dmd2/parse.c b/dmd2/parse.c index 8ad48ce7..113d2f78 100644 --- a/dmd2/parse.c +++ b/dmd2/parse.c @@ -507,9 +507,6 @@ Dsymbols *Parser::parseDeclDefs(int once) case TOKalign: { unsigned n; - // LDC better align code locations - Loc alignloc = loc; - s = NULL; nextToken(); if (token.value == TOKlparen) @@ -532,7 +529,7 @@ Dsymbols *Parser::parseDeclDefs(int once) n = global.structalign; // default a = parseBlock(); - s = new AlignDeclaration(alignloc, n, a); + s = new AlignDeclaration(n, a); break; }