From 9709375650b1cdc316fe187dd828239cc297c609 Mon Sep 17 00:00:00 2001 From: Dennis Date: Wed, 29 Jan 2025 00:00:08 +0100 Subject: [PATCH] Replace C pointer syntax with D (#20799) --- compiler/src/dmd/access.d | 6 +- compiler/src/dmd/astbase.d | 4 +- compiler/src/dmd/compiler.d | 4 +- compiler/src/dmd/cond.d | 2 +- compiler/src/dmd/console.d | 2 +- compiler/src/dmd/cxxfrontend.d | 8 +- compiler/src/dmd/dcast.d | 2 +- compiler/src/dmd/doc.d | 2 +- compiler/src/dmd/dsymbol.d | 4 +- compiler/src/dmd/dsymbolsem.d | 2 +- compiler/src/dmd/e2ir.d | 680 +++++++++++++++---------------- compiler/src/dmd/expressionsem.d | 10 +- compiler/src/dmd/func.d | 2 +- compiler/src/dmd/glue.d | 78 ++-- compiler/src/dmd/iasm.d | 4 +- compiler/src/dmd/iasmdmd.d | 40 +- compiler/src/dmd/iasmgcc.d | 16 +- compiler/src/dmd/intrange.d | 2 +- compiler/src/dmd/mtype.d | 2 +- compiler/src/dmd/s2ir.d | 250 ++++++------ compiler/src/dmd/statementsem.d | 2 +- compiler/src/dmd/templatesem.d | 2 +- compiler/src/dmd/tocsym.d | 42 +- compiler/src/dmd/tocvdebug.d | 46 +-- compiler/src/dmd/todt.d | 6 +- compiler/src/dmd/toir.d | 76 ++-- compiler/src/dmd/toobj.d | 50 +-- compiler/src/dmd/typesem.d | 6 +- 28 files changed, 675 insertions(+), 675 deletions(-) diff --git a/compiler/src/dmd/access.d b/compiler/src/dmd/access.d index e778ed92cae8..b3e98f8f18d4 100644 --- a/compiler/src/dmd/access.d +++ b/compiler/src/dmd/access.d @@ -142,7 +142,7 @@ private bool hasPackageAccess(Module mod, Dsymbol s) /**************************************** * Determine if scope sc has protected level access to cd. */ -private bool hasProtectedAccess(Scope *sc, Dsymbol s) +private bool hasProtectedAccess(Scope* sc, Dsymbol s) { if (auto cd = s.isClassMember()) // also includes interfaces { @@ -273,7 +273,7 @@ bool symbolIsVisible(Dsymbol origin, Dsymbol s) * s = symbol to check for visibility * Returns: true if s is visible by origin */ -bool symbolIsVisible(Scope *sc, Dsymbol s) +bool symbolIsVisible(Scope* sc, Dsymbol s) { s = mostVisibleOverload(s); return checkSymbolAccess(sc, s); @@ -288,7 +288,7 @@ bool symbolIsVisible(Scope *sc, Dsymbol s) * s = symbol to check for visibility * Returns: true if s is visible by origin */ -bool checkSymbolAccess(Scope *sc, Dsymbol s) +bool checkSymbolAccess(Scope* sc, Dsymbol s) { final switch (s.visible().kind) { diff --git a/compiler/src/dmd/astbase.d b/compiler/src/dmd/astbase.d index 281e8bc24cf7..3b9beeb1a08e 100644 --- a/compiler/src/dmd/astbase.d +++ b/compiler/src/dmd/astbase.d @@ -401,7 +401,7 @@ struct ASTBase { Dsymbols* decl; - final extern (D) this(Dsymbols *decl) + final extern (D) this(Dsymbols* decl) { this.decl = decl; } @@ -1672,7 +1672,7 @@ struct ASTBase { TypeQualified tqual; - extern (D) this(const ref Loc loc, Identifier ident, TypeQualified tqual, Objects *tiargs) + extern (D) this(const ref Loc loc, Identifier ident, TypeQualified tqual, Objects* tiargs) { super(loc, tqual.idents.length ? cast(Identifier)tqual.idents[tqual.idents.length - 1] : (cast(TypeIdentifier)tqual).ident, diff --git a/compiler/src/dmd/compiler.d b/compiler/src/dmd/compiler.d index a9031f6bc74f..9650af66e498 100644 --- a/compiler/src/dmd/compiler.d +++ b/compiler/src/dmd/compiler.d @@ -164,14 +164,14 @@ extern (C++) struct Compiler * semantic analysis of a statement when importing DMD as a library */ __gshared OnStatementSemanticStart onStatementSemanticStart - = function void(Statement s, Scope *sc) {}; + = function void(Statement s, Scope* sc) {}; /** * Used to insert functionality after the end of the * semantic analysis of a statement when importing DMD as a library */ __gshared OnStatementSemanticDone onStatementSemanticDone - = function void(Statement s, Scope *sc) {}; + = function void(Statement s, Scope* sc) {}; } } diff --git a/compiler/src/dmd/cond.d b/compiler/src/dmd/cond.d index f66f14af5b91..9374c48d5585 100644 --- a/compiler/src/dmd/cond.d +++ b/compiler/src/dmd/cond.d @@ -166,7 +166,7 @@ extern (C++) final class StaticForeach : RootObject return; } - Expressions *es; + Expressions* es; if (auto ale = aggr.isArrayLiteralExp()) { // Directly use the elements of the array for the TupleExp creation diff --git a/compiler/src/dmd/console.d b/compiler/src/dmd/console.d index 29fce81c8783..2d5b781a4b04 100644 --- a/compiler/src/dmd/console.d +++ b/compiler/src/dmd/console.d @@ -90,7 +90,7 @@ private final class WindowsConsole : Console HANDLE handle; FILE* _fp; - static HANDLE getStdHandle(FILE *fp) + static HANDLE getStdHandle(FILE* fp) { /* Determine if stream fp is a console */ diff --git a/compiler/src/dmd/cxxfrontend.d b/compiler/src/dmd/cxxfrontend.d index b74b11b67341..3807c1dfa995 100644 --- a/compiler/src/dmd/cxxfrontend.d +++ b/compiler/src/dmd/cxxfrontend.d @@ -338,13 +338,13 @@ const(char)* parametersTypeToChars(ParameterList pl) /*********************************************************** * iasm.d */ -Statement asmSemantic(AsmStatement s, Scope *sc) +Statement asmSemantic(AsmStatement s, Scope* sc) { import dmd.iasm; return dmd.iasm.asmSemantic(s, sc); } -void asmSemantic(CAsmDeclaration d, Scope *sc) +void asmSemantic(CAsmDeclaration d, Scope* sc) { import dmd.iasm; return dmd.iasm.asmSemantic(d, sc); @@ -353,13 +353,13 @@ void asmSemantic(CAsmDeclaration d, Scope *sc) /*********************************************************** * iasmgcc.d */ -Statement gccAsmSemantic(GccAsmStatement s, Scope *sc) +Statement gccAsmSemantic(GccAsmStatement s, Scope* sc) { import dmd.iasmgcc; return dmd.iasmgcc.gccAsmSemantic(s, sc); } -void gccAsmSemantic(CAsmDeclaration d, Scope *sc) +void gccAsmSemantic(CAsmDeclaration d, Scope* sc) { import dmd.iasmgcc; return dmd.iasmgcc.gccAsmSemantic(d, sc); diff --git a/compiler/src/dmd/dcast.d b/compiler/src/dmd/dcast.d index b36579642c51..bb85318c44ee 100644 --- a/compiler/src/dmd/dcast.d +++ b/compiler/src/dmd/dcast.d @@ -3920,7 +3920,7 @@ LmodCompare: return convert(e1, t2); /// Covers array operations for user-defined types - Type checkArrayOpType(Expression e1, Expression e2, EXP op, Scope *sc) + Type checkArrayOpType(Expression e1, Expression e2, EXP op, Scope* sc) { // scalar op scalar - we shouldn't be here if (e1.type.ty != Tarray && e1.type.ty != Tsarray && e2.type.ty != Tarray && e2.type.ty != Tsarray) diff --git a/compiler/src/dmd/doc.d b/compiler/src/dmd/doc.d index 58f581253969..a9a0ff69ccb9 100644 --- a/compiler/src/dmd/doc.d +++ b/compiler/src/dmd/doc.d @@ -2621,7 +2621,7 @@ Parameter isFunctionParameter(Dsymbols* a, const(char)[] p) @safe /**************************************************** */ -Parameter isEponymousFunctionParameter(Dsymbols *a, const(char)[] p) @safe +Parameter isEponymousFunctionParameter(Dsymbols* a, const(char)[] p) @safe { foreach (Dsymbol dsym; *a) { diff --git a/compiler/src/dmd/dsymbol.d b/compiler/src/dmd/dsymbol.d index e3feefed76ee..c9ab4fe37dbf 100644 --- a/compiler/src/dmd/dsymbol.d +++ b/compiler/src/dmd/dsymbol.d @@ -55,7 +55,7 @@ import dmd.visitor; import dmd.common.outbuffer; /*************************************** - * Calls dg(Dsymbol *sym) for each Dsymbol. + * Calls dg(Dsymbol* sym) for each Dsymbol. * If dg returns !=0, stops and returns that value else returns 0. * Params: * symbols = Dsymbols @@ -84,7 +84,7 @@ int foreachDsymbol(Dsymbols* symbols, scope int delegate(Dsymbol) dg) } /*************************************** - * Calls dg(Dsymbol *sym) for each Dsymbol. + * Calls dg(Dsymbol* sym) for each Dsymbol. * Params: * symbols = Dsymbols * dg = delegate to call for each Dsymbol diff --git a/compiler/src/dmd/dsymbolsem.d b/compiler/src/dmd/dsymbolsem.d index c7fb26a9da1a..7b633675c858 100644 --- a/compiler/src/dmd/dsymbolsem.d +++ b/compiler/src/dmd/dsymbolsem.d @@ -424,7 +424,7 @@ private bool checkDeprecatedAliasThis(AliasThis at, const ref Loc loc, Scope* sc } // Save the scope and defer semantic analysis on the Dsymbol. -void deferDsymbolSemantic(Scope* sc, Dsymbol s, Scope *scx) +void deferDsymbolSemantic(Scope* sc, Dsymbol s, Scope* scx) { s._scope = scx ? scx : sc.copy(); s._scope.setNoFree(); diff --git a/compiler/src/dmd/e2ir.d b/compiler/src/dmd/e2ir.d index 8df1d47b457c..020b359c77ae 100644 --- a/compiler/src/dmd/e2ir.d +++ b/compiler/src/dmd/e2ir.d @@ -164,7 +164,7 @@ elem* elAssign(elem* e1, elem* e2, Type t, type* tx) //printf("e1:\n"); elem_print(e1); //printf("e2:\n"); elem_print(e2); //if (t) printf("t: %s\n", t.toChars()); - elem *e = el_bin(OPeq, e2.Ety, e1, e2); + elem* e = el_bin(OPeq, e2.Ety, e1, e2); switch (tybasic(e2.Ety)) { case TYarray: @@ -212,7 +212,7 @@ bool type_zeroCopy(type* t) * Symbol */ -Symbol *toStringSymbol(const(char)* str, size_t len, size_t sz) +Symbol* toStringSymbol(const(char)* str, size_t len, size_t sz) { //printf("toStringSymbol() %p\n", stringTab); auto sv = stringTab.update(str, len * sz); @@ -295,9 +295,9 @@ Symbol *toStringSymbol(const(char)* str, size_t len, size_t sz) * Turn StringExp into Symbol. */ -Symbol *toStringSymbol(StringExp se) +Symbol* toStringSymbol(StringExp se) { - Symbol *si; + Symbol* si; const n = cast(int)se.numberOfCodeUnits(); if (se.sz == 1) { @@ -322,7 +322,7 @@ Symbol *toStringSymbol(StringExp se) * loc = to get file/line from */ -void toTraceGC(ref IRState irs, elem *e, const ref Loc loc) +void toTraceGC(ref IRState irs, elem* e, const ref Loc loc) { static immutable RTLSYM[2][25] map = [ @@ -358,7 +358,7 @@ void toTraceGC(ref IRState irs, elem *e, const ref Loc loc) return; assert(e.Eoper == OPcall); - elem *e1 = e.E1; + elem* e1 = e.E1; assert(e1.Eoper == OPvar); auto s = e1.Vsym; @@ -390,7 +390,7 @@ void toTraceGC(ref IRState irs, elem *e, const ref Loc loc) * generated elem tree */ -elem *toElemDtor(Expression e, ref IRState irs) +elem* toElemDtor(Expression e, ref IRState irs) { //printf("Expression.toElemDtor() %s\n", e.toChars()); @@ -430,7 +430,7 @@ elem *toElemDtor(Expression e, ref IRState irs) * the equivalent of &e */ -elem *addressElem(elem *e, Type t, bool alwaysCopy = false) +elem* addressElem(elem* e, Type t, bool alwaysCopy = false) { //printf("addressElem()\n"); @@ -439,7 +439,7 @@ elem *addressElem(elem *e, Type t, bool alwaysCopy = false) // For conditional operator, both branches need conversion. if ((*pe).Eoper == OPcond) { - elem *ec = (*pe).E2; + elem* ec = (*pe).E2; ec.E1 = addressElem(ec.E1, t, alwaysCopy); ec.E2 = addressElem(ec.E2, t, alwaysCopy); @@ -453,8 +453,8 @@ elem *addressElem(elem *e, Type t, bool alwaysCopy = false) if (alwaysCopy || ((*pe).Eoper != OPvar && (*pe).Eoper != OPind)) { - elem *e2 = *pe; - type *tx; + elem* e2 = *pe; + type* tx; // Convert to ((tmp=e2),tmp) TY ty; @@ -467,9 +467,9 @@ elem *addressElem(elem *e, Type t, bool alwaysCopy = false) } else tx = type_fake(e2.Ety); - Symbol *stmp = symbol_genauto(tx); + Symbol* stmp = symbol_genauto(tx); - elem *eeq = elAssign(el_var(stmp), e2, t, tx); + elem* eeq = elAssign(el_var(stmp), e2, t, tx); *pe = el_bin(OPcomma,e2.Ety,eeq,el_var(stmp)); } tym_t typ = TYnptr; @@ -581,7 +581,7 @@ elem* toElem(Expression e, ref IRState irs) elem* visitSymbol(SymbolExp se) // VarExp and SymOffExp { - elem *e; + elem* e; Type tb = (se.op == EXP.symbolOffset) ? se.var.type.toBasetype() : se.type.toBasetype(); long offset = (se.op == EXP.symbolOffset) ? cast(long)(cast(SymOffExp)se).offset : 0; VarDeclaration v = se.var.isVarDeclaration(); @@ -616,7 +616,7 @@ elem* toElem(Expression e, ref IRState irs) } } - Symbol *s = toSymbol(se.var); + Symbol* s = toSymbol(se.var); // VarExp generated for `__traits(initSymbol, Aggregate)`? if (auto symDec = se.var.isSymbolDeclaration()) @@ -651,7 +651,7 @@ elem* toElem(Expression e, ref IRState irs) if (fd && fd != irs.getFunc()) { // 'var' is a variable in an enclosing function. - elem *ethis = getEthis(se.loc, irs, fd, null, se.originalScope); + elem* ethis = getEthis(se.loc, irs, fd, null, se.originalScope); ethis = el_una(OPaddr, TYnptr, ethis); /* https://issues.dlang.org/show_bug.cgi?id=9383 @@ -694,7 +694,7 @@ elem* toElem(Expression e, ref IRState irs) */ if (fd.vthis) { - Symbol *vs = toSymbol(fd.vthis); + Symbol* vs = toSymbol(fd.vthis); //printf("vs = %s, offset = x%x, %p\n", vs.Sident.ptr, cast(int)vs.Soffset, vs); soffset -= vs.Soffset; } @@ -843,11 +843,11 @@ elem* toElem(Expression e, ref IRState irs) irs.deferToObj.push(fld); } - Symbol *s = toSymbol(fld); - elem *e = el_ptr(s); + Symbol* s = toSymbol(fld); + elem* e = el_ptr(s); if (fld.isNested()) { - elem *ethis; + elem* ethis; // Delegate literals report isNested() even if they are in global scope, // so we need to check that the parent is a function. if (!fld.toParent2().isFuncDeclaration()) @@ -913,7 +913,7 @@ elem* toElem(Expression e, ref IRState irs) //printf("ThisExp.toElem()\n"); assert(irs.sthis); - elem *ethis; + elem* ethis; if (te.var) { assert(te.var.parent); @@ -942,7 +942,7 @@ elem* toElem(Expression e, ref IRState irs) elem* visitInteger(IntegerExp ie) { - elem *e = el_long(totym(ie.type), ie.getInteger()); + elem* e = el_long(totym(ie.type), ie.getInteger()); elem_setLoc(e,ie.loc); return e; } @@ -953,7 +953,7 @@ elem* toElem(Expression e, ref IRState irs) elem* visitReal(RealExp re) { //printf("RealExp.toElem(%p) %s\n", re, re.toChars()); - elem *e = el_long(TYint, 0); + elem* e = el_long(TYint, 0); tym_t ty = totym(re.type.toBasetype()); switch (tybasic(ty)) { @@ -989,7 +989,7 @@ elem* toElem(Expression e, ref IRState irs) //printf("ComplexExp.toElem(%p) %s\n", ce, ce.toChars()); - elem *e = el_long(TYint, 0); + elem* e = el_long(TYint, 0); real_t re = ce.value.re; real_t im = ce.value.im; @@ -1063,16 +1063,16 @@ elem* toElem(Expression e, ref IRState irs) { //printf("StringExp.toElem() %s, type = %s\n", se.toChars(), se.type.toChars()); - elem *e; + elem* e; Type tb = se.type.toBasetype(); if (tb.ty == Tarray) { - Symbol *si = toStringSymbol(se); + Symbol* si = toStringSymbol(se); e = el_pair(TYdarray, el_long(TYsize_t, se.numberOfCodeUnits()), el_ptr(si)); } else if (tb.ty == Tsarray) { - Symbol *si = toStringSymbol(se); + Symbol* si = toStringSymbol(se); e = el_var(si); e.Ejty = e.Ety = TYstruct; e.ET = si.Stype; @@ -1105,7 +1105,7 @@ elem* toElem(Expression e, ref IRState irs) //printf("\ttype = %s\n", t.toChars()); //if (ne.member) //printf("\tmember = %s\n", ne.member.toChars()); - elem *e; + elem* e; Type ectype; if (t.ty == Tclass) { @@ -1120,11 +1120,11 @@ elem* toElem(Expression e, ref IRState irs) * 3) ez: call constructor */ - elem *ex = null; - elem *ey = null; - elem *ew = null; - elem *ezprefix = null; - elem *ez = null; + elem* ex = null; + elem* ey = null; + elem* ew = null; + elem* ezprefix = null; + elem* ez = null; if (ne.onstack) { @@ -1132,16 +1132,16 @@ elem* toElem(Expression e, ref IRState irs) * and call it stmp. * Set ex to be the &stmp. */ - .type *tc = type_struct_class(tclass.sym.toChars(), + .type* tc = type_struct_class(tclass.sym.toChars(), tclass.sym.alignsize, tclass.sym.structsize, null, null, false, false, true, false); tc.Tcount--; - Symbol *stmp = symbol_genauto(tc); + Symbol* stmp = symbol_genauto(tc); ex = el_ptr(stmp); - Symbol *si = toInitializer(tclass.sym); - elem *ei = el_var(si); + Symbol* si = toInitializer(tclass.sym); + elem* ei = el_var(si); if (cd.isNested()) { @@ -1198,7 +1198,7 @@ elem* toElem(Expression e, ref IRState irs) int i = cdp.isClassDeclaration().isBaseOf(cdthis, &offset); assert(i); } - elem *ethis = toElem(ne.thisexp, irs); + elem* ethis = toElem(ne.thisexp, irs); if (offset) ethis = el_bin(OPadd, TYnptr, ethis, el_long(TYsize_t, offset)); @@ -1259,11 +1259,11 @@ elem* toElem(Expression e, ref IRState irs) * 3) ez: call constructor */ - elem *ex = null; - elem *ey = null; - elem *ew = null; - elem *ezprefix = null; - elem *ez = null; + elem* ex = null; + elem* ey = null; + elem* ew = null; + elem* ezprefix = null; + elem* ez = null; // Call _d_newitemT() if (auto lowering = ne.lowering) @@ -1273,7 +1273,7 @@ elem* toElem(Expression e, ref IRState irs) ectype = null; - elem *ev = el_same(ex); + elem* ev = el_same(ex); if (ne.argprefix) ezprefix = toElem(ne.argprefix, irs); @@ -1320,7 +1320,7 @@ elem* toElem(Expression e, ref IRState irs) } else if (auto tda = t.isTypeDArray()) { - elem *ezprefix = ne.argprefix ? toElem(ne.argprefix, irs) : null; + elem* ezprefix = ne.argprefix ? toElem(ne.argprefix, irs) : null; assert(ne.arguments && ne.arguments.length >= 1); assert(ne.lowering); @@ -1329,7 +1329,7 @@ elem* toElem(Expression e, ref IRState irs) } else if (auto tp = t.isTypePointer()) { - elem *ezprefix = ne.argprefix ? toElem(ne.argprefix, irs) : null; + elem* ezprefix = ne.argprefix ? toElem(ne.argprefix, irs) : null; // call _d_newitemT() e = toElem(ne.lowering, irs); @@ -1338,13 +1338,13 @@ elem* toElem(Expression e, ref IRState irs) { /* ezprefix, ts=_d_newitemT(ti), *ts=arguments[0], ts */ - elem *e2 = toElem((*ne.arguments)[0], irs); + elem* e2 = toElem((*ne.arguments)[0], irs); - Symbol *ts = symbol_genauto(Type_toCtype(tp)); - elem *eeq1 = el_bin(OPeq, TYnptr, el_var(ts), e); + Symbol* ts = symbol_genauto(Type_toCtype(tp)); + elem* eeq1 = el_bin(OPeq, TYnptr, el_var(ts), e); - elem *ederef = el_una(OPind, e2.Ety, el_var(ts)); - elem *eeq2 = el_bin(OPeq, e2.Ety, ederef, e2); + elem* ederef = el_una(OPind, e2.Ety, el_var(ts)); + elem* eeq2 = el_bin(OPeq, e2.Ety, ederef, e2); e = el_combine(eeq1, eeq2); e = el_combine(e, el_var(ts)); @@ -1355,9 +1355,9 @@ elem* toElem(Expression e, ref IRState irs) else if (auto taa = t.isTypeAArray()) { Symbol* s = getRtlsym(RTLSYM.AANEW); - elem *ti = getTypeInfo(ne, t, irs); + elem* ti = getTypeInfo(ne, t, irs); // aaNew(ti) - elem *ep = el_params(ti, null); + elem* ep = el_params(ti, null); e = el_bin(OPcall, TYnptr, el_var(s), ep); elem_setLoc(e, ne.loc); return e; @@ -1379,7 +1379,7 @@ elem* toElem(Expression e, ref IRState irs) elem* visitNeg(NegExp ne) { - elem *e = toElem(ne.e1, irs); + elem* e = toElem(ne.e1, irs); Type tb1 = ne.e1.type.toBasetype(); assert(tb1.ty != Tarray && tb1.ty != Tsarray); @@ -1389,7 +1389,7 @@ elem* toElem(Expression e, ref IRState irs) case Tvector: { // rewrite (-e) as (0-e) - elem *ez = el_calloc(); + elem* ez = el_calloc(); ez.Eoper = OPconst; ez.Ety = e.Ety; foreach (ref v; ez.Vlong8) @@ -1412,13 +1412,13 @@ elem* toElem(Expression e, ref IRState irs) elem* visitCom(ComExp ce) { - elem *e1 = toElem(ce.e1, irs); + elem* e1 = toElem(ce.e1, irs); Type tb1 = ce.e1.type.toBasetype(); tym_t ty = totym(ce.type); assert(tb1.ty != Tarray && tb1.ty != Tsarray); - elem *e; + elem* e; switch (tb1.ty) { case Tbool: @@ -1428,7 +1428,7 @@ elem* toElem(Expression e, ref IRState irs) case Tvector: { // rewrite (~e) as (e^~0) - elem *ec = el_calloc(); + elem* ec = el_calloc(); ec.Eoper = OPconst; ec.Ety = e1.Ety; foreach (ref v; ec.Vlong8) @@ -1451,7 +1451,7 @@ elem* toElem(Expression e, ref IRState irs) elem* visitNot(NotExp ne) { - elem *e = el_una(OPnot, totym(ne.type), toElem(ne.e1, irs)); + elem* e = el_una(OPnot, totym(ne.type), toElem(ne.e1, irs)); elem_setLoc(e,ne.loc); return e; } @@ -1472,7 +1472,7 @@ elem* toElem(Expression e, ref IRState irs) { // https://dlang.org/spec/expression.html#assert_expressions //printf("AssertExp.toElem() %s\n", ae.toChars()); - elem *e; + elem* e; if (irs.params.useAssert != CHECKENABLE.on) { // BUG: should replace assert(0); with a HLT instruction @@ -1503,8 +1503,8 @@ elem* toElem(Expression e, ref IRState irs) } e = toElem(ae.e1, irs); - Symbol *ts = null; - elem *einv = null; + Symbol* ts = null; + elem* einv = null; Type t1 = ae.e1.type.toBasetype(); FuncDeclaration inv; @@ -1529,7 +1529,7 @@ elem* toElem(Expression e, ref IRState irs) // Construct: (e1 || ModuleAssert(line)) Module m = cast(Module)irs.blx._module; - char *mname = cast(char*)m.srcfile.toChars(); + char* mname = cast(char*)m.srcfile.toChars(); //printf("filename = '%s'\n", ae.loc.filename); //printf("module = '%s'\n", m.srcfile.toChars()); @@ -1542,13 +1542,13 @@ elem* toElem(Expression e, ref IRState irs) /* If the source file name has changed, probably due * to a #line directive. */ - elem *ea; + elem* ea; if (ae.loc.filename && (ae.msg || strcmp(ae.loc.filename, mname) != 0)) { const(char)* id = ae.loc.filename; size_t len = strlen(id); - Symbol *si = toStringSymbol(id, len, 1); - elem *efilename = el_pair(TYdarray, el_long(TYsize_t, len), el_ptr(si)); + Symbol* si = toStringSymbol(id, len, 1); + elem* efilename = el_pair(TYdarray, el_long(TYsize_t, len), el_ptr(si)); if (irs.target.os == Target.OS.Windows && irs.target.isX86_64) efilename = addressElem(efilename, Type.tstring, true); @@ -1559,7 +1559,7 @@ elem* toElem(Expression e, ref IRState irs) * msg is not evaluated at all. so should use * toElemDtor(msg, irs) instead of toElem(msg, irs). */ - elem *emsg = toElemDtor(ae.msg, irs); + elem* emsg = toElemDtor(ae.msg, irs); emsg = array_toDarray(ae.msg.type, emsg); if (irs.target.os == Target.OS.Windows && irs.target.isX86_64) emsg = addressElem(emsg, Type.tvoid.arrayOf(), false); @@ -1583,7 +1583,7 @@ elem* toElem(Expression e, ref IRState irs) if (einv) { // tmp = e, e || assert, e.inv - elem *eassign = el_bin(OPeq, e.Ety, el_var(ts), e); + elem* eassign = el_bin(OPeq, e.Ety, el_var(ts), e); e = el_combine(eassign, el_bin(OPoror, TYvoid, el_var(ts), ea)); e = el_combine(e, einv); } @@ -1597,17 +1597,17 @@ elem* toElem(Expression e, ref IRState irs) { //printf("ThrowExp.toElem() '%s'\n", te.toChars()); - elem *e = toElemDtor(te.e1, irs); + elem* e = toElemDtor(te.e1, irs); const rtlthrow = config.ehmethod == EHmethod.EH_DWARF ? RTLSYM.THROWDWARF : RTLSYM.THROWC; - elem *sym = el_var(getRtlsym(rtlthrow)); + elem* sym = el_var(getRtlsym(rtlthrow)); return el_bin(OPcall, TYnoreturn, sym, e); } elem* visitPost(PostExp pe) { //printf("PostExp.toElem() '%s'\n", pe.toChars()); - elem *e = toElem(pe.e1, irs); - elem *einc = toElem(pe.e2, irs); + elem* e = toElem(pe.e1, irs); + elem* einc = toElem(pe.e2, irs); e = el_bin((pe.op == EXP.plusPlus) ? OPpostinc : OPpostdec, e.Ety,e,einc); elem_setLoc(e,pe.loc); @@ -1618,7 +1618,7 @@ elem* toElem(Expression e, ref IRState irs) /******************************************** */ - elem *toElemBin(BinExp be, int op) + elem* toElemBin(BinExp be, int op) { //printf("toElemBin() '%s'\n", be.toChars()); @@ -1631,15 +1631,15 @@ elem* toElem(Expression e, ref IRState irs) tym_t tym = totym(be.type); - elem *el = toElem(be.e1, irs); - elem *er = toElem(be.e2, irs); - elem *e = el_bin(op,tym,el,er); + elem* el = toElem(be.e1, irs); + elem* er = toElem(be.e2, irs); + elem* e = el_bin(op,tym,el,er); elem_setLoc(e,be.loc); return e; } - elem *toElemBinAssign(BinAssignExp be, int op) + elem* toElemBinAssign(BinAssignExp be, int op) { //printf("toElemBinAssign() '%s'\n", be.toChars()); //printAST(be); @@ -1653,8 +1653,8 @@ elem* toElem(Expression e, ref IRState irs) tym_t tym = totym(be.type); - elem *el; - elem *ev; + elem* el; + elem* ev; if (be.e1.op == EXP.cast_) { int depth = 0; @@ -1689,7 +1689,7 @@ elem* toElem(Expression e, ref IRState irs) if (el.Eoper == OPbit) { - elem *er = toElem(be.e2, irs); + elem* er = toElem(be.e2, irs); elem* e = el_bin(op, tym, el, er); elem_setLoc(e,be.loc); return e; @@ -1701,8 +1701,8 @@ elem* toElem(Expression e, ref IRState irs) el = el_una(OPind, tym, el); ev = el_una(OPind, tym, ev); } - elem *er = toElem(be.e2, irs); - elem *e = el_bin(op, tym, el, er); + elem* er = toElem(be.e2, irs); + elem* e = el_bin(op, tym, el, er); e = el_combine(e, ev); elem_setLoc(e,be.loc); @@ -1728,9 +1728,9 @@ elem* toElem(Expression e, ref IRState irs) /***************************************** * Evaluate elem and convert to dynamic array suitable for a function argument. */ - elem *eval_Darray(Expression e) + elem* eval_Darray(Expression e) { - elem *ex = toElem(e, irs); + elem* ex = toElem(e, irs); ex = array_toDarray(e.type, ex); if (irs.target.os == Target.OS.Windows && irs.target.isX86_64) { @@ -1814,7 +1814,7 @@ elem* toElem(Expression e, ref IRState irs) // integral compare eop = cast(OPER)rel_integral(eop); } - elem *e; + elem* e; if (cast(int)eop > 1 && t1.ty == Tclass && t2.ty == Tclass) { // Should have already been lowered @@ -1965,7 +1965,7 @@ elem* toElem(Expression e, ref IRState irs) } //printf("EqualExp.toElem()\n"); - elem *e; + elem* e; if (t1.ty == Tstruct) { // Rewritten to IdentityExp or memberwise-compare @@ -2020,21 +2020,21 @@ elem* toElem(Expression e, ref IRState irs) eptr2 = el_same(earr2); } - elem *esize = t2.ty == Tsarray ? esiz2 : esiz1; + elem* esize = t2.ty == Tsarray ? esiz2 : esiz1; e = el_param(eptr1, eptr2); e = el_bin(OPmemcmp, TYint, e, esize); e = el_bin(eop, TYint, e, el_long(TYint, 0)); - elem *elen = t2.ty == Tsarray ? elen2 : elen1; - elem *esizecheck = el_bin(eop, TYint, el_same(elen), el_long(TYsize_t, 0)); + elem* elen = t2.ty == Tsarray ? elen2 : elen1; + elem* esizecheck = el_bin(eop, TYint, el_same(elen), el_long(TYsize_t, 0)); e = el_bin(ee.op == EXP.equal ? OPoror : OPandand, TYint, esizecheck, e); if (t1.ty == Tsarray && t2.ty == Tsarray) assert(t1.size() == t2.size()); else { - elem *elencmp = el_bin(eop, TYint, elen1, elen2); + elem* elencmp = el_bin(eop, TYint, elen1, elen2); e = el_bin(ee.op == EXP.equal ? OPandand : OPoror, TYint, elencmp, e); } @@ -2045,10 +2045,10 @@ elem* toElem(Expression e, ref IRState irs) return e; } - elem *ea1 = eval_Darray(ee.e1); - elem *ea2 = eval_Darray(ee.e2); + elem* ea1 = eval_Darray(ee.e1); + elem* ea2 = eval_Darray(ee.e2); - elem *ep = el_params(getTypeInfo(ee, telement.arrayOf(), irs), + elem* ep = el_params(getTypeInfo(ee, telement.arrayOf(), irs), ea2, ea1, null); const rtlfunc = RTLSYM.ARRAYEQ2; e = el_bin(OPcall, TYint, el_var(getRtlsym(rtlfunc)), ep); @@ -2060,11 +2060,11 @@ elem* toElem(Expression e, ref IRState irs) { TypeAArray taa = cast(TypeAArray)t1; Symbol* s = getRtlsym(RTLSYM.AAEQUAL); - elem *ti = getTypeInfo(ee, taa, irs); - elem *ea1 = toElem(ee.e1, irs); - elem *ea2 = toElem(ee.e2, irs); + elem* ti = getTypeInfo(ee, taa, irs); + elem* ea1 = toElem(ee.e1, irs); + elem* ea2 = toElem(ee.e2, irs); // aaEqual(ti, e1, e2) - elem *ep = el_params(ea2, ea1, ti, null); + elem* ep = el_params(ea2, ea1, ti, null); e = el_bin(OPcall, TYint, el_var(s), ep); if (ee.op == EXP.notEqual) e = el_bin(OPxor, TYint, e, el_long(TYint, 1)); @@ -2077,7 +2077,7 @@ elem* toElem(Expression e, ref IRState irs) */ elem* ex = toElemBin(ee, OPeqeq); - elem *ec = el_calloc(); + elem* ec = el_calloc(); ec.Eoper = OPconst; ec.Ety = totym(t1); foreach (ref v; ec.Vlong8) @@ -2115,7 +2115,7 @@ elem* toElem(Expression e, ref IRState irs) */ const canSkipCompare = isTrivialExp(ie.e1) && isTrivialExp(ie.e2); - elem *e; + elem* e; if (t1.ty == Tstruct && (cast(TypeStruct)t1).sym.fields.length == 0 && canSkipCompare) { // we can skip the compare if the structs are empty @@ -2124,12 +2124,12 @@ elem* toElem(Expression e, ref IRState irs) else if (t1.ty == Tstruct || t1.isFloating()) { // Do bit compare of struct's - elem *es1 = toElem(ie.e1, irs); + elem* es1 = toElem(ie.e1, irs); es1 = addressElem(es1, ie.e1.type); - elem *es2 = toElem(ie.e2, irs); + elem* es2 = toElem(ie.e2, irs); es2 = addressElem(es2, ie.e2.type); e = el_param(es1, es2); - elem *ecount; + elem* ecount; // In case of `real`, don't compare padding bits // https://issues.dlang.org/show_bug.cgi?id=3632 ecount = el_long(TYsize_t, (t1.ty == TY.Tfloat80) ? (t1.size() - target.realpad) : t1.size()); @@ -2140,9 +2140,9 @@ elem* toElem(Expression e, ref IRState irs) else if (t1.isStaticOrDynamicArray() && t2.isStaticOrDynamicArray()) { - elem *ea1 = toElem(ie.e1, irs); + elem* ea1 = toElem(ie.e1, irs); ea1 = array_toDarray(t1, ea1); - elem *ea2 = toElem(ie.e2, irs); + elem* ea2 = toElem(ie.e2, irs); ea2 = array_toDarray(t2, ea2); e = el_bin(eop, totym(ie.type), ea1, ea2); @@ -2159,16 +2159,16 @@ elem* toElem(Expression e, ref IRState irs) elem* visitIn(InExp ie) { - elem *key = toElem(ie.e1, irs); - elem *aa = toElem(ie.e2, irs); + elem* key = toElem(ie.e1, irs); + elem* aa = toElem(ie.e2, irs); TypeAArray taa = cast(TypeAArray)ie.e2.type.toBasetype(); // aaInX(aa, keyti, key); key = addressElem(key, ie.e1.type); Symbol* s = getRtlsym(RTLSYM.AAINX); - elem *keyti = getTypeInfo(ie, taa.index, irs); - elem *ep = el_params(key, keyti, aa, null); - elem *e = el_bin(OPcall, totym(ie.type), el_var(s), ep); + elem* keyti = getTypeInfo(ie, taa.index, irs); + elem* ep = el_params(key, keyti, aa, null); + elem* e = el_bin(OPcall, totym(ie.type), el_var(s), ep); elem_setLoc(e, ie.loc); return e; @@ -2181,14 +2181,14 @@ elem* toElem(Expression e, ref IRState irs) { auto taa = re.e1.type.toBasetype().isTypeAArray(); assert(taa); - elem *ea = toElem(re.e1, irs); - elem *ekey = toElem(re.e2, irs); + elem* ea = toElem(re.e1, irs); + elem* ekey = toElem(re.e2, irs); ekey = addressElem(ekey, re.e2.type); Symbol* s = getRtlsym(RTLSYM.AADELX); - elem *keyti = getTypeInfo(re, taa.index, irs); - elem *ep = el_params(ekey, keyti, ea, null); - elem *e = el_bin(OPcall, TYbool, el_var(s), ep); + elem* keyti = getTypeInfo(re, taa.index, irs); + elem* ep = el_params(ekey, keyti, ea, null); + elem* e = el_bin(OPcall, TYbool, el_var(s), ep); elem_setLoc(e, re.loc); return e; @@ -2243,14 +2243,14 @@ elem* toElem(Expression e, ref IRState irs) Type tb = ta.nextOf().toBasetype(); uint sz = cast(uint)tb.size(); - elem *n1 = toElem(are.e1, irs); - elem *elwr = are.lwr ? toElem(are.lwr, irs) : null; - elem *eupr = are.upr ? toElem(are.upr, irs) : null; + elem* n1 = toElem(are.e1, irs); + elem* elwr = are.lwr ? toElem(are.lwr, irs) : null; + elem* eupr = are.upr ? toElem(are.upr, irs) : null; - elem *n1x = n1; + elem* n1x = n1; - elem *enbytes; - elem *einit; + elem* enbytes; + elem* einit; // Look for array[]=n if (auto ts = ta.isTypeSArray()) { @@ -2276,9 +2276,9 @@ elem* toElem(Expression e, ref IRState irs) } // Enforce order of evaluation of n1[elwr..eupr] as n1,elwr,eupr - elem *elwrx = elwr; + elem* elwrx = elwr; if (elwr) elwr = el_same(elwrx); - elem *euprx = eupr; + elem* euprx = eupr; if (eupr) eupr = el_same(euprx); version (none) @@ -2297,7 +2297,7 @@ elem* toElem(Expression e, ref IRState irs) einit = el_combine(einit, elwrx); einit = el_combine(einit, euprx); - elem *evalue = toElem(ae.e2, irs); + elem* evalue = toElem(ae.e2, irs); version (none) { @@ -2308,23 +2308,23 @@ elem* toElem(Expression e, ref IRState irs) if (irs.arrayBoundsCheck() && eupr && ta.ty != Tpointer) { assert(elwr); - elem *enbytesx = enbytes; + elem* enbytesx = enbytes; enbytes = el_same(enbytesx); - elem *c1 = el_bin(OPle, TYint, el_copytree(eupr), enbytesx); - elem *c2 = el_bin(OPle, TYint, el_copytree(elwr), el_copytree(eupr)); + elem* c1 = el_bin(OPle, TYint, el_copytree(eupr), enbytesx); + elem* c2 = el_bin(OPle, TYint, el_copytree(elwr), el_copytree(eupr)); c1 = el_bin(OPandand, TYint, c1, c2); // Construct: (c1 || arrayBoundsError) auto ea = buildArraySliceError(irs, ae.loc, el_copytree(elwr), el_copytree(eupr), el_copytree(enbytesx)); - elem *eb = el_bin(OPoror,TYvoid,c1,ea); + elem* eb = el_bin(OPoror,TYvoid,c1,ea); einit = el_combine(einit, eb); } - elem *elength; + elem* elength; if (elwr) { el_free(enbytes); - elem *elwr2 = el_copytree(elwr); + elem* elwr2 = el_copytree(elwr); elwr2 = el_bin(OPmul, TYsize_t, elwr2, el_long(TYsize_t, sz)); n1 = el_bin(OPadd, TYnptr, n1, elwr2); enbytes = el_bin(OPmin, TYsize_t, eupr, elwr); @@ -2343,11 +2343,11 @@ elem* toElem(Expression e, ref IRState irs) /* It's array1[]=array2[] * which is a memcpy */ - elem *eto = toElem(ae.e1, irs); - elem *efrom = toElem(ae.e2, irs); + elem* eto = toElem(ae.e1, irs); + elem* efrom = toElem(ae.e2, irs); uint size = cast(uint)t1.nextOf().size(); - elem *esize = el_long(TYsize_t, size); + elem* esize = el_long(TYsize_t, size); /* Determine if we need to do postblit */ @@ -2365,11 +2365,11 @@ elem* toElem(Expression e, ref IRState irs) if (!postblit && !destructor) { - elem *ex = el_same(eto); + elem* ex = el_same(eto); /* Returns: length of array ex */ - static elem *getDotLength(ref IRState irs, elem *eto, elem *ex) + static elem* getDotLength(ref IRState irs, elem* eto, elem* ex) { if (eto.Eoper == OPpair && eto.E1.Eoper == OPconst) @@ -2388,8 +2388,8 @@ elem* toElem(Expression e, ref IRState irs) auto nbytes = el_bin(OPmul, TYsize_t, elen, esize); // number of bytes to memcpy auto epto = array_toPtr(ae.e1.type, ex); - elem *epfr; - elem *echeck; + elem* epfr; + elem* echeck; if (irs.arrayBoundsCheck()) // check array lengths match and do not overlap { auto ey = el_same(efrom); @@ -2448,7 +2448,7 @@ elem* toElem(Expression e, ref IRState irs) eto = addressElem(eto, Type.tvoid.arrayOf()); efrom = addressElem(efrom, Type.tvoid.arrayOf()); } - elem *ep = el_params(eto, efrom, esize, null); + elem* ep = el_params(eto, efrom, esize, null); elem* e = el_bin(OPcall, totym(ae.type), el_var(getRtlsym(RTLSYM.ARRAYCOPY)), ep); return setResult(e); } @@ -2468,7 +2468,7 @@ elem* toElem(Expression e, ref IRState irs) // It'll be initialized to an address elem* e = toElem(ae.e2, irs); e = addressElem(e, ae.e2.type); - elem *es = toElem(ae.e1, irs); + elem* es = toElem(ae.e1, irs); if (es.Eoper == OPind) es = es.E1; else @@ -2481,9 +2481,9 @@ elem* toElem(Expression e, ref IRState irs) } tym_t tym = totym(ae.type); - elem *e1 = toElem(ae.e1, irs); + elem* e1 = toElem(ae.e1, irs); - elem *e1x; + elem* e1x; elem* setResult2(elem* e) { @@ -2531,7 +2531,7 @@ elem* toElem(Expression e, ref IRState irs) TypeFunction tf = cast(TypeFunction)ce.e1.type.toBasetype(); if (tf.ty == Tfunction && retStyle(tf, ce.f && ce.f.needThis()) == RET.stack) { - elem *ehidden = e1; + elem* ehidden = e1; ehidden = el_una(OPaddr, TYnptr, ehidden); assert(!irs.ehidden); irs.ehidden = ehidden; @@ -2575,9 +2575,9 @@ elem* toElem(Expression e, ref IRState irs) */ uint sz = cast(uint)ae.e1.type.size(); - elem *el = e1; - elem *enbytes = el_long(TYsize_t, sz); - elem *evalue = el_long(TYchar, 0); + elem* el = e1; + elem* enbytes = el_long(TYsize_t, sz); + elem* evalue = el_long(TYchar, 0); el = el_una(OPaddr, TYnptr, el); elem* e = el_param(enbytes, evalue); @@ -2632,7 +2632,7 @@ elem* toElem(Expression e, ref IRState irs) /* Implement: * (struct = struct) */ - elem *e2 = toElem(ae.e2, irs); + elem* e2 = toElem(ae.e2, irs); elem* e = elAssign(e1, e2, ae.e1.type, null); return setResult2(e); @@ -2646,12 +2646,12 @@ elem* toElem(Expression e, ref IRState irs) * with: * memset(&sarray, 0, struct.sizeof) */ - elem *ey = null; + elem* ey = null; targ_size_t sz = ae.e1.type.size(); - elem *el = e1; - elem *enbytes = el_long(TYsize_t, sz); - elem *evalue = el_long(TYchar, 0); + elem* el = e1; + elem* enbytes = el_long(TYsize_t, sz); + elem* evalue = el_long(TYchar, 0); el = el_una(OPaddr, TYnptr, el); elem* e = el_param(enbytes, evalue); @@ -2693,7 +2693,7 @@ elem* toElem(Expression e, ref IRState irs) } else { - Symbol *stmp = symbol_genauto(TYnptr); + Symbol* stmp = symbol_genauto(TYnptr); e1 = addressElem(e1, t1b); e1 = el_bin(OPeq, TYnptr, el_var(stmp), e1); @@ -2730,7 +2730,7 @@ elem* toElem(Expression e, ref IRState irs) lvalueElem = true; } - elem *e2 = toElem(ae.e2, irs); + elem* e2 = toElem(ae.e2, irs); if (!postblit && !destructor || ae.op == EXP.construct && !lvalueElem && postblit || @@ -2789,7 +2789,7 @@ elem* toElem(Expression e, ref IRState irs) elem* visitCatAssign(CatAssignExp ce) { //printf("CatAssignExp.toElem('%s')\n", ce.toChars()); - elem *e; + elem* e; switch (ce.op) { @@ -2800,8 +2800,8 @@ elem* toElem(Expression e, ref IRState irs) assert(tb1.ty == Tarray); Type tb1n = tb1.nextOf().toBasetype(); - elem *e1 = toElem(ce.e1, irs); - elem *e2 = toElem(ce.e2, irs); + elem* e1 = toElem(ce.e1, irs); + elem* e2 = toElem(ce.e2, irs); /* Because e1 is an lvalue, refer to it via a pointer to it in the form * of ev. Put any side effects into re1 @@ -2813,7 +2813,7 @@ elem* toElem(Expression e, ref IRState irs) assert(tb2.ty == Tdchar && (tb1n.ty == Tchar || tb1n.ty == Twchar)); - elem *ep = el_params(e2, el_copytree(ev), null); + elem* ep = el_params(e2, el_copytree(ev), null); const rtl = (tb1.nextOf().ty == Tchar) ? RTLSYM.ARRAYAPPENDCD : RTLSYM.ARRAYAPPENDWD; @@ -2950,9 +2950,9 @@ elem* toElem(Expression e, ref IRState irs) { tym_t tym = totym(aae.type); - elem *el = toElem(aae.e1, irs); - elem *er = toElemDtor(aae.e2, irs); - elem *e = el_bin(aae.op == EXP.andAnd ? OPandand : OPoror,tym,el,er); + elem* el = toElem(aae.e1, irs); + elem* er = toElemDtor(aae.e2, irs); + elem* e = el_bin(aae.op == EXP.andAnd ? OPandand : OPoror,tym,el,er); elem_setLoc(e, aae.loc); @@ -3007,10 +3007,10 @@ elem* toElem(Expression e, ref IRState irs) elem* visitUshr(UshrExp se) { - elem *eleft = toElem(se.e1, irs); + elem* eleft = toElem(se.e1, irs); eleft.Ety = touns(eleft.Ety); - elem *eright = toElem(se.e2, irs); - elem *e = el_bin(OPshr, totym(se.type), eleft, eright); + elem* eright = toElem(se.e2, irs); + elem* e = el_bin(OPshr, totym(se.type), eleft, eright); elem_setLoc(e, se.loc); return e; } @@ -3021,9 +3021,9 @@ elem* toElem(Expression e, ref IRState irs) elem* visitComma(CommaExp ce) { assert(ce.e1 && ce.e2); - elem *eleft = toElem(ce.e1, irs); - elem *eright = toElem(ce.e2, irs); - elem *e = el_combine(eleft, eright); + elem* eleft = toElem(ce.e1, irs); + elem* eright = toElem(ce.e2, irs); + elem* e = el_combine(eleft, eright); if (e) elem_setLoc(e, ce.loc); return e; @@ -3034,13 +3034,13 @@ elem* toElem(Expression e, ref IRState irs) elem* visitCond(CondExp ce) { - elem *ec = toElem(ce.econd, irs); + elem* ec = toElem(ce.econd, irs); - elem *eleft = toElem(ce.e1, irs); + elem* eleft = toElem(ce.e1, irs); if (irs.params.cov && ce.e1.loc.linnum) eleft = el_combine(incUsageElem(irs, ce.e1.loc), eleft); - elem *eright = toElem(ce.e2, irs); + elem* eright = toElem(ce.e2, irs); if (irs.params.cov && ce.e2.loc.linnum) eright = el_combine(incUsageElem(irs, ce.e2.loc), eright); @@ -3129,7 +3129,7 @@ elem* toElem(Expression e, ref IRState irs) setClosureVarOffset(fd); } - elem *e = toElem(dve.e1, irs); + elem* e = toElem(dve.e1, irs); Type tb1 = dve.e1.type.toBasetype(); tym_t typ = TYnptr; if (tb1.ty != Tclass && tb1.ty != Tpointer) @@ -3197,12 +3197,12 @@ elem* toElem(Expression e, ref IRState irs) } } - elem *eeq = null; - elem *ethis; - Symbol *sfunc = toSymbol(de.func); - elem *ep; + elem* eeq = null; + elem* ethis; + Symbol* sfunc = toSymbol(de.func); + elem* ep; - elem *ethis2 = null; + elem* ethis2 = null; if (de.vthis2) { // avoid using toSymbol directly because vthis2 may be a closure var @@ -3265,7 +3265,7 @@ elem* toElem(Expression e, ref IRState irs) // func.error(loc, "cannot form delegate due to covariant return type"); } - elem *e; + elem* e; if (ethis2) ethis = ethis2; if (ethis.Eoper == OPcomma) @@ -3286,7 +3286,7 @@ elem* toElem(Expression e, ref IRState irs) { // Just a pass-thru to e1 //printf("DotTypeExp.toElem() %s\n", dte.toChars()); - elem *e = toElem(dte.e1, irs); + elem* e = toElem(dte.e1, irs); elem_setLoc(e, dte.loc); return e; } @@ -3297,12 +3297,12 @@ elem* toElem(Expression e, ref IRState irs) assert(ce.e1.type); Type t1 = ce.e1.type.toBasetype(); Type ectype = t1; - elem *eeq = null; + elem* eeq = null; - elem *ehidden = irs.ehidden; + elem* ehidden = irs.ehidden; irs.ehidden = null; - elem *ec; + elem* ec; FuncDeclaration fd = null; bool dctor = false; if (ce.e1.op == EXP.dotVariable && t1.ty != Tdelegate) @@ -3375,8 +3375,8 @@ elem* toElem(Expression e, ref IRState irs) /* Rewrite (*exp)(arguments) as: * tmp = exp, (*tmp)(arguments) */ - elem *ec1 = ec.E1; - Symbol *stmp = symbol_genauto(type_fake(ec1.Ety)); + elem* ec1 = ec.E1; + Symbol* stmp = symbol_genauto(type_fake(ec1.Ety)); eeq = el_bin(OPeq, ec.Ety, el_var(stmp), ec1); ec.E1 = el_var(stmp); } @@ -3387,7 +3387,7 @@ elem* toElem(Expression e, ref IRState irs) */ ec = addressElem(ec, ectype); - Symbol *stmp = symbol_genauto(type_fake(ec.Ety)); + Symbol* stmp = symbol_genauto(type_fake(ec.Ety)); eeq = el_bin(OPeq, ec.Ety, el_var(stmp), ec); ec = el_una(OPind, totym(ectype), el_var(stmp)); } @@ -3415,8 +3415,8 @@ elem* toElem(Expression e, ref IRState irs) // of the same size: char[sz] tmp; assert(!ehidden); - .type *t = type_static_array(sz, tschar); // BUG: fix extra Tcount++ - Symbol *stmp = symbol_genauto(t); + .type* t = type_static_array(sz, tschar); // BUG: fix extra Tcount++ + Symbol* stmp = symbol_genauto(t); ec = el_ptr(stmp); elem_setLoc(ec,loc); return ec; @@ -3442,8 +3442,8 @@ elem* toElem(Expression e, ref IRState irs) /* Rewrite (*exp)(arguments) as: * tmp=exp, (*tmp)(arguments) */ - elem *ec1 = ec.E1; - Symbol *stmp = symbol_genauto(type_fake(ec1.Ety)); + elem* ec1 = ec.E1; + Symbol* stmp = symbol_genauto(type_fake(ec1.Ety)); eeq = el_bin(OPeq, ec.Ety, el_var(stmp), ec1); ec.E1 = el_var(stmp); } @@ -3452,13 +3452,13 @@ elem* toElem(Expression e, ref IRState irs) /* Rewrite (exp)(arguments) as: * tmp=exp, (tmp)(arguments) */ - Symbol *stmp = symbol_genauto(type_fake(ec.Ety)); + Symbol* stmp = symbol_genauto(type_fake(ec.Ety)); eeq = el_bin(OPeq, ec.Ety, el_var(stmp), ec); ec = el_var(stmp); } } } - elem *ethis2 = null; + elem* ethis2 = null; if (ce.vthis2) { // avoid using toSymbol directly because vthis2 may be a closure var @@ -3468,7 +3468,7 @@ elem* toElem(Expression e, ref IRState irs) ve.type = ce.vthis2.type.pointerTo(); ethis2 = toElem(ve, irs); } - elem *ecall = callfunc(ce.loc, irs, ce.directcall, ce.type, ec, ectype, fd, t1, ehidden, ce.arguments, null, ethis2); + elem* ecall = callfunc(ce.loc, irs, ce.directcall, ce.type, ec, ectype, fd, t1, ehidden, ce.arguments, null, ethis2); if (dctor && ecall.Eoper == OPind) { @@ -3481,11 +3481,11 @@ elem* toElem(Expression e, ref IRState irs) * * (dctor info ((__ctmp = initializer),call(ce, args))) * * (dctor info ((_flag=0),(__ctmp = initializer),call(ce, args))) */ - elem *ea = ecall.E1; // ea: call(ce,args) + elem* ea = ecall.E1; // ea: call(ce,args) tym_t ty = ea.Ety; ecall.E1 = eeq; assert(eeq.Eoper == OPinfo); - elem *eeqcomma = eeq.E2; + elem* eeqcomma = eeq.E2; assert(eeqcomma.Eoper == OPcomma); while (eeqcomma.E2.Eoper == OPcomma) { @@ -3523,14 +3523,14 @@ elem* toElem(Expression e, ref IRState irs) elem_setLoc(e, ae.loc); return e; } - elem *e = el_ptr(toSymbol(sle.origin)); + elem* e = el_ptr(toSymbol(sle.origin)); e.ET = Type_toCtype(ae.type); elem_setLoc(e, ae.loc); return e; } else { - elem *e = toElem(ae.e1, irs); + elem* e = toElem(ae.e1, irs); e = addressElem(e, ae.e1.type); e.Ety = totym(ae.type); elem_setLoc(e, ae.loc); @@ -3541,7 +3541,7 @@ elem* toElem(Expression e, ref IRState irs) elem* visitPtr(PtrExp pe) { //printf("PtrExp.toElem() %s\n", pe.toChars()); - elem *e = toElem(pe.e1, irs); + elem* e = toElem(pe.e1, irs); if (tybasic(e.Ety) == TYnptr && pe.e1.type.nextOf() && pe.e1.type.nextOf().isImmutable()) @@ -3569,7 +3569,7 @@ elem* toElem(Expression e, ref IRState irs) assert(tb.ty != Taarray); } //e1.type.print(); - elem *e = toElem(de.e1, irs); + elem* e = toElem(de.e1, irs); tb = de.e1.type.toBasetype(); RTLSYM rtl; switch (tb.ty) @@ -3719,14 +3719,14 @@ elem* toElem(Expression e, ref IRState irs) printf("\tfrom: %s\n", ce.e1.type.toChars()); printf("\tto : %s\n", ce.to.toChars()); } - elem *e = toElem(ce.e1, irs); + elem* e = toElem(ce.e1, irs); return toElemCast(ce, e, false, irs); } elem* visitArrayLength(ArrayLengthExp ale) { - elem *e = toElem(ale.e1, irs); + elem* e = toElem(ale.e1, irs); e = el_una(target.isX86_64 ? OP128_64 : OP64_32, totym(ale.type), e); elem_setLoc(e, ale.loc); return e; @@ -3735,7 +3735,7 @@ elem* toElem(Expression e, ref IRState irs) elem* visitDelegatePtr(DelegatePtrExp dpe) { // *cast(void**)(&dg) - elem *e = toElem(dpe.e1, irs); + elem* e = toElem(dpe.e1, irs); Type tb1 = dpe.e1.type.toBasetype(); e = addressElem(e, tb1); e = el_una(OPind, totym(dpe.type), e); @@ -3746,7 +3746,7 @@ elem* toElem(Expression e, ref IRState irs) elem* visitDelegateFuncptr(DelegateFuncptrExp dfpe) { // *cast(void**)(&dg + size_t.sizeof) - elem *e = toElem(dfpe.e1, irs); + elem* e = toElem(dfpe.e1, irs); Type tb1 = dfpe.e1.type.toBasetype(); e = addressElem(e, tb1); e = el_bin(OPadd, TYnptr, e, el_long(TYsize_t, target.isX86_64 ? 8 : 4)); @@ -3761,12 +3761,12 @@ elem* toElem(Expression e, ref IRState irs) Type tb = se.type.toBasetype(); assert(tb.isStaticOrDynamicArray()); Type t1 = se.e1.type.toBasetype(); - elem *e = toElem(se.e1, irs); + elem* e = toElem(se.e1, irs); if (se.lwr) { uint sz = cast(uint)t1.nextOf().size(); - elem *einit = resolveLengthVar(se.lengthVar, &e, t1); + elem* einit = resolveLengthVar(se.lengthVar, &e, t1); if (t1.ty == Tsarray) e = array_toPtr(se.e1.type, e); if (!einit) @@ -3778,10 +3778,10 @@ elem* toElem(Expression e, ref IRState irs) // TYdarray if t.ty == Tarray // TYptr if t.ty == Tsarray or Tpointer - elem *elwr = toElem(se.lwr, irs); - elem *eupr = toElem(se.upr, irs); - elem *elwr2 = el_sideeffect(eupr) ? el_copytotmp(elwr) : el_same(elwr); - elem *eupr2 = eupr; + elem* elwr = toElem(se.lwr, irs); + elem* eupr = toElem(se.upr, irs); + elem* elwr2 = el_sideeffect(eupr) ? el_copytotmp(elwr) : el_same(elwr); + elem* eupr2 = eupr; //printf("upperIsInBounds = %d lowerIsLessThanUpper = %d\n", se.upperIsInBounds, se.lowerIsLessThanUpper); if (irs.arrayBoundsCheck()) @@ -3790,8 +3790,8 @@ elem* toElem(Expression e, ref IRState irs) // upr <= array.length // lwr <= upr - elem *c1 = null; - elem *elen; + elem* c1 = null; + elem* elen; if (!se.upperIsInBounds) { eupr2 = el_same(eupr); @@ -3838,7 +3838,7 @@ elem* toElem(Expression e, ref IRState irs) // if lowerIsLessThanUpper (e.g. arr[-1..0]), elen is null here elen = elen ? elen : el_long(TYsize_t, 0); auto ea = buildArraySliceError(irs, se.loc, el_copytree(elwr2), el_copytree(eupr2), el_copytree(elen)); - elem *eb = el_bin(OPoror, TYvoid, c1, ea); + elem* eb = el_bin(OPoror, TYvoid, c1, ea); elwr = el_combine(elwr, eb); } @@ -3851,12 +3851,12 @@ elem* toElem(Expression e, ref IRState irs) // pointer is (ptr + lwr*sz) // Combine as (length pair ptr) - elem *eofs = el_bin(OPmul, TYsize_t, elwr2, el_long(TYsize_t, sz)); - elem *eptr = el_bin(OPadd, TYnptr, e, eofs); + elem* eofs = el_bin(OPmul, TYsize_t, elwr2, el_long(TYsize_t, sz)); + elem* eptr = el_bin(OPadd, TYnptr, e, eofs); if (tb.ty == Tarray) { - elem *elen = el_bin(OPmin, TYsize_t, eupr2, el_copytree(elwr2)); + elem* elen = el_bin(OPmin, TYsize_t, eupr2, el_copytree(elwr2)); e = el_pair(TYdarray, elen, eptr); } else @@ -3892,9 +3892,9 @@ elem* toElem(Expression e, ref IRState irs) elem* visitIndex(IndexExp ie) { - elem *e; - elem *n1 = toElem(ie.e1, irs); - elem *eb = null; + elem* e; + elem* n1 = toElem(ie.e1, irs); + elem* eb = null; //printf("IndexExp.toElem() %s\n", ie.toChars()); Type t1 = ie.e1.type.toBasetype(); @@ -3908,7 +3908,7 @@ elem* toElem(Expression e, ref IRState irs) uint vsize = cast(uint)taa.next.size(); // n2 becomes the index, also known as the key - elem *n2 = toElem(ie.e2, irs); + elem* n2 = toElem(ie.e2, irs); /* Turn n2 into a pointer to the index. If it's an lvalue, * take the address of it. If not, copy it to a temp and @@ -3916,10 +3916,10 @@ elem* toElem(Expression e, ref IRState irs) */ n2 = addressElem(n2, taa.index); - elem *valuesize = el_long(TYsize_t, vsize); + elem* valuesize = el_long(TYsize_t, vsize); //printf("valuesize: "); elem_print(valuesize); - Symbol *s; - elem *ti; + Symbol* s; + elem* ti; if (ie.modifiable) { n1 = el_una(OPaddr, TYnptr, n1); @@ -3933,11 +3933,11 @@ elem* toElem(Expression e, ref IRState irs) } //printf("taa.index = %s\n", taa.index.toChars()); //printf("ti:\n"); elem_print(ti); - elem *ep = el_params(n2, valuesize, ti, n1, null); + elem* ep = el_params(n2, valuesize, ti, n1, null); e = el_bin(OPcall, TYnptr, el_var(s), ep); if (irs.arrayBoundsCheck()) { - elem *n = el_same(e); + elem* n = el_same(e); // Construct: ((e || arrayBoundsError), n) auto ea = buildRangeError(irs, ie.loc); @@ -3951,12 +3951,12 @@ elem* toElem(Expression e, ref IRState irs) return e; } - elem *einit = resolveLengthVar(ie.lengthVar, &n1, t1); - elem *n2 = toElem(ie.e2, irs); + elem* einit = resolveLengthVar(ie.lengthVar, &n1, t1); + elem* n2 = toElem(ie.e2, irs); if (irs.arrayBoundsCheck() && !ie.indexIsInBounds) { - elem *elength; + elem* elength; if (auto tsa = t1.isTypeSArray()) { @@ -3971,7 +3971,7 @@ elem* toElem(Expression e, ref IRState irs) n1 = el_same(elength); elength = el_una(target.isX86_64 ? OP128_64 : OP64_32, TYsize_t, elength); L1: - elem *n2x = n2; + elem* n2x = n2; n2 = el_same(n2x); n2x = el_bin(OPlt, TYint, n2x, elength); @@ -3984,7 +3984,7 @@ elem* toElem(Expression e, ref IRState irs) n1 = array_toPtr(t1, n1); { - elem *escale = el_long(TYsize_t, t1.nextOf().size()); + elem* escale = el_long(TYsize_t, t1.nextOf().size()); n2 = el_bin(OPmul, TYsize_t, n2, escale); e = el_bin(OPadd, TYnptr, n1, n2); e = el_una(OPind, totym(ie.type), e); @@ -4005,18 +4005,18 @@ elem* toElem(Expression e, ref IRState irs) elem* visitTuple(TupleExp te) { //printf("TupleExp.toElem() %s\n", te.toChars()); - elem *e = null; + elem* e = null; if (te.e0) e = toElem(te.e0, irs); foreach (el; *te.exps) { - elem *ep = toElem(el, irs); + elem* ep = toElem(el, irs); e = el_combine(e, ep); } return e; } - static elem *tree_insert(Elems *args, size_t low, size_t high) + static elem* tree_insert(Elems* args, size_t low, size_t high) { assert(low < high); if (low + 1 == high) @@ -4038,13 +4038,13 @@ elem* toElem(Expression e, ref IRState irs) tb = Type.tuns8.sarrayOf((cast(TypeSArray)tb).dim.toUInteger()); } - elem *e; + elem* e; if (dim > 0) { if (ale.onstack || tb.ty == Tsarray || irs.Cfile && tb.ty == Tpointer) { - Symbol *stmp = null; + Symbol* stmp = null; e = ExpressionsToStaticArray(irs, ale.loc, ale.elements, &stmp, 0, ale.basis); e = el_combine(e, el_ptr(stmp)); } @@ -4061,7 +4061,7 @@ elem* toElem(Expression e, ref IRState irs) el_param(el_long(TYsize_t, dim), getTypeInfo(ale, ale.type, irs))); toTraceGC(irs, e, ale.loc); - Symbol *stmp = symbol_genauto(Type_toCtype(Type.tvoid.pointerTo())); + Symbol* stmp = symbol_genauto(Type_toCtype(Type.tvoid.pointerTo())); e = el_bin(OPeq, TYnptr, el_var(stmp), e); e = el_combine(e, ExpressionsToStaticArray(irs, ale.loc, ale.elements, &stmp, 0, ale.basis)); @@ -4100,7 +4100,7 @@ elem* toElem(Expression e, ref IRState irs) size_t dim = aale.keys.length; if (!dim) { - elem *e = el_long(TYnptr, 0); // empty associative array is the null pointer + elem* e = el_long(TYnptr, 0); // empty associative array is the null pointer if (t.ty != Taarray) e = addressElem(e, Type.tvoidptr); return e; @@ -4112,20 +4112,20 @@ elem* toElem(Expression e, ref IRState irs) assert(t.ty == Taarray); Type ta = t; - Symbol *skeys = null; - elem *ekeys = ExpressionsToStaticArray(irs, aale.loc, aale.keys, &skeys); + Symbol* skeys = null; + elem* ekeys = ExpressionsToStaticArray(irs, aale.loc, aale.keys, &skeys); - Symbol *svalues = null; - elem *evalues = ExpressionsToStaticArray(irs, aale.loc, aale.values, &svalues); + Symbol* svalues = null; + elem* evalues = ExpressionsToStaticArray(irs, aale.loc, aale.values, &svalues); - elem *ev = el_pair(TYdarray, el_long(TYsize_t, dim), el_ptr(svalues)); - elem *ek = el_pair(TYdarray, el_long(TYsize_t, dim), el_ptr(skeys )); + elem* ev = el_pair(TYdarray, el_long(TYsize_t, dim), el_ptr(svalues)); + elem* ek = el_pair(TYdarray, el_long(TYsize_t, dim), el_ptr(skeys )); if (irs.target.os == Target.OS.Windows && irs.target.isX86_64) { ev = addressElem(ev, Type.tvoid.arrayOf()); ek = addressElem(ek, Type.tvoid.arrayOf()); } - elem *e = el_params(ev, ek, + elem* e = el_params(ev, ek, getTypeInfo(aale, ta, irs), null); @@ -4262,9 +4262,9 @@ private: /************************************** * Mirrors logic in Dsymbol_canThrow(). */ -elem *Dsymbol_toElem(Dsymbol s, ref IRState irs) +elem* Dsymbol_toElem(Dsymbol s, ref IRState irs) { - elem *e = null; + elem* e = null; void symbolDg(Dsymbol s) { @@ -4283,7 +4283,7 @@ elem *Dsymbol_toElem(Dsymbol s, ref IRState irs) toObjFile(vd, false); else { - Symbol *sp = toSymbol(s); + Symbol* sp = toSymbol(s); symbol_add(sp); //printf("\tadding symbol '%s'\n", sp.Sident); if (vd._init) @@ -4296,8 +4296,8 @@ elem *Dsymbol_toElem(Dsymbol s, ref IRState irs) */ if (vd.needsScopeDtor()) { - elem *edtor = toElem(vd.edtor, irs); - elem *ed = null; + elem* edtor = toElem(vd.edtor, irs); + elem* ed = null; if (irs.isNothrow()) { ed = edtor; @@ -4354,7 +4354,7 @@ elem *Dsymbol_toElem(Dsymbol s, ref IRState irs) * Allocate a static array, and initialize its members with elems[]. * Return the initialization expression, and the symbol for the static array in *psym. */ -elem *ElemsToStaticArray(const ref Loc loc, Type telem, Elems *elems, Symbol **psym) +elem* ElemsToStaticArray(const ref Loc loc, Type telem, Elems* elems, Symbol **psym) { // Create a static array of type telem[dim] const dim = elems.length; @@ -4362,20 +4362,20 @@ elem *ElemsToStaticArray(const ref Loc loc, Type telem, Elems *elems, Symbol **p Type tsarray = telem.sarrayOf(dim); const szelem = telem.size(); - .type *te = Type_toCtype(telem); // stmp[] element type + .type* te = Type_toCtype(telem); // stmp[] element type - Symbol *stmp = symbol_genauto(Type_toCtype(tsarray)); + Symbol* stmp = symbol_genauto(Type_toCtype(tsarray)); *psym = stmp; - elem *e = null; + elem* e = null; foreach (i, ep; *elems) { /* Generate: *(&stmp + i * szelem) = element[i] */ - elem *ev = el_ptr(stmp); + elem* ev = el_ptr(stmp); ev = el_bin(OPadd, TYnptr, ev, el_long(TYsize_t, i * szelem)); ev = el_una(OPind, te.Tty, ev); - elem *eeq = elAssign(ev, ep, null, te); + elem* eeq = elAssign(ev, ep, null, te); e = el_combine(e, eeq); } return e; @@ -4386,7 +4386,7 @@ elem *ElemsToStaticArray(const ref Loc loc, Type telem, Elems *elems, Symbol **p * exps[]. * Return the initialization expression, and the symbol for the static array in *psym. */ -elem *ExpressionsToStaticArray(ref IRState irs, const ref Loc loc, Expressions *exps, Symbol **psym, size_t offset = 0, Expression basis = null) +elem* ExpressionsToStaticArray(ref IRState irs, const ref Loc loc, Expressions* exps, Symbol **psym, size_t offset = 0, Expression basis = null) { // Create a static array of type telem[dim] const dim = exps.length; @@ -4394,7 +4394,7 @@ elem *ExpressionsToStaticArray(ref IRState irs, const ref Loc loc, Expressions * Type telem = ((*exps)[0] ? (*exps)[0] : basis).type; const szelem = telem.size(); - .type *te = Type_toCtype(telem); // stmp[] element type + .type* te = Type_toCtype(telem); // stmp[] element type if (!*psym) { @@ -4402,9 +4402,9 @@ elem *ExpressionsToStaticArray(ref IRState irs, const ref Loc loc, Expressions * *psym = symbol_genauto(Type_toCtype(tsarray2)); offset = 0; } - Symbol *stmp = *psym; + Symbol* stmp = *psym; - elem *e = null; + elem* e = null; for (size_t i = 0; i < dim; ) { Expression el = (*exps)[i]; @@ -4416,7 +4416,7 @@ elem *ExpressionsToStaticArray(ref IRState irs, const ref Loc loc, Expressions * ArrayLiteralExp ale = cast(ArrayLiteralExp)el; if (ale.elements && ale.elements.length) { - elem *ex = ExpressionsToStaticArray(irs, + elem* ex = ExpressionsToStaticArray(irs, ale.loc, ale.elements, &stmp, cast(uint)(offset + i * szelem), ale.basis); e = el_combine(e, ex); } @@ -4441,11 +4441,11 @@ elem *ExpressionsToStaticArray(ref IRState irs, const ref Loc loc, Expressions * /* Generate: *(&stmp + i * szelem) = element[i] */ - elem *ep = toElem(el, irs); - elem *ev = tybasic(stmp.Stype.Tty) == TYnptr ? el_var(stmp) : el_ptr(stmp); + elem* ep = toElem(el, irs); + elem* ev = tybasic(stmp.Stype.Tty) == TYnptr ? el_var(stmp) : el_ptr(stmp); ev = el_bin(OPadd, TYnptr, ev, el_long(TYsize_t, offset + i * szelem)); - elem *eeq; + elem* eeq; if (j == i + 1) { ev = el_una(OPind, te.Tty, ev); @@ -4453,7 +4453,7 @@ elem *ExpressionsToStaticArray(ref IRState irs, const ref Loc loc, Expressions * } else { - elem *edim = el_long(TYsize_t, j - i); + elem* edim = el_long(TYsize_t, j - i); eeq = setArray(el, ev, edim, telem, ep, irs, EXP.blit); } e = el_combine(e, eeq); @@ -4464,7 +4464,7 @@ elem *ExpressionsToStaticArray(ref IRState irs, const ref Loc loc, Expressions * /*************************************************** */ -elem *toElemCast(CastExp ce, elem *e, bool isLvalue, ref IRState irs) +elem* toElemCast(CastExp ce, elem* e, bool isLvalue, ref IRState irs) { tym_t ftym; tym_t ttym; @@ -4567,11 +4567,11 @@ elem *toElemCast(CastExp ce, elem *e, bool isLvalue, ref IRState irs) // Set array dimension to (length * (fsize / tsize)) // Generate pair(e.length * (fsize/tsize), es.ptr) - elem *es = el_same(e); + elem* es = el_same(e); - elem *eptr = el_una(OPmsw, TYnptr, es); - elem *elen = el_una(target.isX86_64 ? OP128_64 : OP64_32, TYsize_t, e); - elem *elen2 = el_bin(OPmul, TYsize_t, elen, el_long(TYsize_t, fsize / tsize)); + elem* eptr = el_una(OPmsw, TYnptr, es); + elem* elen = el_una(target.isX86_64 ? OP128_64 : OP64_32, TYsize_t, e); + elem* elen2 = el_bin(OPmul, TYsize_t, elen, el_long(TYsize_t, fsize / tsize)); e = el_pair(totym(ce.type), elen2, eptr); } else @@ -4613,8 +4613,8 @@ elem *toElemCast(CastExp ce, elem *e, bool isLvalue, ref IRState irs) } else { - elem *etmp = el_same(e); - elem *ex = el_bin(OPadd, TYnptr, etmp, el_long(TYsize_t, offset)); + elem* etmp = el_same(e); + elem* ex = el_bin(OPadd, TYnptr, etmp, el_long(TYsize_t, offset)); ex = el_bin(OPcolon, TYnptr, ex, el_long(TYnptr, 0)); e = el_bin(OPcond, TYnptr, e, ex); } @@ -4700,7 +4700,7 @@ elem *toElemCast(CastExp ce, elem *e, bool isLvalue, ref IRState irs) // _d_class_cast(e, cdto); rtl = RTLSYM.CLASS_CAST; } - elem *ep = el_param(el_ptr(toExtSymbol(cdto)), e); + elem* ep = el_param(el_ptr(toExtSymbol(cdto)), e); e = el_bin(OPcall, TYnptr, el_var(getRtlsym(rtl)), ep); } return Lret(ce, e); @@ -5379,7 +5379,7 @@ elem *toElemCast(CastExp ce, elem *e, bool isLvalue, ref IRState irs) * If argument to a function should use OPstrpar, * fix it so it does and return it. */ -elem *useOPstrpar(elem *e) +elem* useOPstrpar(elem* e) { tym_t ty = tybasic(e.Ety); if (ty == TYstruct || ty == TYarray) @@ -5395,22 +5395,22 @@ elem *useOPstrpar(elem *e) * Call a function. */ -elem *callfunc(const ref Loc loc, +elem* callfunc(const ref Loc loc, ref IRState irs, int directcall, // 1: don't do virtual call Type tret, // return type - elem *ec, // evaluates to function address + elem* ec, // evaluates to function address Type ectype, // original type of ec FuncDeclaration fd, // if !=NULL, this is the function being called Type t, // TypeDelegate or TypeFunction for this function - elem *ehidden, // if !=null, this is the 'hidden' argument - Expressions *arguments, - elem *esel = null, // selector for Objective-C methods (when not provided by fd) - elem *ethis2 = null) // multi-context array + elem* ehidden, // if !=null, this is the 'hidden' argument + Expressions* arguments, + elem* esel = null, // selector for Objective-C methods (when not provided by fd) + elem* ethis2 = null) // multi-context array { - elem *ethis = null; - elem *eside = null; - elem *eresult = ehidden; + elem* ethis = null; + elem* eside = null; + elem* eresult = ehidden; version (none) { @@ -5489,7 +5489,7 @@ elem *callfunc(const ref Loc loc, foreach (const i, arg; *arguments) { - elem *ea = toElem(arg, irs); + elem* ea = toElem(arg, irs); //printf("\targ[%d]: %s\n", cast(int)i, arg.toChars()); @@ -5633,7 +5633,7 @@ elem *callfunc(const ref Loc loc, if (!ehidden) { // Don't have one, so create one - type *tc; + type* tc; Type tret2 = tf.next; if (tret2.toBasetype().ty == Tstruct || @@ -5641,7 +5641,7 @@ elem *callfunc(const ref Loc loc, tc = Type_toCtype(tret2); else tc = type_fake(totym(tret2)); - Symbol *stmp = symbol_genauto(tc); + Symbol* stmp = symbol_genauto(tc); ehidden = el_ptr(stmp); eresult = ehidden; } @@ -5684,7 +5684,7 @@ elem *callfunc(const ref Loc loc, } if (el_sideeffect(ethis)) { - elem *ex = ethis; + elem* ex = ethis; ethis = el_copytotmp(ex); eside = el_combine(ex, eside); } @@ -5694,7 +5694,7 @@ elem *callfunc(const ref Loc loc, // Evaluate ec for side effects eside = el_combine(ec, eside); } - Symbol *sfunc = toSymbol(fd); + Symbol* sfunc = toSymbol(fd); if (esel) { @@ -5716,7 +5716,7 @@ elem *callfunc(const ref Loc loc, { // make virtual call assert(ethis); - elem *ev = el_same(ethis); + elem* ev = el_same(ethis); ev = el_una(OPind, TYnptr, ev); uint vindex = fd.vtblIndex; assert(cast(int)vindex >= 0); @@ -5744,7 +5744,7 @@ elem *callfunc(const ref Loc loc, const tyret = totym(tret); // Look for intrinsic functions and construct result into e - elem *e; + elem* e; if (ec.Eoper == OPvar && op != NotIntrinsic) { el_free(ec); @@ -5761,14 +5761,14 @@ elem *callfunc(const ref Loc loc, } if (op == OPscale) { - elem *et = e.E1; + elem* et = e.E1; e.E1 = el_una(OPs32_d, TYdouble, e.E2); e.E1 = el_una(OPd_ld, TYldouble, e.E1); e.E2 = et; } else if (op == OPyl2x || op == OPyl2xp1) { - elem *et = e.E1; + elem* et = e.E1; e.E1 = e.E2; e.E2 = et; } @@ -5789,7 +5789,7 @@ elem *callfunc(const ref Loc loc, isXMMstore(cast(uint)el_tolong(e.E1))) { //printf("OPvecsto\n"); - elem *tmp = e.E1; + elem* tmp = e.E1; e.E1 = e.E2.E1; e.E2.E1 = tmp; e.Eoper = OPvecsto; @@ -5904,7 +5904,7 @@ elem *callfunc(const ref Loc loc, * Returns: * elem that evaluates the side effects */ -extern (D) elem *fixArgumentEvaluationOrder(elem*[] elems) +extern (D) elem* fixArgumentEvaluationOrder(elem*[] elems) { /* It matters if all are true: * 1. at least one argument has side effects @@ -5972,7 +5972,7 @@ extern (D) elem *fixArgumentEvaluationOrder(elem*[] elems) break; } - elem *es = e; + elem* es = e; elems[i] = el_copytotmp(es); eside = el_combine(eside, es); } @@ -6027,7 +6027,7 @@ bool elemIsLvalue(elem* e) * e rebuilt into a pointer to the data */ -elem *array_toPtr(Type t, elem *e) +elem* array_toPtr(Type t, elem* e) { //printf("array_toPtr()\n"); //elem_print(e); @@ -6089,11 +6089,11 @@ else * Convert array to a dynamic array. */ -elem *array_toDarray(Type t, elem *e) +elem* array_toDarray(Type t, elem* e) { uint dim; - elem *ef = null; - elem *ex; + elem* ef = null; + elem* ex; //printf("array_toDarray(t = %s)\n", t.toChars()); //elem_print(e); @@ -6114,7 +6114,7 @@ elem *array_toDarray(Type t, elem *e) case OPconst: { const size_t len = tysize(e.Ety); - elem *es = el_calloc(); + elem* es = el_calloc(); es.Eoper = OPstring; // freed in el_free @@ -6162,7 +6162,7 @@ elem *array_toDarray(Type t, elem *e) /************************************ */ -elem *sarray_toDarray(const ref Loc loc, Type tfrom, Type tto, elem *e) +elem* sarray_toDarray(const ref Loc loc, Type tfrom, Type tto, elem* e) { //printf("sarray_toDarray()\n"); //elem_print(e); @@ -6178,7 +6178,7 @@ elem *sarray_toDarray(const ref Loc loc, Type tfrom, Type tto, elem *e) assert(tsize != 0 && (dim * fsize) % tsize == 0); dim = (dim * fsize) / tsize; } - elem *elen = el_long(TYsize_t, dim); + elem* elen = el_long(TYsize_t, dim); e = addressElem(e, tfrom); e = el_pair(TYdarray, elen, e); return e; @@ -6194,7 +6194,7 @@ elem *sarray_toDarray(const ref Loc loc, Type tfrom, Type tto, elem *e) * TypeInfo */ private -elem *getTypeInfo(Expression e, Type t, ref IRState irs) +elem* getTypeInfo(Expression e, Type t, ref IRState irs) { assert(t.ty != Terror); TypeInfo_toObjFile(e, e.loc, t); @@ -6244,7 +6244,7 @@ StructDeclaration needsDtor(Type t) * Returns: * created IR code */ -elem *setArray(Expression exp, elem *eptr, elem *edim, Type tb, elem *evalue, ref IRState irs, int op) +elem* setArray(Expression exp, elem* eptr, elem* edim, Type tb, elem* evalue, ref IRState irs, int op) { //elem_print(evalue); assert(op == EXP.blit || op == EXP.assign || op == EXP.construct); @@ -6331,8 +6331,8 @@ Lagain: */ if (tybasic(evalue.ET.Tty) == TYstruct) { - type *t1 = evalue.ET.Ttag.Sstruct.Sarg1type; - type *t2 = evalue.ET.Ttag.Sstruct.Sarg2type; + type* t1 = evalue.ET.Ttag.Sstruct.Sarg1type; + type* t2 = evalue.ET.Ttag.Sstruct.Sarg2type; if (!t1 && !t2) { if (irs.target.os & Target.OS.Posix || sz > 8) @@ -6348,10 +6348,10 @@ Lagain: if (r == RTLSYM.MEMSETN) { - // void *_memsetn(void *p, void *value, int dim, int sizelem) + // void* _memsetn(void* p, void* value, int dim, int sizelem) evalue = addressElem(evalue, tb); - elem *esz = el_long(TYsize_t, sz); - elem *e = el_params(esz, edim, evalue, eptr, null); + elem* esz = el_long(TYsize_t, sz); + elem* e = el_params(esz, edim, evalue, eptr, null); e = el_bin(OPcall,TYnptr,el_var(getRtlsym(r)),e); return e; } @@ -6410,12 +6410,12 @@ Lagain: r == RTLSYM.MEMSET32 || r == RTLSYM.MEMSET64) { - elem *e = el_param(edim, evalue); + elem* e = el_param(edim, evalue); return el_bin(OPmemset,TYnptr,eptr,e); } else { - elem *e = el_params(edim, evalue, eptr, null); + elem* e = el_params(edim, evalue, eptr, null); return el_bin(OPcall,TYnptr,el_var(getRtlsym(r)),e); } } @@ -6430,12 +6430,12 @@ Lagain: private elem* fillHole(Symbol* stmp, size_t poffset, size_t offset2, size_t maxoff) { - elem *e = null; + elem* e = null; bool basealign = true; while (poffset < offset2) { - elem *e1; + elem* e1; if (tybasic(stmp.Stype.Tty) == TYnptr) e1 = el_var(stmp); else @@ -6475,7 +6475,7 @@ elem* fillHole(Symbol* stmp, size_t poffset, size_t offset2, size_t maxoff) * false if allocated by operator new, as the holes are already zeroed. */ -elem *toElemStructLit(StructLiteralExp sle, ref IRState irs, EXP op, Symbol *sym, bool fillHoles) +elem* toElemStructLit(StructLiteralExp sle, ref IRState irs, EXP op, Symbol* sym, bool fillHoles) { //printf("[%s] StructLiteralExp.toElem() %s\n", sle.loc.toChars(), sle.toChars()); //printf("\tblit = %s, sym = %p fillHoles = %d\n", op == EXP.blit, sym, fillHoles); @@ -6507,13 +6507,13 @@ elem *toElemStructLit(StructLiteralExp sle, ref IRState irs, EXP op, Symbol *sym { /* Use the struct declaration's init symbol */ - elem *e = el_var(toInitializer(sle.sd)); + elem* e = el_var(toInitializer(sle.sd)); e.ET = Type_toCtype(sle.sd.type); elem_setLoc(e, sle.loc); if (sym) { - elem *ev = el_var(sym); + elem* ev = el_var(sym); if (tybasic(ev.Ety) == TYnptr) ev = el_una(OPind, e.Ety, ev); ev.ET = e.ET; @@ -6530,9 +6530,9 @@ elem *toElemStructLit(StructLiteralExp sle, ref IRState irs, EXP op, Symbol *sym } // struct symbol to initialize with the literal - Symbol *stmp = sym ? sym : symbol_genauto(Type_toCtype(sle.sd.type)); + Symbol* stmp = sym ? sym : symbol_genauto(Type_toCtype(sle.sd.type)); - elem *e = null; + elem* e = null; /* If a field has explicit initializer (*sle.elements)[i] != null), * any other overlapped fields won't have initializer. It's asserted by @@ -6632,7 +6632,7 @@ elem *toElemStructLit(StructLiteralExp sle, ref IRState irs, EXP op, Symbol *sym VarDeclaration v = sle.sd.fields[i]; assert(!v.isThisDeclaration() || element.op == EXP.null_); - elem *e1; + elem* e1; if (tybasic(stmp.Stype.Tty) == TYnptr) { e1 = el_var(stmp); @@ -6642,7 +6642,7 @@ elem *toElemStructLit(StructLiteralExp sle, ref IRState irs, EXP op, Symbol *sym e1 = el_ptr(stmp); } - elem *ep = toElem(element, irs); + elem* ep = toElem(element, irs); Type t1b = v.type.toBasetype(); Type t2b = element.type.toBasetype(); @@ -6651,13 +6651,13 @@ elem *toElemStructLit(StructLiteralExp sle, ref IRState irs, EXP op, Symbol *sym e1 = el_bin(OPadd, TYnptr, e1, el_long(TYsize_t, v.offset)); if (t2b.implicitConvTo(t1b)) { - elem *esize = el_long(TYsize_t, t1b.size()); + elem* esize = el_long(TYsize_t, t1b.size()); ep = array_toPtr(element.type, ep); e1 = el_bin(OPmemcpy, TYnptr, e1, el_param(ep, esize)); } else { - elem *edim = el_long(TYsize_t, t1b.size() / t2b.size()); + elem* edim = el_long(TYsize_t, t1b.size() / t2b.size()); e1 = setArray(element, e1, edim, t2b, ep, irs, op == EXP.construct ? EXP.blit : op); } e = el_combine(e, e1); @@ -6750,7 +6750,7 @@ elem *toElemStructLit(StructLiteralExp sle, ref IRState irs, EXP op, Symbol *sym e = el_combine(e, e2); } - elem *ev = el_var(stmp); + elem* ev = el_var(stmp); ev.ET = Type_toCtype(sle.sd.type); e = el_combine(e, ev); elem_setLoc(e, sle.loc); @@ -6770,7 +6770,7 @@ elem *toElemStructLit(StructLiteralExp sle, ref IRState irs, EXP op, Symbol *sym * er with destructors appended */ -elem *appendDtors(ref IRState irs, elem *er, size_t starti, size_t endi) +elem* appendDtors(ref IRState irs, elem* er, size_t starti, size_t endi) { //printf("appendDtors(%d .. %d)\n", cast(int)starti, cast(int)endi); @@ -6781,10 +6781,10 @@ elem *appendDtors(ref IRState irs, elem *er, size_t starti, size_t endi) /* Build edtors, an expression that calls destructors on all the variables * going out of the scope starti..endi */ - elem *edtors = null; + elem* edtors = null; foreach (i; starti .. endi) { - elem *ed = (*irs.varsInScope)[i]; + elem* ed = (*irs.varsInScope)[i]; if (ed) // if not skipped { //printf("appending dtor\n"); @@ -6797,7 +6797,7 @@ elem *appendDtors(ref IRState irs, elem *er, size_t starti, size_t endi) return er; if (irs.target.os == Target.OS.Windows && !irs.target.isX86_64) // Win32 { - BlockState *blx = irs.blx; + BlockState* blx = irs.blx; nteh_declarvars(blx); } @@ -6815,7 +6815,7 @@ elem *appendDtors(ref IRState irs, elem *er, size_t starti, size_t endi) for (pe = &er; (*pe).Eoper == OPcomma; pe = &(*pe).E2) { } - elem *erx = *pe; + elem* erx = *pe; if (erx.Eoper == OPconst || erx.Eoper == OPrelconst) { @@ -6825,8 +6825,8 @@ elem *appendDtors(ref IRState irs, elem *er, size_t starti, size_t endi) { /* Lvalue, take a pointer to it */ - elem *ep = el_una(OPaddr, TYnptr, erx); - elem *e = el_same(ep); + elem* ep = el_una(OPaddr, TYnptr, erx); + elem* e = el_same(ep); ep = el_combine(ep, edtors); ep = el_combine(ep, e); e = el_una(OPind, erx.Ety, ep); @@ -6835,7 +6835,7 @@ elem *appendDtors(ref IRState irs, elem *er, size_t starti, size_t endi) } else { - elem *e = el_copytotmp(erx); + elem* e = el_copytotmp(erx); erx = el_combine(erx, edtors); *pe = el_combine(erx, e); } @@ -6847,16 +6847,16 @@ elem *appendDtors(ref IRState irs, elem *er, size_t starti, size_t endi) * for insertion into the parameter list. */ -elem *filelinefunction(ref IRState irs, const ref Loc loc) +elem* filelinefunction(ref IRState irs, const ref Loc loc) { const(char)* id = loc.filename; size_t len = strlen(id); - Symbol *si = toStringSymbol(id, len, 1); - elem *efilename = el_pair(TYdarray, el_long(TYsize_t, len), el_ptr(si)); + Symbol* si = toStringSymbol(id, len, 1); + elem* efilename = el_pair(TYdarray, el_long(TYsize_t, len), el_ptr(si)); if (irs.target.os == Target.OS.Windows && irs.target.isX86_64) efilename = addressElem(efilename, Type.tstring, true); - elem *elinnum = el_long(TYint, loc.linnum); + elem* elinnum = el_long(TYint, loc.linnum); const(char)* s = ""; FuncDeclaration fd = irs.getFunc(); @@ -6867,7 +6867,7 @@ elem *filelinefunction(ref IRState irs, const ref Loc loc) len = strlen(s); si = toStringSymbol(s, len, 1); - elem *efunction = el_pair(TYdarray, el_long(TYsize_t, len), el_ptr(si)); + elem* efunction = el_pair(TYdarray, el_long(TYsize_t, len), el_ptr(si)); if (irs.target.os == Target.OS.Windows && irs.target.isX86_64) efunction = addressElem(efunction, Type.tstring, true); @@ -6976,7 +6976,7 @@ elem* locToFileElem(const ref IRState irs, const ref Loc loc) { * Returns: * generated call */ -elem *callCAssert(ref IRState irs, const ref Loc loc, Expression exp, Expression emsg, const(char)* str) +elem* callCAssert(ref IRState irs, const ref Loc loc, Expression exp, Expression emsg, const(char)* str) { //printf("callCAssert.toElem() %s\n", e.toChars()); Module m = cast(Module)irs.blx._module; @@ -6989,7 +6989,7 @@ elem *callCAssert(ref IRState irs, const ref Loc loc, Expression exp, Expression if (fd) id = fd.toPrettyChars(); const len = strlen(id); - Symbol *si = toStringSymbol(id, len, 1); + Symbol* si = toStringSymbol(id, len, 1); return el_ptr(si); } @@ -6999,12 +6999,12 @@ elem *callCAssert(ref IRState irs, const ref Loc loc, Expression exp, Expression /* If the source file name has changed, probably due * to a #line directive. */ - elem *efilename; + elem* efilename; if (loc.filename && strcmp(loc.filename, mname) != 0) { const(char)* id = loc.filename; size_t len = strlen(id); - Symbol *si = toStringSymbol(id, len, 1); + Symbol* si = toStringSymbol(id, len, 1); efilename = el_ptr(si); } else @@ -7012,7 +7012,7 @@ elem *callCAssert(ref IRState irs, const ref Loc loc, Expression exp, Expression efilename = toEfilenamePtr(m); } - elem *elmsg; + elem* elmsg; if (emsg) { // Assuming here that emsg generates a 0 terminated string @@ -7024,20 +7024,20 @@ elem *callCAssert(ref IRState irs, const ref Loc loc, Expression exp, Expression // Generate a message out of the assert expression const(char)* id = exp.toChars(); const len = strlen(id); - Symbol *si = toStringSymbol(id, len, 1); + Symbol* si = toStringSymbol(id, len, 1); elmsg = el_ptr(si); } else { assert(str); const len = strlen(str); - Symbol *si = toStringSymbol(str, len, 1); + Symbol* si = toStringSymbol(str, len, 1); elmsg = el_ptr(si); } auto eline = el_long(TYint, loc.linnum); - elem *ea; + elem* ea; if (irs.target.os == Target.OS.OSX) { // __assert_rtn(func, file, line, msg); @@ -7047,7 +7047,7 @@ elem *callCAssert(ref IRState irs, const ref Loc loc, Expression exp, Expression return ea; } - Symbol *assertSym; + Symbol* assertSym; elem* params; with (TargetC.Runtime) switch (irs.target.c.runtime) { @@ -7077,9 +7077,9 @@ elem *callCAssert(ref IRState irs, const ref Loc loc, Expression exp, Expression * Returns: * generated instruction */ -elem *genHalt(const ref Loc loc) +elem* genHalt(const ref Loc loc) { - elem *e = el_calloc(); + elem* e = el_calloc(); e.Ety = TYnoreturn; e.Eoper = OPhalt; elem_setLoc(e, loc); diff --git a/compiler/src/dmd/expressionsem.d b/compiler/src/dmd/expressionsem.d index 526ec6e34113..394bb2d9f423 100644 --- a/compiler/src/dmd/expressionsem.d +++ b/compiler/src/dmd/expressionsem.d @@ -308,7 +308,7 @@ extern (D) bool findTempDecl(DotTemplateInstanceExp exp, Scope* sc) * Returns: * String literal, or `null` if error happens. */ -StringExp semanticString(Scope *sc, Expression exp, const char* s) +StringExp semanticString(Scope* sc, Expression exp, const char* s) { sc = sc.startCTFE(); exp = exp.expressionSemantic(sc); @@ -825,7 +825,7 @@ extern(D) bool arrayExpressionSemantic( * Returns: * The expression that copy constructs or moves the value. */ -extern (D) Expression doCopyOrMove(Scope *sc, Expression e, Type t, bool nrvo, bool move = false) +extern (D) Expression doCopyOrMove(Scope* sc, Expression e, Type t, bool nrvo, bool move = false) { //printf("doCopyOrMove() %s\n", toChars(e)); StructDeclaration sd; @@ -1565,7 +1565,7 @@ Expression resolvePropertiesOnly(Scope* sc, Expression e1) * Returns: * `s` turned into an expression, `ErrorExp` if an error occurred */ -Expression symbolToExp(Dsymbol s, const ref Loc loc, Scope *sc, bool hasOverloads) +Expression symbolToExp(Dsymbol s, const ref Loc loc, Scope* sc, bool hasOverloads) { static if (LOGSEMANTIC) { @@ -7648,7 +7648,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor result = (cast(BinExp)e).reorderSettingAAElem(sc); } - private Expression compileIt(MixinExp exp, Scope *sc) + private Expression compileIt(MixinExp exp, Scope* sc) { OutBuffer buf; if (expressionsToString(buf, sc, exp.exps, exp.loc, null, true)) @@ -12343,7 +12343,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor return result; } - void handleCatArgument(Expressions *arguments, Expression e, Type catType, bool isRightArg) + void handleCatArgument(Expressions* arguments, Expression e, Type catType, bool isRightArg) { auto tb = e.type.toBasetype(); diff --git a/compiler/src/dmd/func.d b/compiler/src/dmd/func.d index 70f4c8303a76..887878c8cff3 100644 --- a/compiler/src/dmd/func.d +++ b/compiler/src/dmd/func.d @@ -277,7 +277,7 @@ extern (C++) class FuncDeclaration : Declaration /// Sibling nested functions which called this one FuncDeclarations siblingCallers; - FuncDeclarations *inlinedNestedCallees; + FuncDeclarations* inlinedNestedCallees; /// In case of failed `@safe` inference, store the error that made the function `@system` for /// better diagnostics diff --git a/compiler/src/dmd/glue.d b/compiler/src/dmd/glue.d index c9952bc95a21..56bdb2dde015 100644 --- a/compiler/src/dmd/glue.d +++ b/compiler/src/dmd/glue.d @@ -72,7 +72,7 @@ import dmd.utils; // Used in e2ir.d -elem *toEfilenamePtr(Module m) +elem* toEfilenamePtr(Module m) { //printf("toEfilenamePtr(%s)\n", m.toChars()); const(char)* id = m.srcfile.toChars(); @@ -400,7 +400,7 @@ extern (D) bool obj_includelib(scope const char[] name) nothrow return objmod.includelib(name); } -void obj_startaddress(Symbol *s) +void obj_startaddress(Symbol* s) { return objmod.startaddress(s); } @@ -420,7 +420,7 @@ void FuncDeclaration_toObjFile(FuncDeclaration fd, bool multiobj) version (none) { //printf("line = %d\n", getWhere() / LINEINC); - EEcontext *ee = env.getEEcontext(); + EEcontext* ee = env.getEEcontext(); if (ee.EEcompile == 2) { if (ee.EElinnum < (getWhere() / LINEINC) || @@ -501,8 +501,8 @@ void FuncDeclaration_toObjFile(FuncDeclaration fd, bool multiobj) return; } - Symbol *s = toSymbol(fd); // may set skipCodegen - func_t *f = s.Sfunc; + Symbol* s = toSymbol(fd); // may set skipCodegen + func_t* f = s.Sfunc; if (fd.skipCodegen) // test it again, as toSymbol() might have set it return; @@ -600,7 +600,7 @@ void FuncDeclaration_toObjFile(FuncDeclaration fd, bool multiobj) s.Sclass = SC.global; } - symtab_t *symtabsave = cstate.CSpsymtab; + symtab_t* symtabsave = cstate.CSpsymtab; cstate.CSpsymtab = &f.Flocsym; // Find module m for this function @@ -617,8 +617,8 @@ void FuncDeclaration_toObjFile(FuncDeclaration fd, bool multiobj) Label*[void*] labels = null; IRState irs = IRState(m, fd, &varsInScope, &deferToObj, &labels, &global.params, &target, global.errorSink); - Symbol *shidden = null; - Symbol *sthis = null; + Symbol* shidden = null; + Symbol* sthis = null; tym_t tyf = tybasic(s.Stype.Tty); //printf("linkage = %d, tyf = x%x\n", linkage, tyf); int reverse = tyrevfunc(s.Stype.Tty); @@ -630,7 +630,7 @@ void FuncDeclaration_toObjFile(FuncDeclaration fd, bool multiobj) { // If function returns a struct, put a pointer to that // as the first argument - .type *thidden = Type_toCtype(tf.next.pointerTo()); + .type* thidden = Type_toCtype(tf.next.pointerTo()); const hiddenparamLen = 5 + 10 + 1; char[hiddenparamLen] hiddenparam = void; __gshared uint hiddenparami; // how many we've generated so far @@ -742,7 +742,7 @@ void FuncDeclaration_toObjFile(FuncDeclaration fd, bool multiobj) { /* swap shidden and sthis */ - Symbol *sp = params[0]; + Symbol* sp = params[0]; params[0] = params[1]; params[1] = sp; } @@ -798,9 +798,9 @@ void FuncDeclaration_toObjFile(FuncDeclaration fd, bool multiobj) if ((target.isX86_64 || target.isAArch64) && target.os & Target.OS.Posix) { - type *t = type_struct_class("__va_argsave_t", 16, 8 * 6 + 8 * 16 + 8 * 3 + 8, null, null, false, false, true, false); + type* t = type_struct_class("__va_argsave_t", 16, 8 * 6 + 8 * 16 + 8 * 3 + 8, null, null, false, false, true, false); // The backend will pick this up by name - Symbol *sv = symbol_name("__va_argsave", SC.auto_, t); + Symbol* sv = symbol_name("__va_argsave", SC.auto_, t); sv.Stype.Tty |= mTYvolatile; symbol_add(sv); } @@ -808,9 +808,9 @@ void FuncDeclaration_toObjFile(FuncDeclaration fd, bool multiobj) // Declare _argptr, but only for D files if (!irs.Cfile) { - Symbol *sa = toSymbol(fd.v_argptr); + Symbol* sa = toSymbol(fd.v_argptr); symbol_add(sa); - elem *e = el_bin(OPva_start, TYnptr, el_ptr(sa), lastParam ? el_ptr(lastParam) : el_long(TYnptr, 0)); + elem* e = el_bin(OPva_start, TYnptr, el_ptr(sa), lastParam ? el_ptr(lastParam) : el_long(TYnptr, 0)); block_appendexp(irs.blx.curblock, e); } } @@ -835,7 +835,7 @@ void FuncDeclaration_toObjFile(FuncDeclaration fd, bool multiobj) StringExp se = StringExp.create(Loc.initial, s.Sident.ptr); se.type = Type.tstring; se.type = se.type.typeSemantic(Loc.initial, null); - Expressions *exps = new Expressions(); + Expressions* exps = new Expressions(); exps.push(se); FuncDeclaration fdpro = FuncDeclaration.genCfunc(null, Type.tvoid, "trace_pro"); Expression ec = VarExp.create(Loc.initial, fdpro); @@ -861,9 +861,9 @@ void FuncDeclaration_toObjFile(FuncDeclaration fd, bool multiobj) { // Adjust the 'this' pointer instead of using a thunk assert(irs.sthis); - elem *ethis = el_var(irs.sthis); + elem* ethis = el_var(irs.sthis); ethis = fixEthis2(ethis, fd); - elem *e = el_bin(OPminass, TYnptr, ethis, el_long(TYsize_t, fd.interfaceVirtual.offset)); + elem* e = el_bin(OPminass, TYnptr, ethis, el_long(TYsize_t, fd.interfaceVirtual.offset)); block_appendexp(irs.blx.curblock, e); } @@ -900,7 +900,7 @@ void FuncDeclaration_toObjFile(FuncDeclaration fd, bool multiobj) { if (b.bc == BC.ret) { - elem *ethis = el_var(sthis); + elem* ethis = el_var(sthis); ethis = fixEthis2(ethis, fd); b.bc = BC.retexp; b.Belem = el_combine(b.Belem, ethis); @@ -1073,8 +1073,8 @@ alias symbols = Array!(Symbol*); struct Glue { - elem *eictor; - Symbol *ictorlocalgot; + elem* eictor; + Symbol* ictorlocalgot; symbols sctors; // static constructorss StaticDtorDeclarations ectorgates; @@ -1186,15 +1186,15 @@ private void obj_write_deferred(ref OutBuffer objbuf, Library library, ref Dsymb */ extern (D) -private Symbol *callFuncsAndGates(Module m, Symbol*[] sctors, StaticDtorDeclaration[] ectorgates, +private Symbol* callFuncsAndGates(Module m, Symbol*[] sctors, StaticDtorDeclaration[] ectorgates, const(char)* id) { if (!sctors.length && !ectorgates.length) return null; - Symbol *sctor = null; + Symbol* sctor = null; - __gshared type *t; + __gshared type* t; if (!t) { /* t will be the type of the functions generated: @@ -1207,23 +1207,23 @@ private Symbol *callFuncsAndGates(Module m, Symbol*[] sctors, StaticDtorDeclarat localgot = null; sctor = toSymbolX(m, id, SC.global, t, "FZv"); cstate.CSpsymtab = &sctor.Sfunc.Flocsym; - elem *ector = null; + elem* ector = null; foreach (f; ectorgates) { - Symbol *s = toSymbol(f.vgate); - elem *e = el_var(s); + Symbol* s = toSymbol(f.vgate); + elem* e = el_var(s); e = el_bin(OPaddass, TYint, e, el_long(TYint, 1)); ector = el_combine(ector, e); } foreach (s; sctors) { - elem *e = el_una(OPucall, TYvoid, el_var(s)); + elem* e = el_una(OPucall, TYvoid, el_var(s)); ector = el_combine(ector, e); } - block *b = block_calloc(); + block* b = block_calloc(); b.bc = BC.ret; b.Belem = ector; sctor.Sfunc.Fstartline.Sfilename = m.arg.xarraydup.ptr; @@ -1308,7 +1308,7 @@ private void obj_end(ref OutBuffer objbuf, Library library, const(char)[] objfil private void genObjFile(Module m, bool multiobj) { - //EEcontext *ee = env.getEEcontext(); + //EEcontext* ee = env.getEEcontext(); //printf("Module.genobjfile(multiobj = %d) %s\n", multiobj, m.toChars()); @@ -1339,7 +1339,7 @@ private void genObjFile(Module m, bool multiobj) assert(mod); if (mod.sictor || mod.sctor || mod.sdtor || mod.ssharedctor || mod.sshareddtor) { - Symbol *s = toSymbol(mod); + Symbol* s = toSymbol(mod); //objextern(s); //if (!s.Sxtrnnum) objextdef(s.Sident); if (!s.Sxtrnnum) @@ -1348,7 +1348,7 @@ private void genObjFile(Module m, bool multiobj) //#if 0 /* This should work, but causes optlink to fail in common/newlib.asm */ // objextdef(s.Sident); //#else - Symbol *sref = symbol_generate(SC.static_, type_fake(TYnptr)); + Symbol* sref = symbol_generate(SC.static_, type_fake(TYnptr)); sref.Sfl = FL.data; auto dtb = DtBuilder(0); dtb.xoff(s, 0, TYnptr); @@ -1423,7 +1423,7 @@ private void genObjFile(Module m, bool multiobj) /* Generate * private bit[numlines] __bcoverage; */ - Symbol *bcov = symbol_calloc("__bcoverage"); + Symbol* bcov = symbol_calloc("__bcoverage"); bcov.Stype = type_fake(TYuint); bcov.Stype.Tcount++; bcov.Sclass = SC.static_; @@ -1446,15 +1446,15 @@ private void genObjFile(Module m, bool multiobj) /* t will be the type of the functions generated: * extern (C) void func(); */ - type *t = type_function(TYnfunc, null, false, tstypes[TYvoid]); + type* t = type_function(TYnfunc, null, false, tstypes[TYvoid]); t.Tmangle = Mangle.c; m.sictor = toSymbolX(m, "__modictor", SC.global, t, "FZv"); cstate.CSpsymtab = &m.sictor.Sfunc.Flocsym; localgot = glue.ictorlocalgot; - elem *ecov = el_pair(TYdarray, el_long(TYsize_t, m.numlines), el_ptr(m.cov)); - elem *ebcov = el_pair(TYdarray, el_long(TYsize_t, m.numlines), el_ptr(bcov)); + elem* ecov = el_pair(TYdarray, el_long(TYsize_t, m.numlines), el_ptr(m.cov)); + elem* ebcov = el_pair(TYdarray, el_long(TYsize_t, m.numlines), el_ptr(bcov)); if (target.os == Target.OS.Windows && target.isX86_64) { @@ -1462,11 +1462,11 @@ private void genObjFile(Module m, bool multiobj) ebcov = addressElem(ebcov, Type.tvoid.arrayOf(), false); } - elem *efilename = toEfilename(m); + elem* efilename = toEfilename(m); if (target.os == Target.OS.Windows && target.isX86_64) efilename = addressElem(efilename, Type.tstring, true); - elem *e = el_params( + elem* e = el_params( el_long(TYuchar, global.params.covPercent), ecov, ebcov, @@ -1485,7 +1485,7 @@ private void genObjFile(Module m, bool multiobj) { localgot = glue.ictorlocalgot; - block *b = block_calloc(); + block* b = block_calloc(); b.bc = BC.ret; b.Belem = glue.eictor; m.sictor.Sfunc.Fstartline.Sfilename = m.arg.xarraydup.ptr; @@ -1630,7 +1630,7 @@ private bool entryPointFunctions(Obj objmod, FuncDeclaration fd) * Generate elem that is a dynamic array slice of the module file name. */ -private elem *toEfilename(Module m) +private elem* toEfilename(Module m) { //printf("toEfilename(%s)\n", m.toChars()); const(char)* id = m.srcfile.toChars(); diff --git a/compiler/src/dmd/iasm.d b/compiler/src/dmd/iasm.d index 7eb51d995ce1..d04bef3e2a82 100644 --- a/compiler/src/dmd/iasm.d +++ b/compiler/src/dmd/iasm.d @@ -39,7 +39,7 @@ else /************************ AsmStatement ***************************************/ -Statement asmSemantic(AsmStatement s, Scope *sc) +Statement asmSemantic(AsmStatement s, Scope* sc) { //printf("AsmStatement.semantic()\n"); @@ -89,7 +89,7 @@ Statement asmSemantic(AsmStatement s, Scope *sc) /************************ CAsmDeclaration ************************************/ -void asmSemantic(CAsmDeclaration ad, Scope *sc) +void asmSemantic(CAsmDeclaration ad, Scope* sc) { version (NoBackend) { diff --git a/compiler/src/dmd/iasmdmd.d b/compiler/src/dmd/iasmdmd.d index 123c8ac48a2d..0a46e68ced63 100644 --- a/compiler/src/dmd/iasmdmd.d +++ b/compiler/src/dmd/iasmdmd.d @@ -82,11 +82,11 @@ public void iasm_term() * Returns: * `s` on success, ErrorStatement if errors happened */ -public Statement inlineAsmSemantic(InlineAsmStatement s, Scope *sc) +public Statement inlineAsmSemantic(InlineAsmStatement s, Scope* sc) { //printf("InlineAsmStatement.semantic()\n"); - OP *o; + OP* o; OPND[4] opnds; int nOps; PTRNTAB ptb; @@ -657,7 +657,7 @@ void asm_chktok(TOK toknum, const(char)* msg) /******************************* */ -PTRNTAB asm_classify(OP *pop, OPND[] opnds, out int outNumops) +PTRNTAB asm_classify(OP* pop, OPND[] opnds, out int outNumops) { opflag_t[4] opflags; bool bInvalid64bit = false; @@ -780,7 +780,7 @@ RETRY: // Rewrite CALL $+disp from rel8 to rel32 opflags[0] = CONSTRUCT_FLAGS(OpndSize._32, _rel, _flbl, 0); - PTRNTAB1 *table1; + PTRNTAB1* table1; for (table1 = pop.ptb.pptb1; table1.opcode != ASM_END; table1++) { @@ -856,7 +856,7 @@ RETRY: if (log) { printf("`%s`\n", asm_opstr(pop)); } if (log) { printf("opflags1 = "); asm_output_flags(opflags[0]); printf("\n"); } if (log) { printf("opflags2 = "); asm_output_flags(opflags[1]); printf("\n"); } - PTRNTAB2 *table2; + PTRNTAB2* table2; for (table2 = pop.ptb.pptb2; table2.opcode != ASM_END; table2++) @@ -981,7 +981,7 @@ version (none) if (log) { printf("opflags1 = "); asm_output_flags(opflags[0]); printf("\n"); } if (log) { printf("opflags2 = "); asm_output_flags(opflags[1]); printf("\n"); } if (log) { printf("opflags3 = "); asm_output_flags(opflags[2]); printf("\n"); } - PTRNTAB3 *table3; + PTRNTAB3* table3; for (table3 = pop.ptb.pptb3; table3.opcode != ASM_END; table3++) @@ -1051,7 +1051,7 @@ version (none) } case 4: { - PTRNTAB4 *table4; + PTRNTAB4* table4; for (table4 = pop.ptb.pptb4; table4.opcode != ASM_END; table4++) @@ -1326,9 +1326,9 @@ opflag_t asm_determine_operand_flags(ref OPND popnd) * it to the code generated for this block. */ -code *asm_emit(Loc loc, +code* asm_emit(Loc loc, uint usNumops, PTRNTAB ptb, - OP *pop, OPND[] opnds) + OP* pop, OPND[] opnds) { ubyte[16] instruction = void; size_t insIdx = 0; @@ -1341,8 +1341,8 @@ code *asm_emit(Loc loc, void emit(ubyte op) { } } // uint us; - code *pc = null; - OPND *popndTmp = null; + code* pc = null; + OPND* popndTmp = null; //ASM_OPERAND_TYPE aopty1 = _reg , aopty2 = 0, aopty3 = 0; ASM_MODIFIERS[2] amods = _normal; OpndSize[3] uSizemaskTable; @@ -2094,7 +2094,7 @@ L3: /******************************* */ -opflag_t asm_float_type_size(Type ptype, opflag_t *pusFloat) +opflag_t asm_float_type_size(Type ptype, opflag_t* pusFloat) { *pusFloat = 0; @@ -2405,7 +2405,7 @@ L2: void asm_make_modrm_byte( void delegate(ubyte) emit, - code *pc, + code* pc, opflag_t usFlags, scope OPND[] opnds) { @@ -3414,7 +3414,7 @@ void asm_token() /******************************* */ -void asm_token_trans(Token *tok) +void asm_token_trans(Token* tok) { asmstate.tokValue = TOK.endOfFile; if (tok) @@ -3481,7 +3481,7 @@ OpndSize asm_type_size(Type ptype, bool bPtr) * for optimizer. */ -code *asm_da_parse(OP *pop) +code* asm_da_parse(OP* pop) { CodeBuilder cdb; cdb.ctor(); @@ -3523,7 +3523,7 @@ code *asm_da_parse(OP *pop) * Parse DB, DW, DD, DQ and DT expressions. */ -code *asm_db_parse(OP *pop) +code* asm_db_parse(OP* pop) { union DT { @@ -3621,7 +3621,7 @@ code *asm_db_parse(OP *pop) case TOK.identifier: { Expression e = IdentifierExp.create(asmstate.loc, asmstate.tok.ident); - Scope *sc = asmstate.sc.startCTFE(); + Scope* sc = asmstate.sc.startCTFE(); e = e.expressionSemantic(sc); sc.endCTFE(); e = e.ctfeInterpret(); @@ -3688,7 +3688,7 @@ code *asm_db_parse(OP *pop) cdb.genlinnum(Srcpos.create(sl.filename.ptr, sl.linnum, sl.charnum)); } cdb.genasm(bytes.peekSlice()); - code *c = cdb.finish(); + code* c = cdb.finish(); asmstate.statement.regs |= /* mES| */ ALLREGS; asmstate.bReturnax = true; @@ -3718,7 +3718,7 @@ int asm_getnum() case TOK.identifier: { Expression e = IdentifierExp.create(asmstate.loc, asmstate.tok.ident); - Scope *sc = asmstate.sc.startCTFE(); + Scope* sc = asmstate.sc.startCTFE(); e = e.expressionSemantic(sc); sc.endCTFE(); e = e.ctfeInterpret(); @@ -4540,7 +4540,7 @@ void asm_primary_exp(out OPND o1) */ TOK tryExpressionToOperand(Expression e, out OPND o1, out Dsymbol s) { - Scope *sc = asmstate.sc.startCTFE(); + Scope* sc = asmstate.sc.startCTFE(); e = e.expressionSemantic(sc); sc.endCTFE(); e = e.ctfeInterpret(); diff --git a/compiler/src/dmd/iasmgcc.d b/compiler/src/dmd/iasmgcc.d index 1410e0a22991..0961354bf386 100644 --- a/compiler/src/dmd/iasmgcc.d +++ b/compiler/src/dmd/iasmgcc.d @@ -37,17 +37,17 @@ import dmd.statementsem; * Returns: * the completed gcc asm statement, or null if errors occurred */ -public Statement gccAsmSemantic(GccAsmStatement s, Scope *sc) +public Statement gccAsmSemantic(GccAsmStatement s, Scope* sc) { //printf("GccAsmStatement.semantic()\n"); const bool doUnittests = global.params.parsingUnittestsRequired(); scope p = new Parser!ASTCodegen(sc._module, ";", false, global.errorSink, &global.compileEnv, doUnittests); // Make a safe copy of the token list before parsing. - Token *toklist = null; + Token* toklist = null; Token **ptoklist = &toklist; - for (Token *token = s.tokens; token; token = token.next) + for (Token* token = s.tokens; token; token = token.next) { *ptoklist = p.allocateToken(); memcpy(*ptoklist, token, Token.sizeof); @@ -126,7 +126,7 @@ public Statement gccAsmSemantic(GccAsmStatement s, Scope *sc) * ad = asm declaration * sc = the scope where the asm declaration is located */ -public void gccAsmSemantic(CAsmDeclaration ad, Scope *sc) +public void gccAsmSemantic(CAsmDeclaration ad, Scope* sc) { import dmd.typesem : pointerTo; ad.code = semanticString(sc, ad.code, "asm definition"); @@ -254,9 +254,9 @@ Lerror: * Returns: * array of parsed clobber expressions */ -Expressions *parseExtAsmClobbers(Parser)(Parser p) +Expressions* parseExtAsmClobbers(Parser)(Parser p) { - Expressions *clobbers; + Expressions* clobbers; while (1) { @@ -305,9 +305,9 @@ Lerror: * Returns: * array of parsed goto labels */ -Identifiers *parseExtAsmGotoLabels(Parser)(Parser p) +Identifiers* parseExtAsmGotoLabels(Parser)(Parser p) { - Identifiers *labels; + Identifiers* labels; while (1) { diff --git a/compiler/src/dmd/intrange.d b/compiler/src/dmd/intrange.d index 242cac0b7e96..8395a84bb179 100644 --- a/compiler/src/dmd/intrange.d +++ b/compiler/src/dmd/intrange.d @@ -141,7 +141,7 @@ struct SignExtendedNumber SignExtendedNumber opBinary(string op : "*")(SignExtendedNumber rhs) { - // perform *saturated* multiplication, otherwise we may get bogus ranges + // perform* saturated* multiplication, otherwise we may get bogus ranges // like 0x10 * 0x10 == 0x100 == 0. /* Special handling for zeros: diff --git a/compiler/src/dmd/mtype.d b/compiler/src/dmd/mtype.d index 0e4d6552a778..81f8a98bc273 100644 --- a/compiler/src/dmd/mtype.d +++ b/compiler/src/dmd/mtype.d @@ -4059,7 +4059,7 @@ extern (C++) final class Parameter : ASTNode /*************************************** * Expands tuples in args in depth first order. Calls - * dg(void *ctx, size_t argidx, Parameter *arg) for each Parameter. + * dg(void* ctx, size_t argidx, Parameter* arg) for each Parameter. * If dg returns !=0, stops and returns that value else returns 0. * Use this function to avoid the O(N + N^2/2) complexity of * calculating dim and calling N times getNth. diff --git a/compiler/src/dmd/s2ir.d b/compiler/src/dmd/s2ir.d index faa393c4bd53..6f382a23f6e1 100644 --- a/compiler/src/dmd/s2ir.d +++ b/compiler/src/dmd/s2ir.d @@ -70,7 +70,7 @@ import dmd.backend.type; alias StmtState = dmd.stmtstate.StmtState!block; -void elem_setLoc(elem *e, const ref Loc loc) nothrow +void elem_setLoc(elem* e, const ref Loc loc) nothrow { srcpos_setLoc(e.Esrcpos, loc); } @@ -117,20 +117,20 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) void visitIf(IfStatement s) { - elem *e; - BlockState *blx = irs.blx; + elem* e; + BlockState* blx = irs.blx; //printf("IfStatement.toIR('%s')\n", s.condition.toChars()); StmtState mystate = StmtState(stmtstate, s); // bexit is the block that gets control after this IfStatement is done - block *bexit = mystate.breakBlock ? mystate.breakBlock : dmd.backend.global.block_calloc(); + block* bexit = mystate.breakBlock ? mystate.breakBlock : dmd.backend.global.block_calloc(); incUsage(irs, s.loc); e = toElemDtor(s.condition, irs); block_appendexp(blx.curblock, e); - block *bcond = blx.curblock; + block* bcond = blx.curblock; block_next(blx, BC.iftrue, null); bcond.appendSucc(blx.curblock); @@ -168,7 +168,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) Dsymbol sa = getDsymbol(e); FuncDeclaration f = sa.isFuncDeclaration(); assert(f); - Symbol *sym = toSymbol(f); + Symbol* sym = toSymbol(f); irs.startaddress = sym; } } @@ -178,13 +178,13 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) void visitDo(DoStatement s) { - BlockState *blx = irs.blx; + BlockState* blx = irs.blx; StmtState mystate = StmtState(stmtstate, s); mystate.breakBlock = block_calloc(blx); mystate.contBlock = block_calloc(blx); - block *bpre = blx.curblock; + block* bpre = blx.curblock; block_next(blx, BC.goto_, null); bpre.appendSucc(blx.curblock); @@ -208,7 +208,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) void visitFor(ForStatement s) { //printf("visit(ForStatement)) %u..%u\n", s.loc.linnum, s.endloc.linnum); - BlockState *blx = irs.blx; + BlockState* blx = irs.blx; StmtState mystate = StmtState(stmtstate, s); mystate.breakBlock = block_calloc(blx); @@ -216,9 +216,9 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) if (s._init) Statement_toIR(s._init, irs, &mystate); - block *bpre = blx.curblock; + block* bpre = blx.curblock; block_next(blx,BC.goto_,null); - block *bcond = blx.curblock; + block* bcond = blx.curblock; bpre.appendSucc(bcond); mystate.contBlock.appendSucc(bcond); if (s.condition) @@ -260,9 +260,9 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) void visitBreak(BreakStatement s) { - block *bbreak; - block *b; - BlockState *blx = irs.blx; + block* bbreak; + block* b; + BlockState* blx = irs.blx; bbreak = stmtstate.getBreakBlock(s.ident); assert(bbreak); @@ -287,9 +287,9 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) void visitContinue(ContinueStatement s) { - block *bcont; - block *b; - BlockState *blx = irs.blx; + block* bcont; + block* b; + BlockState* blx = irs.blx; //printf("ContinueStatement.toIR() %p\n", this); bcont = stmtstate.getContBlock(s.ident); @@ -316,13 +316,13 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) void visitGoto(GotoStatement s) { - BlockState *blx = irs.blx; + BlockState* blx = irs.blx; assert(s.label.statement); assert(s.tf == s.label.statement.tf); block* bdest = cast(block*)s.label.statement.extra; - block *b = blx.curblock; + block* b = blx.curblock; incUsage(irs, s.loc); b.appendSucc(bdest); block_setLoc(b, s.loc); @@ -333,8 +333,8 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) void visitLabel(LabelStatement s) { //printf("LabelStatement.toIR() %p, statement: `%s`\n", this, s.statement.toChars()); - BlockState *blx = irs.blx; - block *bc = blx.curblock; + BlockState* blx = irs.blx; + block* bc = blx.curblock; StmtState mystate = StmtState(stmtstate, s); mystate.ident = s.ident; @@ -353,7 +353,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) void visitSwitch(SwitchStatement s) { - BlockState *blx = irs.blx; + BlockState* blx = irs.blx; //printf("SwitchStatement.toIR()\n"); StmtState mystate = StmtState(stmtstate, s); @@ -383,13 +383,13 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) } incUsage(irs, s.loc); - elem *econd = toElemDtor(s.condition, irs); + elem* econd = toElemDtor(s.condition, irs); if (s.hasVars) { /* Generate a sequence of if-then-else blocks for the cases. */ if (econd.Eoper != OPvar) { - elem *e = exp2_copytotemp(econd); + elem* e = exp2_copytotemp(econd); block_appendexp(mystate.switchBlock, e); econd = e.E2; } @@ -397,9 +397,9 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) if (numcases) foreach (cs; *s.cases) { - elem *ecase = toElemDtor(cs.exp, irs); - elem *e = el_bin(OPeqeq, TYbool, el_copytree(econd), ecase); - block *b = blx.curblock; + elem* ecase = toElemDtor(cs.exp, irs); + elem* e = el_bin(OPeqeq, TYbool, el_copytree(econd), ecase); + block* b = blx.curblock; block_appendexp(b, e); block* cb = cast(block*)cs.extra; block_next(blx, BC.iftrue, null); @@ -409,7 +409,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) /* The final 'else' clause goes to the default */ - block *b = blx.curblock; + block* b = blx.curblock; block_next(blx, BC.goto_, null); b.appendSucc(mystate.defaultBlock); @@ -461,11 +461,11 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) void visitCase(CaseStatement s) { - BlockState *blx = irs.blx; - block *bcase = blx.curblock; + BlockState* blx = irs.blx; + block* bcase = blx.curblock; block* cb = cast(block*)s.extra; block_next(blx, BC.goto_, cb); - block *bsw = stmtstate.getSwitchBlock(); + block* bsw = stmtstate.getSwitchBlock(); if (bsw.bc == BC.switch_) bsw.appendSucc(cb); // second entry in pair bcase.appendSucc(cb); @@ -477,9 +477,9 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) void visitDefault(DefaultStatement s) { - BlockState *blx = irs.blx; - block *bcase = blx.curblock; - block *bdefault = stmtstate.getDefaultBlock(); + BlockState* blx = irs.blx; + block* bcase = blx.curblock; + block* bdefault = stmtstate.getDefaultBlock(); block_next(blx,BC.goto_,bdefault); bcase.appendSucc(blx.curblock); if (!isAssertFalse(s.statement)) @@ -490,9 +490,9 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) void visitGotoDefault(GotoDefaultStatement s) { - block *b; - BlockState *blx = irs.blx; - block *bdest = stmtstate.getDefaultBlock(); + block* b; + BlockState* blx = irs.blx; + block* bdest = stmtstate.getDefaultBlock(); b = blx.curblock; @@ -505,9 +505,9 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) void visitGotoCase(GotoCaseStatement s) { - BlockState *blx = irs.blx; - block *bdest = cast(block*)s.cs.extra; - block *b = blx.curblock; + BlockState* blx = irs.blx; + block* bdest = cast(block*)s.cs.extra; + block* b = blx.curblock; // The rest is equivalent to GotoStatement @@ -522,7 +522,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) // We still need the call wrapped in SwitchErrorStatement to pass compiler error checks. assert(s.exp !is null, "SwitchErrorStatement needs to have a valid Expression."); - BlockState *blx = irs.blx; + BlockState* blx = irs.blx; //printf("SwitchErrorStatement.toIR(), exp = %s\n", s.exp ? s.exp.toChars() : ""); incUsage(irs, s.loc); @@ -535,13 +535,13 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) void visitReturn(ReturnStatement s) { //printf("s2ir.ReturnStatement: %s\n", toChars(s.exp)); - BlockState *blx = irs.blx; + BlockState* blx = irs.blx; BC bc; incUsage(irs, s.loc); void finish() { - block *finallyBlock; + block* finallyBlock; if (config.ehmethod != EHmethod.EH_DWARF && !irs.isNothrow() && (finallyBlock = stmtstate.getFinallyBlock()) != null) @@ -558,7 +558,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) return finish(); } - elem *e; + elem* e; FuncDeclaration func = irs.getFunc(); assert(func); @@ -568,7 +568,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) RET retmethod = retStyle(tf, func.needThis()); if (retmethod == RET.stack) { - elem *es; + elem* es; bool writetohp; /* If returning struct literal, write result @@ -680,7 +680,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) void visitExp(ExpStatement s) { - BlockState *blx = irs.blx; + BlockState* blx = irs.blx; //printf("ExpStatement.toIR(), exp: %p %s\n", s.exp, s.exp ? s.exp.toChars() : ""); if (!s.exp) @@ -732,18 +732,18 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) void visitUnrolledLoop(UnrolledLoopStatement s) { - BlockState *blx = irs.blx; + BlockState* blx = irs.blx; StmtState mystate = StmtState(stmtstate, s); mystate.breakBlock = block_calloc(blx); - block *bpre = blx.curblock; + block* bpre = blx.curblock; block_next(blx, BC.goto_, null); - block *bdo = blx.curblock; + block* bdo = blx.curblock; bpre.appendSucc(bdo); - block *bdox; + block* bdox; foreach (s2; *s.statements) { @@ -772,7 +772,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) { if (!s.statement) return; - BlockState *blx = irs.blx; + BlockState* blx = irs.blx; StmtState mystate = StmtState(stmtstate, s); if (mystate.prev.ident) @@ -822,10 +822,10 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) { // throw(exp) - BlockState *blx = irs.blx; + BlockState* blx = irs.blx; incUsage(irs, s.loc); - elem *e = toElemDtor(s.exp, irs); + elem* e = toElemDtor(s.exp, irs); const rtlthrow = config.ehmethod == EHmethod.EH_DWARF ? RTLSYM.THROWDWARF : RTLSYM.THROWC; e = el_bin(OPcall, TYvoid, el_var(getRtlsym(rtlthrow)),e); block_appendexp(blx.curblock, e); @@ -843,7 +843,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) void visitTryCatch(TryCatchStatement s) { - BlockState *blx = irs.blx; + BlockState* blx = irs.blx; if (blx.funcsym.Sfunc.Fflags3 & Feh_none) printf("visit %s\n", blx.funcsym.Sident.ptr); if (blx.funcsym.Sfunc.Fflags3 & Feh_none) assert(0); @@ -853,7 +853,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) StmtState mystate = StmtState(stmtstate, s); - block *tryblock = block_goto(blx,BC.goto_,null); + block* tryblock = block_goto(blx,BC.goto_,null); int previndex = blx.scope_index; tryblock.Blast_index = previndex; @@ -866,7 +866,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) tryblock.jcatchvar = symbol_genauto(type_fake(mTYvolatile | TYnptr)); blx.tryblock = tryblock; - block *breakblock = block_calloc(blx); + block* breakblock = block_calloc(blx); block_goto(blx,BC._try,null); if (s._body) { @@ -881,7 +881,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) blx.scope_index = previndex; // create new break block that follows all the catches - block *breakblock2 = block_calloc(blx); + block* breakblock2 = block_calloc(blx); blx.curblock.appendSucc(breakblock2); block_next(blx,BC.goto_,null); @@ -905,41 +905,41 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) * HALT */ // volatile so optimizer won't delete it - Symbol *seax = symbol_name("__EAX", SC.pseudo, type_fake(mTYvolatile | TYnptr)); + Symbol* seax = symbol_name("__EAX", SC.pseudo, type_fake(mTYvolatile | TYnptr)); seax.Sreglsw = 0; // EAX, RAX, whatevs symbol_add(seax); - Symbol *sedx = symbol_name("__EDX", SC.pseudo, type_fake(mTYvolatile | TYint)); + Symbol* sedx = symbol_name("__EDX", SC.pseudo, type_fake(mTYvolatile | TYint)); sedx.Sreglsw = 2; // EDX, RDX, whatevs symbol_add(sedx); - Symbol *shandler = symbol_name("__handler", SC.auto_, tstypes[TYint]); + Symbol* shandler = symbol_name("__handler", SC.auto_, tstypes[TYint]); symbol_add(shandler); - Symbol *seo = symbol_name("__exception_object", SC.auto_, tspvoid); + Symbol* seo = symbol_name("__exception_object", SC.auto_, tspvoid); symbol_add(seo); - elem *e1 = el_bin(OPeq, TYvoid, el_var(shandler), el_var(sedx)); // __handler = __RDX - elem *e2 = el_bin(OPeq, TYvoid, el_var(seo), el_var(seax)); // __exception_object = __RAX + elem* e1 = el_bin(OPeq, TYvoid, el_var(shandler), el_var(sedx)); // __handler = __RDX + elem* e2 = el_bin(OPeq, TYvoid, el_var(seo), el_var(seax)); // __exception_object = __RAX version (none) { // jcatchvar = *(__exception_object - target.ptrsize) - elem *e = el_bin(OPmin, TYnptr, el_var(seo), el_long(TYsize_t, target.ptrsize)); - elem *e3 = el_bin(OPeq, TYvoid, el_var(tryblock.jcatchvar), el_una(OPind, TYnptr, e)); + elem* e = el_bin(OPmin, TYnptr, el_var(seo), el_long(TYsize_t, target.ptrsize)); + elem* e3 = el_bin(OPeq, TYvoid, el_var(tryblock.jcatchvar), el_una(OPind, TYnptr, e)); } else { // jcatchvar = __dmd_catch_begin(__exception_object); - elem *ebegin = el_var(getRtlsym(RTLSYM.BEGIN_CATCH)); - elem *e = el_bin(OPcall, TYnptr, ebegin, el_var(seo)); - elem *e3 = el_bin(OPeq, TYvoid, el_var(tryblock.jcatchvar), e); + elem* ebegin = el_var(getRtlsym(RTLSYM.BEGIN_CATCH)); + elem* e = el_bin(OPcall, TYnptr, ebegin, el_var(seo)); + elem* e3 = el_bin(OPeq, TYvoid, el_var(tryblock.jcatchvar), e); } - block *bcatch = blx.curblock; + block* bcatch = blx.curblock; tryblock.appendSucc(bcatch); block_goto(blx, BC.jcatch, null); - block *defaultblock = block_calloc(blx); + block* defaultblock = block_calloc(blx); - block *bswitch = blx.curblock; + block* bswitch = blx.curblock; bswitch.Belem = el_combine(el_combine(e1, e2), el_combine(e3, el_var(shandler))); @@ -968,14 +968,14 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) Type tcatch = cs.type.toBasetype(); ClassDeclaration cd = tcatch.isClassHandle(); bool isCPPclass = cd.isCPPclass(); - Symbol *catchtype; + Symbol* catchtype; if (isCPPclass) { catchtype = toSymbolCpp(cd); if (i == 0) { // rewrite ebegin to use __cxa_begin_catch - Symbol *s2 = getRtlsym(RTLSYM.CXA_BEGIN_CATCH); + Symbol* s2 = getRtlsym(RTLSYM.CXA_BEGIN_CATCH); ebegin.Vsym = s2; } } @@ -986,7 +986,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) * insert if not already there, * log index in Action Table (i.e. switch case table) */ - func_t *f = blx.funcsym.Sfunc; + func_t* f = blx.funcsym.Sfunc; foreach (j, ct; f.typesTable[]) { @@ -999,7 +999,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) f.typesTable.push(catchtype); bswitch.Bswitch[i] = f.typesTable.length; // index starts at 1 L1: - block *bcase = blx.curblock; + block* bcase = blx.curblock; bswitch.appendSucc(bcase); if (cs.handler !is null) @@ -1012,7 +1012,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) if (cs.var && cs.var.offset) // if member of a closure { tym_t tym = totym(cs.var.type); - elem *ex = el_var(irs.sclosure); + elem* ex = el_var(irs.sclosure); ex = el_bin(OPadd, TYnptr, ex, el_long(TYsize_t, cs.var.offset)); ex = el_una(OPind, tym, ex); ex = el_bin(OPeq, tym, ex, el_var(toSymbol(cs.var))); @@ -1065,7 +1065,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) { if (cs.var) cs.var.csym = tryblock.jcatchvar; - block *bcatch = blx.curblock; + block* bcatch = blx.curblock; if (cs.type) bcatch.Bcatchtype = toSymbol(cs.type.toBasetype()); tryblock.appendSucc(bcatch); @@ -1098,7 +1098,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) if (cs.var && cs.var.offset) // if member of a closure { tym_t tym = totym(cs.var.type); - elem *ex = el_var(irs.sclosure); + elem* ex = el_var(irs.sclosure); ex = el_bin(OPadd, TYnptr, ex, el_long(TYsize_t, cs.var.offset)); ex = el_una(OPind, tym, ex); ex = el_bin(OPeq, tym, ex, el_var(toSymbol(cs.var))); @@ -1128,7 +1128,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) { //printf("TryFinallyStatement.toIR()\n"); - BlockState *blx = irs.blx; + BlockState* blx = irs.blx; if (config.ehmethod == EHmethod.EH_WIN32 && !(blx.funcsym.Sfunc.Fflags3 & Feh_none)) nteh_declarvars(blx); @@ -1137,7 +1137,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) * [0] start of try block code * [1] BC._finally */ - block *tryblock = block_goto(blx, BC.goto_, null); + block* tryblock = block_goto(blx, BC.goto_, null); int previndex = blx.scope_index; tryblock.Blast_index = previndex; @@ -1152,7 +1152,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) StmtState bodyirs = StmtState(stmtstate, s); - block *finallyblock = block_calloc(blx); + block* finallyblock = block_calloc(blx); tryblock.appendSucc(finallyblock); finallyblock.bc = BC._finally; @@ -1165,8 +1165,8 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) setScopeIndex(blx,blx.curblock,previndex); blx.scope_index = previndex; - block *breakblock = block_calloc(blx); - block *retblock = block_calloc(blx); + block* breakblock = block_calloc(blx); + block* retblock = block_calloc(blx); if (config.ehmethod == EHmethod.EH_DWARF && !(blx.funcsym.Sfunc.Fflags3 & Feh_none)) { @@ -1185,14 +1185,14 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) blx.curblock.appendSucc(breakblock); block_next(blx,BC.goto_,finallyblock); - block *landingPad = block_goto(blx,BC._finally,null); + block* landingPad = block_goto(blx,BC._finally,null); block_goto(blx,BC._lpad,null); // lpad is [0] finallyblock.appendSucc(blx.curblock); // start of finalybody is [1] finallyblock.appendSucc(breakblock); // breakblock is [2] /* Declare flag variable */ - Symbol *sflag = symbol_name("__flag", SC.auto_, tstypes[TYint]); + Symbol* sflag = symbol_name("__flag", SC.auto_, tstypes[TYint]); symbol_add(sflag); finallyblock.flag = sflag; finallyblock.b_ret = retblock; @@ -1203,19 +1203,19 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) * _flag = 0; */ // Make it volatile so optimizer won't delete it - Symbol *sreg = symbol_name("__EAX", SC.pseudo, type_fake(mTYvolatile | TYnptr)); + Symbol* sreg = symbol_name("__EAX", SC.pseudo, type_fake(mTYvolatile | TYnptr)); sreg.Sreglsw = 0; // EAX, RAX, whatevs symbol_add(sreg); - Symbol *seo = symbol_name("__exception_object", SC.auto_, tspvoid); + Symbol* seo = symbol_name("__exception_object", SC.auto_, tspvoid); symbol_add(seo); assert(!landingPad.Belem); - elem *e = el_bin(OPeq, TYvoid, el_var(seo), el_var(sreg)); + elem* e = el_bin(OPeq, TYvoid, el_var(seo), el_var(sreg)); landingPad.Belem = el_combine(e, el_bin(OPeq, TYvoid, el_var(sflag), el_long(TYint, 0))); /* Add code to BC._ret block: * (!_flag && _Unwind_Resume(exception_object)); */ - elem *eu = el_bin(OPcall, TYvoid, el_var(getRtlsym(RTLSYM.UNWIND_RESUME)), el_var(seo)); + elem* eu = el_bin(OPcall, TYvoid, el_var(getRtlsym(RTLSYM.UNWIND_RESUME)), el_var(seo)); eu = el_bin(OPandand, TYvoid, el_una(OPnot, TYbool, el_var(sflag)), eu); assert(!retblock.Belem); retblock.Belem = eu; @@ -1259,7 +1259,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) * But it makes for slower code, so only generate it for * non-optimized code. */ - elem *e = el_calloc(); + elem* e = el_calloc(); e.Ety = TYvoid; e.Eoper = OPhalt; elem_setLoc(e, s.loc); @@ -1269,14 +1269,14 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) block_next(blx,BC.exit,finallyblock); } - block *landingPad = block_goto(blx,BC._finally,null); + block* landingPad = block_goto(blx,BC._finally,null); block_goto(blx,BC._lpad,null); // lpad is [0] finallyblock.appendSucc(blx.curblock); // start of finalybody is [1] finallyblock.appendSucc(breakblock); // breakblock is [2] /* Declare flag variable */ - Symbol *sflag = symbol_name("__flag", SC.auto_, tstypes[TYint]); + Symbol* sflag = symbol_name("__flag", SC.auto_, tstypes[TYint]); symbol_add(sflag); finallyblock.flag = sflag; finallyblock.b_ret = retblock; @@ -1323,17 +1323,17 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) * The successors to BC._ret blocks are both the next outer BC.finally and the destination * after the unwinding is complete. */ - for (block *b = tryblock; b != finallyblock; b = b.Bnext) + for (block* b = tryblock; b != finallyblock; b = b.Bnext) { - block *btry = b.Btry; + block* btry = b.Btry; if (b.bc == BC.goto_ && b.numSucc() == 1) { - block *bdest = b.nthSucc(0); + block* bdest = b.nthSucc(0); if (btry && bdest.Btry != btry) { //printf("test1 b %p b.Btry %p bdest %p bdest.Btry %p\n", b, btry, bdest, bdest.Btry); - block *bfinally = btry.nthSucc(1); + block* bfinally = btry.nthSucc(1); if (bfinally == finallyblock) { b.appendSucc(finallyblock); @@ -1344,7 +1344,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) // If the goto exits a try block, then the finally block is also a successor if (b.bc == BC.goto_ && b.numSucc() == 2) // if goto exited a tryblock { - block *bdest = b.nthSucc(0); + block* bdest = b.nthSucc(0); // If the last finally block executed by the goto if (bdest.Btry == tryblock.Btry) @@ -1369,10 +1369,10 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) void visitInlineAsm(InlineAsmStatement s) // { .visit(irs, s); } { - block *bpre; - block *basm; - Symbol *sym; - BlockState *blx = irs.blx; + block* bpre; + block* basm; + Symbol* sym; + BlockState* blx = irs.blx; //printf("AsmStatement.toIR(asmcode = %x)\n", asmcode); bpre = blx.curblock; @@ -1383,7 +1383,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) basm.Balign = cast(ubyte)s.asmalign; // Loop through each instruction, fixing Dsymbols into Symbol's - for (code *c = cast(code*)s.asmcode; c; c = c.next) + for (code* c = cast(code*)s.asmcode; c; c = c.next) { switch (c.IFL1) { @@ -1392,7 +1392,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) { // FL.block and FL.blockoff have LabelDsymbol's - convert to blocks LabelDsymbol label = cast(LabelDsymbol)c.IEV1.Vlsym; - block *b = cast(block*)label.statement.extra; + block* b = cast(block*)label.statement.extra; basm.appendSucc(b); c.IEV1.Vblock = b; break; @@ -1418,7 +1418,7 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) case FL.block: { LabelDsymbol label = cast(LabelDsymbol)c.IEV2.Vlsym; - block *b = cast(block*)label.statement.extra; + block* b = cast(block*)label.statement.extra; basm.appendSucc(b); c.IEV2.Vblock = b; break; @@ -1476,13 +1476,13 @@ void Statement_toIR(Statement s, ref IRState irs, StmtState* stmtstate) * startblock = first block in function */ -void insertFinallyBlockCalls(block *startblock) +void insertFinallyBlockCalls(block* startblock) { int flagvalue = 0; // 0 is forunwind_resume - block *bcret = null; + block* bcret = null; - block *bcretexp = null; - Symbol *stmp; + block* bcretexp = null; + Symbol* stmp; enum log = false; @@ -1498,7 +1498,7 @@ void insertFinallyBlockCalls(block *startblock) block **pbnext; for (pb = &startblock; *pb; pb = pbnext) { - block *b = *pb; + block* b = *pb; pbnext = &b.Bnext; if (!b.Btry) continue; @@ -1519,7 +1519,7 @@ void insertFinallyBlockCalls(block *startblock) case BC.retexp: { // Rewrite into a BC.goto_ => BC.retexp - elem *e = b.Belem; + elem* e = b.Belem; tym_t ty = tybasic(e.Ety); if (ty == TYvoid) goto case BC.ret; @@ -1527,7 +1527,7 @@ void insertFinallyBlockCalls(block *startblock) { bcretexp = dmd.backend.global.block_calloc(); bcretexp.bc = BC.retexp; - type *t; + type* t; if ((ty == TYstruct || ty == TYarray) && e.ET) t = e.ET; else @@ -1571,25 +1571,25 @@ void insertFinallyBlockCalls(block *startblock) *x BC._ret * breakblock */ - block *breakblock = b.nthSucc(0); - block *lasttry = breakblock.Btry; - block *blast = b; + block* breakblock = b.nthSucc(0); + block* lasttry = breakblock.Btry; + block* blast = b; ++flagvalue; - for (block *bt = b.Btry; bt != lasttry; bt = bt.Btry) + for (block* bt = b.Btry; bt != lasttry; bt = bt.Btry) { assert(bt.bc == BC._try); - block *bf = bt.nthSucc(1); + block* bf = bt.nthSucc(1); if (bf.bc == BC.jcatch) continue; // skip try-catch assert(bf.bc == BC._finally); - block *retblock = bf.b_ret; + block* retblock = bf.b_ret; assert(retblock.bc == BC._ret); assert(retblock.numSucc() == 0); // Append (_flag = flagvalue) to b.Belem - Symbol *sflag = bf.flag; - elem *e = el_bin(OPeq, TYint, el_var(sflag), el_long(TYint, flagvalue)); + Symbol* sflag = bf.flag; + elem* e = el_bin(OPeq, TYint, el_var(sflag), el_long(TYint, flagvalue)); b.Belem = el_combine(b.Belem, e); if (blast.bc == BC.iftrue) @@ -1603,7 +1603,7 @@ void insertFinallyBlockCalls(block *startblock) } // Create new block, bnew, which will replace retblock - block *bnew = dmd.backend.global.block_calloc(); + block* bnew = dmd.backend.global.block_calloc(); /* Rewrite BC._ret block as: * if (sflag == flagvalue) goto breakblock; else goto bnew; @@ -1658,7 +1658,7 @@ void insertFinallyBlockCalls(block *startblock) * startblock = first block in function */ -void insertFinallyBlockGotos(block *startblock) +void insertFinallyBlockGotos(block* startblock) { enum log = false; @@ -1708,7 +1708,7 @@ void insertFinallyBlockGotos(block *startblock) } } -private void block_setLoc(block *b, const ref Loc loc) nothrow +private void block_setLoc(block* b, const ref Loc loc) nothrow { srcpos_setLoc(b.Bsrcpos, loc); } @@ -1739,7 +1739,7 @@ private bool isAssertFalse(const Statement s) nothrow * Generate code to set index into scope table. */ -private void setScopeIndex(BlockState *blx, block *b, int scope_index) +private void setScopeIndex(BlockState* blx, block* b, int scope_index) { if (config.ehmethod == EHmethod.EH_WIN32 && !(blx.funcsym.Sfunc.Fflags3 & Feh_none)) block_appendexp(b, nteh_setScopeTableIndex(blx, scope_index)); @@ -1749,9 +1749,9 @@ private void setScopeIndex(BlockState *blx, block *b, int scope_index) * Allocate a new block, and set the tryblock. */ -private block *block_calloc(BlockState *blx) @safe +private block* block_calloc(BlockState* blx) @safe { - block *b = dmd.backend.global.block_calloc(); + block* b = dmd.backend.global.block_calloc(); b.Btry = blx.tryblock; return b; } diff --git a/compiler/src/dmd/statementsem.d b/compiler/src/dmd/statementsem.d index 6bbc1a9b28eb..00dc606b4fa6 100644 --- a/compiler/src/dmd/statementsem.d +++ b/compiler/src/dmd/statementsem.d @@ -2089,7 +2089,7 @@ Statement statementSemanticVisit(Statement s, Scope* sc) // Make a copy of all the cases so that qsort doesn't scramble the actual // data we pass to codegen (the order of the cases in the switch). - CaseStatements *csCopy = (*ss.cases).copy(); + CaseStatements* csCopy = (*ss.cases).copy(); if (numcases) { diff --git a/compiler/src/dmd/templatesem.d b/compiler/src/dmd/templatesem.d index a69edef2c28a..48c4297b6b42 100644 --- a/compiler/src/dmd/templatesem.d +++ b/compiler/src/dmd/templatesem.d @@ -1425,7 +1425,7 @@ extern (D) MATCHpair deduceFunctionTemplateMatch(TemplateDeclaration td, Templat Expression e; Type t; Dsymbol s; - Scope *sco; + Scope* sco; const errors = global.startGagging(); /* ref: https://issues.dlang.org/show_bug.cgi?id=11118 diff --git a/compiler/src/dmd/tocsym.d b/compiler/src/dmd/tocsym.d index 0df12d4a8074..d6b3f621adca 100644 --- a/compiler/src/dmd/tocsym.d +++ b/compiler/src/dmd/tocsym.d @@ -66,7 +66,7 @@ import dmd.backend.ty; * Helper */ -Symbol *toSymbolX(Dsymbol ds, const(char)* prefix, SC sclass, type *t, const(char)* suffix) +Symbol* toSymbolX(Dsymbol ds, const(char)* prefix, SC sclass, type* t, const(char)* suffix) { //printf("Dsymbol::toSymbolX('%s')\n", prefix); import dmd.common.smallbuffer : SmallBuffer; @@ -85,7 +85,7 @@ Symbol *toSymbolX(Dsymbol ds, const(char)* prefix, SC sclass, type *t, const(cha char[64] idbuf = void; auto sb = SmallBuffer!(char)(idlen, idbuf[]); - char *id = sb.ptr; + char* id = sb.ptr; int nwritten = snprintf(id, idlen, "_D%.*s%d%.*s%.*s", cast(int)nlen, n, @@ -93,7 +93,7 @@ Symbol *toSymbolX(Dsymbol ds, const(char)* prefix, SC sclass, type *t, const(cha cast(int)suffixlen, suffix); assert(cast(uint)nwritten < idlen); // nwritten does not include the terminating 0 char - Symbol *s = symbol_name(id[0 .. nwritten], sclass, t); + Symbol* s = symbol_name(id[0 .. nwritten], sclass, t); //printf("-Dsymbol::toSymbolX() %s\n", id); return s; @@ -102,7 +102,7 @@ Symbol *toSymbolX(Dsymbol ds, const(char)* prefix, SC sclass, type *t, const(cha /************************************* */ -Symbol *toSymbol(Dsymbol s) +Symbol* toSymbol(Dsymbol s) { //printf("toSymbol() %s\n", s.toChars()); @@ -110,7 +110,7 @@ Symbol *toSymbol(Dsymbol s) { alias visit = Visitor.visit; - Symbol *result; + Symbol* result; this() scope @safe { @@ -157,7 +157,7 @@ Symbol *toSymbol(Dsymbol s) } } } - Symbol *s = symbol_calloc(id); + Symbol* s = symbol_calloc(id); s.Salignment = vd.alignment.isDefault() ? -1 : vd.alignment.get(); if (vd.storage_class & STC.temp) s.Sflags |= SFLartifical; @@ -166,7 +166,7 @@ Symbol *toSymbol(Dsymbol s) if (vd.adFlags & Declaration.nounderscore) s.Sflags |= SFLnounderscore; - TYPE *t; + TYPE* t; if (vd.storage_class & (STC.out_ | STC.ref_)) { t = type_allocn(TYnref, Type_toCtype(vd.type)); @@ -387,7 +387,7 @@ Symbol *toSymbol(Dsymbol s) : SC.global; symbol_func(*s); - func_t *f = s.Sfunc; + func_t* f = s.Sfunc; if (fd.isVirtual() && fd.vtblIndex != -1) f.Fflags |= Fvirtual; else if (fd.isMember2() && fd.isStatic()) @@ -553,13 +553,13 @@ Symbol *toSymbol(Dsymbol s) * import symbol */ -private Symbol *createImport(Symbol *sym, Loc loc) +private Symbol* createImport(Symbol* sym, Loc loc) { //printf("Dsymbol.createImport('%s')\n", sym.Sident.ptr); const char* n = sym.Sident.ptr; import core.stdc.stdlib : alloca; const allocLen = 6 + strlen(n) + 1 + type_paramsize(sym.Stype).sizeof*3 + 1; - char *id = cast(char *) alloca(allocLen); + char* id = cast(char *) alloca(allocLen); int idlen; if (target.os & Target.OS.Posix) { @@ -600,7 +600,7 @@ private Symbol *createImport(Symbol *sym, Loc loc) * Generate import symbol from symbol. */ -Symbol *toImport(Dsymbol ds) +Symbol* toImport(Dsymbol ds) { if (!ds.csym) toSymbol(ds); @@ -611,9 +611,9 @@ Symbol *toImport(Dsymbol ds) * Thunks adjust the incoming 'this' pointer by 'offset'. */ -Symbol *toThunkSymbol(FuncDeclaration fd, int offset) +Symbol* toThunkSymbol(FuncDeclaration fd, int offset) { - Symbol *s = toSymbol(fd); + Symbol* s = toSymbol(fd); if (!offset) return s; @@ -639,7 +639,7 @@ Symbol *toThunkSymbol(FuncDeclaration fd, int offset) * Fake a struct symbol. */ -Classsym *fake_classsym(Identifier id) +Classsym* fake_classsym(Identifier id) { auto t = type_struct_class(id.toChars(),8,0, null,null, @@ -657,7 +657,7 @@ Classsym *fake_classsym(Identifier id) * needed directly (like for rtti comparisons), make it directly accessible. */ -Symbol *toVtblSymbol(ClassDeclaration cd, bool genCsymbol = true) +Symbol* toVtblSymbol(ClassDeclaration cd, bool genCsymbol = true) { if (!cd.vtblsym || !cd.vtblsym.csym) { @@ -680,7 +680,7 @@ Symbol *toVtblSymbol(ClassDeclaration cd, bool genCsymbol = true) * Create the static initializer for the struct/class. */ -Symbol *toInitializer(AggregateDeclaration ad) +Symbol* toInitializer(AggregateDeclaration ad) { //printf("toInitializer() %s\n", ad.toChars()); if (!ad.sinit) @@ -745,7 +745,7 @@ Symbol *toInitializer(AggregateDeclaration ad) return cast(Symbol*)ad.sinit; } -Symbol *toInitializer(EnumDeclaration ed) +Symbol* toInitializer(EnumDeclaration ed) { if (!ed.sinit) { @@ -823,10 +823,10 @@ Symbol* toSymbolCpp(ClassDeclaration cd) */ if (!cd.cpp_type_info_ptr_sym) { - __gshared Symbol *scpp; + __gshared Symbol* scpp; if (!scpp) scpp = fake_classsym(Id.cpp_type_info_ptr); - Symbol *s = toSymbolX(cd, "_cpp_type_info_ptr", SC.comdat, scpp.Stype, ""); + Symbol* s = toSymbolX(cd, "_cpp_type_info_ptr", SC.comdat, scpp.Stype, ""); s.Sfl = FL.data; s.Sflags |= SFLnodebug; auto dtb = DtBuilder(0); @@ -845,7 +845,7 @@ Symbol* toSymbolCpp(ClassDeclaration cd) * Returns: * Symbol of cd's rtti type info */ -Symbol *toSymbolCppTypeInfo(ClassDeclaration cd) +Symbol* toSymbolCppTypeInfo(ClassDeclaration cd) { const id = target.cpp.typeInfoMangle(cd); auto s = symbol_calloc(id[0 .. strlen(id)]); @@ -866,7 +866,7 @@ Symbol *toSymbolCppTypeInfo(ClassDeclaration cd) * corresponding Symbol */ -Symbol *toSymbol(Type t) +Symbol* toSymbol(Type t) { auto tc = t.isTypeClass(); assert(tc); diff --git a/compiler/src/dmd/tocvdebug.d b/compiler/src/dmd/tocvdebug.d index 865cd801d9d4..deb746d60ff2 100644 --- a/compiler/src/dmd/tocvdebug.d +++ b/compiler/src/dmd/tocvdebug.d @@ -86,7 +86,7 @@ uint cv4_memfunctypidx(FuncDeclaration fd) { //printf("cv4_memfunctypidx(fd = '%s')\n", fd.toChars()); - type *t = Type_toCtype(fd.type); + type* t = Type_toCtype(fd.type); AggregateDeclaration ad = fd.isMemberLocal(); if (!ad) return cv4_typidx(t); @@ -108,7 +108,7 @@ uint cv4_memfunctypidx(FuncDeclaration fd) case CV4: { debtyp_t* d = debtyp_alloc(18); - ubyte *p = &d.data[0]; + ubyte* p = &d.data[0]; TOWORD(p,LF_MFUNCTION); TOWORD(p + 2,cv4_typidx(t.Tnext)); TOWORD(p + 4,cv4_typidx(Type_toCtype(ad.type))); @@ -123,7 +123,7 @@ uint cv4_memfunctypidx(FuncDeclaration fd) case CV8: { debtyp_t* d = debtyp_alloc(26); - ubyte *p = &d.data[0]; + ubyte* p = &d.data[0]; TOWORD(p,0x1009); TOLONG(p + 2,cv4_typidx(t.Tnext)); TOLONG(p + 6,cv4_typidx(Type_toCtype(ad.type))); @@ -172,7 +172,7 @@ uint cv4_Denum(EnumDeclaration e) const id = e.toPrettyChars(); uint len; - debtyp_t *d; + debtyp_t* d; const uint memtype = e.memtype ? cv4_typidx(Type_toCtype(e.memtype)) : 0; switch (config.fulltypes) { @@ -251,7 +251,7 @@ uint cv4_Denum(EnumDeclaration e) * Returns: * aligned count */ -uint cv_align(ubyte *p, uint n) +uint cv_align(ubyte* p, uint n) { if (config.fulltypes == CV8) { @@ -282,7 +282,7 @@ void cv_udt(const char* id, uint typidx) return cv8_udt(id, typidx); const len = strlen(id); - ubyte *debsym = cast(ubyte *) alloca(39 + IDOHD + len); + ubyte* debsym = cast(ubyte *) alloca(39 + IDOHD + len); // Output a 'user-defined type' for the tag name TOWORD(debsym + 2,S_UDT); @@ -346,7 +346,7 @@ struct CvFieldList { uint length; // accumulated during "count" phase - debtyp_t *dt; + debtyp_t* dt; uint writepos; // write position in dt } @@ -456,7 +456,7 @@ int cv_mem_count(Dsymbol s, void* ctx) int cv_mem_p(Dsymbol s, void* ctx) { auto pmc = cast(CvFieldList *) ctx; - ubyte *p = pmc.writePtr(); + ubyte* p = pmc.writePtr(); uint len = cvMember(s, p); pmc.written(len); return 0; @@ -500,7 +500,7 @@ void toDebug(StructDeclaration sd) // if (st.Sopeq && !(st.Sopeq.Sfunc.Fflags & Fnodebug)) // property |= 0x20; // class has overloaded assignment - const char *id = sd.toPrettyChars(true); + const char* id = sd.toPrettyChars(true); uint leaf = sd.isUnionDeclaration() ? LF_UNION : LF_STRUCTURE; if (config.fulltypes == CV8) @@ -516,7 +516,7 @@ void toDebug(StructDeclaration sd) } const len1 = numidx + cv4_numericbytes(cast(uint)size); - debtyp_t *d = debtyp_alloc(len1 + cv_stringbytes(id)); + debtyp_t* d = debtyp_alloc(len1 + cv_stringbytes(id)); cv4_storenumeric(d.data.ptr + numidx, cast(uint)size); cv_namestring(d.data.ptr + len1, id); @@ -641,7 +641,7 @@ void toDebug(ClassDeclaration cd) const uint numidx = (leaf == LF_CLASS_V3) ? 18 : 12; const uint len1 = numidx + cv4_numericbytes(cast(uint)size); - debtyp_t *d = debtyp_alloc(len1 + cv_stringbytes(id)); + debtyp_t* d = debtyp_alloc(len1 + cv_stringbytes(id)); cv4_storenumeric(d.data.ptr + numidx, cast(uint)size); cv_namestring(d.data.ptr + len1, id); @@ -651,7 +651,7 @@ void toDebug(ClassDeclaration cd) const size_t dim = cd.vtbl.length; // number of virtual functions if (dim) { // 4 bits per descriptor - debtyp_t *vshape = debtyp_alloc(cast(uint)(4 + (dim + 1) / 2)); + debtyp_t* vshape = debtyp_alloc(cast(uint)(4 + (dim + 1) / 2)); TOWORD(vshape.data.ptr,LF_VTSHAPE); TOWORD(vshape.data.ptr + 2, cast(uint)dim); @@ -746,7 +746,7 @@ void toDebug(ClassDeclaration cd) // Add in base classes for (size_t i = 0; i < cd.baseclasses.length; i++) { - BaseClass *bc = (*cd.baseclasses)[i]; + BaseClass* bc = (*cd.baseclasses)[i]; const idx_t typidx2 = cv4_typidx(Type_toCtype(bc.sym.type).Tnext); const uint attribute = visibilityToCVAttr(Visibility.Kind.public_); @@ -837,7 +837,7 @@ void toDebugClosure(Symbol* closstru) const char* closname = closstru.Sident.ptr; const len1 = numidx + cv4_numericbytes(structsize); - debtyp_t *d = debtyp_alloc(len1 + cv_stringbytes(closname)); + debtyp_t* d = debtyp_alloc(len1 + cv_stringbytes(closname)); cv4_storenumeric(d.data.ptr + numidx, structsize); cv_namestring(d.data.ptr + len1, closname); @@ -865,7 +865,7 @@ void toDebugClosure(Symbol* closstru) uint flistlen = 2; for (auto sl = closstru.Sstruct.Sfldlst; sl; sl = list_next(sl)) { - Symbol *sf = list_symbol(sl); + Symbol* sf = list_symbol(sl); uint thislen = (config.fulltypes == CV8 ? 8 : 6); thislen += cv4_signednumericbytes(cast(uint)sf.Smemoff); thislen += cv_stringbytes(sf.Sident.ptr); @@ -879,15 +879,15 @@ void toDebugClosure(Symbol* closstru) } // Generate fieldlist type record - debtyp_t *dt = debtyp_alloc(flistlen); - ubyte *p = dt.data.ptr; + debtyp_t* dt = debtyp_alloc(flistlen); + ubyte* p = dt.data.ptr; // And fill it in TOWORD(p, config.fulltypes == CV8 ? LF_FIELDLIST_V2 : LF_FIELDLIST); uint flistoff = 2; for (auto sl = closstru.Sstruct.Sfldlst; sl && flistoff < flistlen; sl = list_next(sl)) { - Symbol *sf = list_symbol(sl); + Symbol* sf = list_symbol(sl); idx_t vtypidx = cv_typidx(sf.Stype); flistoff += writeField(p + flistoff, sf.Sident.ptr, 3 /*public*/, vtypidx, cast(uint)sf.Smemoff); } @@ -920,7 +920,7 @@ void toDebugClosure(Symbol* closstru) * number of bytes written, or that would be written if p==null */ -int cvMember(Dsymbol s, ubyte *p) +int cvMember(Dsymbol s, ubyte* p) { scope v = new CVMember(p); s.accept(v); @@ -928,10 +928,10 @@ int cvMember(Dsymbol s, ubyte *p) } private extern (C++) class CVMember : Visitor { - ubyte *p; + ubyte* p; int result; - this(ubyte *p) @safe + this(ubyte* p) @safe { this.p = p; result = 0; @@ -1030,8 +1030,8 @@ private extern (C++) class CVMember : Visitor } // Allocate and fill it in - debtyp_t *d = debtyp_alloc(mlen); - ubyte *q = d.data.ptr; + debtyp_t* d = debtyp_alloc(mlen); + ubyte* q = d.data.ptr; TOWORD(q,config.fulltypes == CV8 ? LF_METHODLIST_V2 : LF_METHODLIST); q += 2; // for (s = sf; s; s = s.Sfunc.Foversym) diff --git a/compiler/src/dmd/todt.d b/compiler/src/dmd/todt.d index 1d53e0247f24..fe57c69eb523 100644 --- a/compiler/src/dmd/todt.d +++ b/compiler/src/dmd/todt.d @@ -568,7 +568,7 @@ void Expression_toDt(Expression e, ref DtBuilder dtb) e.fd.tok = TOK.function_; e.fd.vthis = null; } - Symbol *s = toSymbol(e.fd); + Symbol* s = toSymbol(e.fd); toObjFile(e.fd, false); if (e.fd.tok == TOK.delegate_) dtb.size(0); @@ -610,7 +610,7 @@ void Expression_toDt(Expression e, ref DtBuilder dtb) if (Type t = isType(e.obj)) { TypeInfo_toObjFile(e, e.loc, t); - Symbol *s = toSymbol(t.vtinfo); + Symbol* s = toSymbol(t.vtinfo); dtb.xoff(s, 0); return; } @@ -686,7 +686,7 @@ void cpp_type_info_ptr_toDt(ClassDeclaration cd, ref DtBuilder dtb) dtb.size(0); // monitor // Create symbol for C++ type info - Symbol *s = toSymbolCppTypeInfo(cd); + Symbol* s = toSymbolCppTypeInfo(cd); // Put in address of cd's C++ type info dtb.xoff(s, 0); diff --git a/compiler/src/dmd/toir.d b/compiler/src/dmd/toir.d index 00633b7b4a93..b65c659d35be 100644 --- a/compiler/src/dmd/toir.d +++ b/compiler/src/dmd/toir.d @@ -64,7 +64,7 @@ import dmd.tocsym; struct Label { - block *lblock; // The block to which the label is defined. + block* lblock; // The block to which the label is defined. } /*********************************************************** @@ -162,7 +162,7 @@ struct IRState * References: * https://dlang.org/dmd-windows.html#switch-cov */ -extern (D) elem *incUsageElem(ref IRState irs, const ref Loc loc) +extern (D) elem* incUsageElem(ref IRState irs, const ref Loc loc) { uint linnum = loc.linnum; @@ -187,7 +187,7 @@ extern (D) elem *incUsageElem(ref IRState irs, const ref Loc loc) /* Generate: *(m.cov + linnum * 4) += 1 */ - elem *e; + elem* e; e = el_ptr(m.cov); e = el_bin(OPadd, TYnptr, e, el_long(TYuint, linnum * 4)); e = el_una(OPind, TYuint, e); @@ -203,9 +203,9 @@ extern (D) elem *incUsageElem(ref IRState irs, const ref Loc loc) * 'origSc' is the original scope we inlined from. * This routine is critical for implementing nested functions. */ -elem *getEthis(const ref Loc loc, ref IRState irs, Dsymbol fd, Dsymbol fdp = null, Dsymbol origSc = null) +elem* getEthis(const ref Loc loc, ref IRState irs, Dsymbol fd, Dsymbol fdp = null, Dsymbol origSc = null) { - elem *ethis; + elem* ethis; FuncDeclaration thisfd = irs.getFunc(); Dsymbol ctxt0 = fdp ? fdp : fd; // follow either of these two Dsymbol ctxt1 = origSc ? origSc.toParent2() : null; // contexts from template arguments @@ -282,7 +282,7 @@ elem *getEthis(const ref Loc loc, ref IRState irs, Dsymbol fd, Dsymbol fdp = nul /* https://issues.dlang.org/show_bug.cgi?id=7517: If fdp is declared in interface, offset the * 'this' pointer to get correct interface type reference. */ - Symbol *stmp = symbol_genauto(TYnptr); + Symbol* stmp = symbol_genauto(TYnptr); ethis = el_bin(OPadd, TYnptr, el_var(irs.sthis), el_long(TYsize_t, offset)); ethis = el_bin(OPeq, TYnptr, el_var(stmp), ethis); ethis = el_combine(ethis, el_ptr(stmp)); @@ -418,7 +418,7 @@ elem *getEthis(const ref Loc loc, ref IRState irs, Dsymbol fd, Dsymbol fdp = nul * Returns: * *(ethis + offset); */ -elem *fixEthis2(elem *ethis, FuncDeclaration fd, bool ctxt2 = false) +elem* fixEthis2(elem* ethis, FuncDeclaration fd, bool ctxt2 = false) { if (fd && fd.hasDualContext()) { @@ -435,9 +435,9 @@ elem *fixEthis2(elem *ethis, FuncDeclaration fd, bool ctxt2 = false) * Returns: * *(ey + (ethis2 ? ad.vthis2 : ad.vthis).offset) = this; */ -elem *setEthis(const ref Loc loc, ref IRState irs, elem *ey, AggregateDeclaration ad, bool setthis2 = false) +elem* setEthis(const ref Loc loc, ref IRState irs, elem* ey, AggregateDeclaration ad, bool setthis2 = false) { - elem *ethis; + elem* ethis; FuncDeclaration thisfd = irs.getFunc(); int offset = 0; Dsymbol adp = setthis2 ? ad.toParent2(): ad.toParentLocal(); // class/func we're nested in @@ -624,15 +624,15 @@ Lva_start: * Returns: * expression that initializes 'length' */ -elem *resolveLengthVar(VarDeclaration lengthVar, elem **pe, Type t1) +elem* resolveLengthVar(VarDeclaration lengthVar, elem **pe, Type t1) { //printf("resolveLengthVar()\n"); - elem *einit = null; + elem* einit = null; if (lengthVar && !(lengthVar.storage_class & STC.const_)) { - elem *elength; - Symbol *slength; + elem* elength; + Symbol* slength; if (t1.ty == Tsarray) { @@ -812,19 +812,19 @@ void buildClosure(FuncDeclaration fd, ref IRState irs) //printf("FuncDeclaration.buildClosure() %s\n", fd.toChars()); /* Generate type name for closure struct */ - const char *name1 = "CLOSURE."; - const char *name2 = fd.toPrettyChars(); + const char* name1 = "CLOSURE."; + const char* name2 = fd.toPrettyChars(); size_t namesize = strlen(name1)+strlen(name2)+1; - char *closname = cast(char *)Mem.check(calloc(namesize, char.sizeof)); + char* closname = cast(char *)Mem.check(calloc(namesize, char.sizeof)); strcat(strcat(closname, name1), name2); /* Build type for closure */ - type *Closstru = type_struct_class(closname, target.ptrsize, 0, null, null, false, false, true, false); + type* Closstru = type_struct_class(closname, target.ptrsize, 0, null, null, false, false, true, false); free(closname); auto chaintype = getParentClosureType(irs.sthis, fd); symbol_struct_addField(*Closstru.Ttag, "__chain", chaintype, 0); - Symbol *sclosure; + Symbol* sclosure; sclosure = symbol_name("__closptr", SC.auto_, type_pointer(Closstru)); sclosure.Sflags |= SFLtrue | SFLfree; symbol_add(sclosure); @@ -856,7 +856,7 @@ void buildClosure(FuncDeclaration fd, ref IRState irs) } /* Set Sscope to closure */ - Symbol *vsym = toSymbol(v); + Symbol* vsym = toSymbol(v); assert(vsym.Sscope == null); vsym.Sscope = sclosure; @@ -891,7 +891,7 @@ void buildClosure(FuncDeclaration fd, ref IRState irs) structsize += aggAlignment - GC_ALIGN; // Allocate memory for the closure - elem *e = el_long(TYsize_t, structsize); + elem* e = el_long(TYsize_t, structsize); e = el_bin(OPcall, TYnptr, el_var(getRtlsym(RTLSYM.ALLOCMEMORY)), e); toTraceGC(irs, e, fd.loc); @@ -909,12 +909,12 @@ void buildClosure(FuncDeclaration fd, ref IRState irs) // Set the first element to sthis // *(sclosure + 0) = sthis; - elem *ethis; + elem* ethis; if (irs.sthis) ethis = el_var(irs.sthis); else ethis = el_long(TYnptr, 0); - elem *ex = el_una(OPind, TYnptr, el_var(sclosure)); + elem* ex = el_una(OPind, TYnptr, el_var(sclosure)); ex = el_bin(OPeq, TYnptr, ex, ethis); e = el_combine(e, ex); @@ -936,7 +936,7 @@ void buildClosure(FuncDeclaration fd, ref IRState irs) tym = TYdelegate; ex = el_bin(OPadd, TYnptr, el_var(sclosure), el_long(TYsize_t, v.offset)); ex = el_una(OPind, tym, ex); - elem *ev = el_var(toSymbol(v)); + elem* ev = el_var(toSymbol(v)); if (x64ref) { ev.Ety = TYnref; @@ -946,7 +946,7 @@ void buildClosure(FuncDeclaration fd, ref IRState irs) } if (tybasic(ex.Ety) == TYstruct || tybasic(ex.Ety) == TYarray) { - .type *t = Type_toCtype(v.type); + .type* t = Type_toCtype(v.type); ex.ET = t; ex = el_bin(OPstreq, tym, ex, ev); ex.ET = t; @@ -1062,17 +1062,17 @@ void buildAlignSection(FuncDeclaration fd, ref IRState irs) auto aggAlignment = setAlignSectionVarOffset(fd); /* Generate type name for align closure struct */ - const char *name1 = "ALIGNSECTION."; - const char *name2 = fd.toPrettyChars(); + const char* name1 = "ALIGNSECTION."; + const char* name2 = fd.toPrettyChars(); size_t namesize = strlen(name1)+strlen(name2)+1; - char *closname = cast(char *)Mem.check(calloc(namesize, char.sizeof)); + char* closname = cast(char *)Mem.check(calloc(namesize, char.sizeof)); strcat(strcat(closname, name1), name2); /* Build type for aligned section */ - type *Closstru = type_struct_class(closname, stackAlign, 0, null, null, false, false, true, false); + type* Closstru = type_struct_class(closname, stackAlign, 0, null, null, false, false, true, false); free(closname); - Symbol *sclosure; + Symbol* sclosure; type* t = type_pointer(Closstru); type_setcv(&t, t.Tty | mTYvolatile); // so optimizer doesn't delete it sclosure = symbol_name("__alignsecptr", SC.auto_, t); @@ -1088,7 +1088,7 @@ void buildAlignSection(FuncDeclaration fd, ref IRState irs) if (log) printf("align section var %s\n", v.toChars()); v.inAlignSection = true; - Symbol *vsym = toSymbol(v); + Symbol* vsym = toSymbol(v); assert(vsym.Sscope == null); vsym.Sscope = sclosure; @@ -1118,11 +1118,11 @@ void buildAlignSection(FuncDeclaration fd, ref IRState irs) toDebugClosure(Closstru.Ttag); // Create Symbol that is an instance of the align closure - Symbol *salignSectionInstance = symbol_name("__alignsec", SC.auto_, Closstru); + Symbol* salignSectionInstance = symbol_name("__alignsec", SC.auto_, Closstru); salignSectionInstance.Sflags |= SFLtrue | SFLfree; symbol_add(salignSectionInstance); - elem *e = el_ptr(salignSectionInstance); + elem* e = el_ptr(salignSectionInstance); /* Align it * e + (aggAlignment - 1) & ~(aggAlignment - 1) @@ -1154,19 +1154,19 @@ void buildCapture(FuncDeclaration fd) if (fd.closureVars.length && !fd.needsClosure) { /* Generate type name for struct with captured variables */ - const char *name1 = "CAPTURE."; - const char *name2 = fd.toPrettyChars(); + const char* name1 = "CAPTURE."; + const char* name2 = fd.toPrettyChars(); size_t namesize = strlen(name1)+strlen(name2)+1; - char *capturename = cast(char *)Mem.check(calloc(namesize, char.sizeof)); + char* capturename = cast(char *)Mem.check(calloc(namesize, char.sizeof)); strcat(strcat(capturename, name1), name2); /* Build type for struct */ - type *capturestru = type_struct_class(capturename, target.ptrsize, 0, null, null, false, false, true, false); + type* capturestru = type_struct_class(capturename, target.ptrsize, 0, null, null, false, false, true, false); free(capturename); foreach (v; fd.closureVars) { - Symbol *vsym = toSymbol(v); + Symbol* vsym = toSymbol(v); /* Add variable as capture type member */ auto soffset = vsym.Soffset; @@ -1177,7 +1177,7 @@ void buildCapture(FuncDeclaration fd) } // generate pseudo symbol to put into functions' Sscope - Symbol *scapture = symbol_name("__captureptr", SC.alias_, type_pointer(capturestru)); + Symbol* scapture = symbol_name("__captureptr", SC.alias_, type_pointer(capturestru)); scapture.Sflags |= SFLtrue | SFLfree; //symbol_add(scapture); fd.csym.Sscope = scapture; diff --git a/compiler/src/dmd/toobj.d b/compiler/src/dmd/toobj.d index 689c01974e53..21be63780290 100644 --- a/compiler/src/dmd/toobj.d +++ b/compiler/src/dmd/toobj.d @@ -91,7 +91,7 @@ void genModuleInfo(Module m) ObjectNotFound(m.loc, Id.ModuleInfo); } - Symbol *msym = toSymbol(m); + Symbol* msym = toSymbol(m); ////////////////////////////////////////////// @@ -180,7 +180,7 @@ void genModuleInfo(Module m) if (!mod.needmoduleinfo) continue; - Symbol *s = toSymbol(mod); + Symbol* s = toSymbol(mod); /* Weak references don't pull objects in from the library, * they resolve to 0 if not pulled in by something else. @@ -229,7 +229,7 @@ void genModuleInfo(Module m) * s = symbol that contains the data * offset = offset of the data inside the Symbol's memory */ -void write_pointers(Type type, Symbol *s, uint offset) +void write_pointers(Type type, Symbol* s, uint offset) { uint ty = type.toBasetype().ty; if (ty == Tclass) @@ -246,7 +246,7 @@ void write_pointers(Type type, Symbol *s, uint offset) * s = symbol that contains the data * offset = offset of the data inside the Symbol's memory */ -void write_instance_pointers(Type type, Symbol *s, uint offset) +void write_instance_pointers(Type type, Symbol* s, uint offset) { import dmd.typesem : hasPointers; if (!type.hasPointers()) @@ -385,7 +385,7 @@ void toObjFile(Dsymbol ds, bool multiobj) if (genclassinfo) toSymbol(cd); // __ClassZ symbol toVtblSymbol(cd, genclassinfo); // __vtblZ symbol - Symbol *sinit = toInitializer(cd); // __initZ symbol + Symbol* sinit = toInitializer(cd); // __initZ symbol ////////////////////////////////////////////// @@ -598,7 +598,7 @@ void toObjFile(Dsymbol ds, bool multiobj) if (!vd.isDataseg() || vd.storage_class & STC.extern_) return; - Symbol *s = toSymbol(vd); + Symbol* s = toSymbol(vd); const sz64 = vd.type.size(vd.loc); if (sz64 == SIZE_INVALID) { @@ -748,7 +748,7 @@ void toObjFile(Dsymbol ds, bool multiobj) return; } - Symbol *s = toSymbol(tid); + Symbol* s = toSymbol(tid); s.Sclass = SC.comdat; s.Sfl = FL.data; @@ -772,7 +772,7 @@ void toObjFile(Dsymbol ds, bool multiobj) override void visit(AttribDeclaration ad) { - Dsymbols *d = ad.include(null); + Dsymbols* d = ad.include(null); if (d) { @@ -795,7 +795,7 @@ void toObjFile(Dsymbol ds, bool multiobj) assert(e.op == EXP.string_); StringExp se = e.isStringExp(); - char *name = cast(char *)mem.xmalloc(se.numberOfCodeUnits() + 1); + char* name = cast(char *)mem.xmalloc(se.numberOfCodeUnits() + 1); se.writeTo(name, true); @@ -824,7 +824,7 @@ void toObjFile(Dsymbol ds, bool multiobj) Dsymbol sa = getDsymbol(e); FuncDeclaration f = sa.isFuncDeclaration(); assert(f); - Symbol *s = toSymbol(f); + Symbol* s = toSymbol(f); obj_startaddress(s); } @@ -946,11 +946,11 @@ void toObjFile(Dsymbol ds, bool multiobj) * sz = data size of s * dtb = where to put the data */ - static void tlsToDt(VarDeclaration vd, Symbol *s, uint sz, ref DtBuilder dtb, bool isCfile) + static void tlsToDt(VarDeclaration vd, Symbol* s, uint sz, ref DtBuilder dtb, bool isCfile) { assert(config.objfmt == OBJ_MACH && target.isX86_64 && (s.Stype.Tty & mTYLINK) == mTYthread); - Symbol *tlvInit = createTLVDataSymbol(vd, s); + Symbol* tlvInit = createTLVDataSymbol(vd, s); auto tlvInitDtb = DtBuilder(0); if (sz == 0) @@ -981,7 +981,7 @@ void toObjFile(Dsymbol ds, bool multiobj) * * Returns: the newly created symbol */ - static Symbol *createTLVDataSymbol(VarDeclaration vd, Symbol *s) + static Symbol* createTLVDataSymbol(VarDeclaration vd, Symbol* s) { assert(config.objfmt == OBJ_MACH && target.isX86_64 && (s.Stype.Tty & mTYLINK) == mTYthread); @@ -992,11 +992,11 @@ void toObjFile(Dsymbol ds, bool multiobj) const(char)[] tlvInitName = buffer[]; // Compute type for tlv symbol - type *t = type_fake(vd.type.ty); + type* t = type_fake(vd.type.ty); type_setty(&t, t.Tty | mTYthreadData); type_setmangle(&t, mangle(vd)); - Symbol *tlvInit = symbol_name(tlvInitName, SC.static_, t); + Symbol* tlvInit = symbol_name(tlvInitName, SC.static_, t); tlvInit.Sdt = null; tlvInit.Salignment = type_alignsize(s.Stype); if (vd._linkage == LINK.cpp) @@ -1117,7 +1117,7 @@ private bool finishVtbl(ClassDeclaration cd) * Returns ~0 if not this csym. */ -uint baseVtblOffset(ClassDeclaration cd, BaseClass *bc) +uint baseVtblOffset(ClassDeclaration cd, BaseClass* bc) { //printf("ClassDeclaration.baseVtblOffset('%s', bc = %p)\n", cd.toChars(), bc); uint csymoffset = target.classinfosize; // must be ClassInfo.size @@ -1125,7 +1125,7 @@ uint baseVtblOffset(ClassDeclaration cd, BaseClass *bc) for (size_t i = 0; i < cd.vtblInterfaces.length; i++) { - BaseClass *b = (*cd.vtblInterfaces)[i]; + BaseClass* b = (*cd.vtblInterfaces)[i]; if (b == bc) return csymoffset; @@ -1141,7 +1141,7 @@ uint baseVtblOffset(ClassDeclaration cd, BaseClass *bc) { foreach (k; 0 .. cd2.vtblInterfaces.length) { - BaseClass *bs = (*cd2.vtblInterfaces)[k]; + BaseClass* bs = (*cd2.vtblInterfaces)[k]; if (bs.fillVtbl(cd, null, 0)) { if (bc == bs) @@ -1168,7 +1168,7 @@ uint baseVtblOffset(ClassDeclaration cd, BaseClass *bc) * Returns: * number of bytes emitted */ -private size_t emitVtbl(ref DtBuilder dtb, BaseClass *b, ref FuncDeclarations bvtbl, ClassDeclaration pc, size_t k) +private size_t emitVtbl(ref DtBuilder dtb, BaseClass* b, ref FuncDeclarations bvtbl, ClassDeclaration pc, size_t k) { //printf("\toverriding vtbl[] for %s\n", b.sym.toChars()); ClassDeclaration id = b.sym; @@ -1291,7 +1291,7 @@ private void ClassInfoToDt(ref DtBuilder dtb, ClassDeclaration cd, Symbol* sinit namelen = strlen(name); } dtb.size(namelen); - dt_t *pdtname = dtb.xoffpatch(cd.csym, 0, TYnptr); + dt_t* pdtname = dtb.xoffpatch(cd.csym, 0, TYnptr); // vtbl[] dtb.size(cd.vtbl.length); @@ -1410,7 +1410,7 @@ Louter: offset += cd.vtblInterfaces.length * (4 * target.ptrsize); for (size_t i = 0; i < cd.vtblInterfaces.length; i++) { - BaseClass *b = (*cd.vtblInterfaces)[i]; + BaseClass* b = (*cd.vtblInterfaces)[i]; ClassDeclaration id = b.sym; /* The layout is: @@ -1441,7 +1441,7 @@ Louter: //printf("putting out %d interface vtbl[]s for '%s'\n", vtblInterfaces.length, toChars()); foreach (i; 0 .. cd.vtblInterfaces.length) { - BaseClass *b = (*cd.vtblInterfaces)[i]; + BaseClass* b = (*cd.vtblInterfaces)[i]; offset += emitVtbl(dtb, b, b.vtbl, cd, i); } @@ -1452,7 +1452,7 @@ Louter: { foreach (i; 0 .. pc.vtblInterfaces.length) { - BaseClass *b = (*pc.vtblInterfaces)[i]; + BaseClass* b = (*pc.vtblInterfaces)[i]; FuncDeclarations bvtbl; if (b.fillVtbl(cd, &bvtbl, 0)) { @@ -1539,7 +1539,7 @@ private void InterfaceInfoToDt(ref DtBuilder dtb, InterfaceDeclaration id) const(char) *name = id.toPrettyChars(/*QualifyTypes=*/ true); size_t namelen = strlen(name); dtb.size(namelen); - dt_t *pdtname = dtb.xoffpatch(id.csym, 0, TYnptr); + dt_t* pdtname = dtb.xoffpatch(id.csym, 0, TYnptr); // vtbl[] dtb.size(0); @@ -1619,7 +1619,7 @@ private void InterfaceInfoToDt(ref DtBuilder dtb, InterfaceDeclaration id) offset += id.vtblInterfaces.length * (4 * target.ptrsize); for (size_t i = 0; i < id.vtblInterfaces.length; i++) { - BaseClass *b = (*id.vtblInterfaces)[i]; + BaseClass* b = (*id.vtblInterfaces)[i]; ClassDeclaration base = b.sym; // classinfo diff --git a/compiler/src/dmd/typesem.d b/compiler/src/dmd/typesem.d index 65d267f155a3..073f0906494b 100644 --- a/compiler/src/dmd/typesem.d +++ b/compiler/src/dmd/typesem.d @@ -3128,7 +3128,7 @@ Type typeSemantic(Type type, const ref Loc loc, Scope* sc) else { /* struct S { int a; }; - * struct S *s; + * struct S* s; */ } mtype.resolved = sd.type; @@ -3159,14 +3159,14 @@ Type typeSemantic(Type type, const ref Loc loc, Scope* sc) mtype.tok == TOK.struct_ && s.isStructDeclaration()) { /* struct S; - * { struct S *s; } + * { struct S* s; } */ mtype.resolved = s.isStructDeclaration().type; } else { /* union S; - * { struct S *s; } + * { struct S* s; } */ .error(mtype.loc, "redeclaring `%s %s` as `%s %s`", s.kind(), s.toChars(), Token.toChars(mtype.tok), mtype.id.toChars());