Mercurial > projects > ddmd
diff dmd/NewExp.d @ 72:2e2a5c3f943a
reduced warnings by adding override to the methods
think this also normalizes different line endings used all over the place
author | Trass3r |
---|---|
date | Sat, 28 Aug 2010 16:19:48 +0200 |
parents | 4290d870944a |
children | be2ab491772e |
line wrap: on
line diff
--- a/dmd/NewExp.d Sat Aug 28 16:14:07 2010 +0200 +++ b/dmd/NewExp.d Sat Aug 28 16:19:48 2010 +0200 @@ -1,17 +1,17 @@ -module dmd.NewExp; - -import dmd.Expression; -import dmd.NewDeclaration; +module dmd.NewExp; + +import dmd.Expression; +import dmd.NewDeclaration; import dmd.CtorDeclaration; -import dmd.ClassDeclaration; -import dmd.Type; -import dmd.OutBuffer; -import dmd.Loc; -import dmd.Scope; -import dmd.IRState; -import dmd.InlineDoState; -import dmd.HdrGenState; -import dmd.ArrayTypes; +import dmd.ClassDeclaration; +import dmd.Type; +import dmd.OutBuffer; +import dmd.Loc; +import dmd.Scope; +import dmd.IRState; +import dmd.InlineDoState; +import dmd.HdrGenState; +import dmd.ArrayTypes; import dmd.TOK; import dmd.TY; import dmd.TypeFunction; @@ -28,7 +28,7 @@ import dmd.Global; import dmd.IntegerExp; import dmd.TypePointer; - + import dmd.backend.elem; import dmd.backend.TYM; import dmd.backend.SC; @@ -42,19 +42,19 @@ import dmd.expression.Util; import dmd.codegen.Util; -import std.string : toStringz; - +import std.string : toStringz; + class NewExp : Expression { - /* thisexp.new(newargs) newtype(arguments) - */ - Expression thisexp; // if !null, 'this' for class being allocated - Expressions newargs; // Array of Expression's to call new operator - Type newtype; - Expressions arguments; // Array of Expression's - - CtorDeclaration member; // constructor function - NewDeclaration allocator; // allocator function + /* thisexp.new(newargs) newtype(arguments) + */ + Expression thisexp; // if !null, 'this' for class being allocated + Expressions newargs; // Array of Expression's to call new operator + Type newtype; + Expressions arguments; // Array of Expression's + + CtorDeclaration member; // constructor function + NewDeclaration allocator; // allocator function int onstack; // allocate on stack this(Loc loc, Expression thisexp, Expressions newargs, Type newtype, Expressions arguments) @@ -66,15 +66,15 @@ this.arguments = arguments; } - Expression syntaxCopy() + override Expression syntaxCopy() { - return new NewExp(loc, - thisexp ? thisexp.syntaxCopy() : null, - arraySyntaxCopy(newargs), + return new NewExp(loc, + thisexp ? thisexp.syntaxCopy() : null, + arraySyntaxCopy(newargs), newtype.syntaxCopy(), arraySyntaxCopy(arguments)); } - Expression semantic(Scope sc) + override Expression semantic(Scope sc) { int i; Type tb; @@ -376,7 +376,7 @@ return this; } - Expression optimize(int result) + override Expression optimize(int result) { if (thisexp) thisexp = thisexp.optimize(WANTvalue); @@ -406,7 +406,7 @@ return this; } - elem* toElem(IRState* irs) + override elem* toElem(IRState* irs) { elem* e; Type t; @@ -724,36 +724,36 @@ return e; } - bool checkSideEffect(int flag) + override bool checkSideEffect(int flag) { assert(false); } - void toCBuffer(OutBuffer buf, HdrGenState* hgs) + override void toCBuffer(OutBuffer buf, HdrGenState* hgs) { assert(false); } - void scanForNestedRef(Scope sc) + override void scanForNestedRef(Scope sc) { - //printf("NewExp.scanForNestedRef(Scope *sc): %s\n", toChars()); - - if (thisexp) - thisexp.scanForNestedRef(sc); - arrayExpressionScanForNestedRef(sc, newargs); + //printf("NewExp.scanForNestedRef(Scope *sc): %s\n", toChars()); + + if (thisexp) + thisexp.scanForNestedRef(sc); + arrayExpressionScanForNestedRef(sc, newargs); arrayExpressionScanForNestedRef(sc, arguments); } version (DMDV2) { - bool canThrow() + override bool canThrow() { return 1; - } + } } - + //int inlineCost(InlineCostState *ics); - Expression doInline(InlineDoState ids) + override Expression doInline(InlineDoState ids) { //printf("NewExp.doInline(): %s\n", toChars()); NewExp ne = cast(NewExp)copy(); @@ -763,8 +763,8 @@ ne.newargs = arrayExpressiondoInline(ne.newargs, ids); ne.arguments = arrayExpressiondoInline(ne.arguments, ids); return ne; - } - + } + //Expression inlineScan(InlineScanState *iss); }