comparison dmd/ExpStatement.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 cab4c37afb89
children 43073c7c7769
comparison
equal deleted inserted replaced
71:8e24ef1dd139 72:2e2a5c3f943a
29 { 29 {
30 super(loc); 30 super(loc);
31 this.exp = exp; 31 this.exp = exp;
32 } 32 }
33 33
34 Statement syntaxCopy() 34 override Statement syntaxCopy()
35 { 35 {
36 Expression e = exp ? exp.syntaxCopy() : null; 36 Expression e = exp ? exp.syntaxCopy() : null;
37 ExpStatement es = new ExpStatement(loc, e); 37 ExpStatement es = new ExpStatement(loc, e);
38 return es; 38 return es;
39 } 39 }
40 40
41 void toCBuffer(OutBuffer buf, HdrGenState* hgs) 41 override void toCBuffer(OutBuffer buf, HdrGenState* hgs)
42 { 42 {
43 if (exp) 43 if (exp)
44 exp.toCBuffer(buf, hgs); 44 exp.toCBuffer(buf, hgs);
45 buf.writeByte(';'); 45 buf.writeByte(';');
46 if (!hgs.FLinit.init) 46 if (!hgs.FLinit.init)
47 buf.writenl(); 47 buf.writenl();
48 } 48 }
49 49
50 Statement semantic(Scope sc) 50 override Statement semantic(Scope sc)
51 { 51 {
52 if (exp) 52 if (exp)
53 { 53 {
54 //printf("ExpStatement::semantic() %s\n", exp->toChars()); 54 //printf("ExpStatement::semantic() %s\n", exp->toChars());
55 exp = exp.semantic(sc); 55 exp = exp.semantic(sc);
64 //exp = exp.optimize(isDeclarationStatement() ? WANT.WANTvalue : 0); 64 //exp = exp.optimize(isDeclarationStatement() ? WANT.WANTvalue : 0);
65 } 65 }
66 return this; 66 return this;
67 } 67 }
68 68
69 Expression interpret(InterState istate) 69 override Expression interpret(InterState istate)
70 { 70 {
71 version (LOG) { 71 version (LOG) {
72 printf("ExpStatement.interpret(%s)\n", exp ? exp.toChars() : ""); 72 printf("ExpStatement.interpret(%s)\n", exp ? exp.toChars() : "");
73 } 73 }
74 mixin(START!()); 74 mixin(START!());
82 } 82 }
83 } 83 }
84 return null; 84 return null;
85 } 85 }
86 86
87 BE blockExit() 87 override BE blockExit()
88 { 88 {
89 BE result = BE.BEfallthru; 89 BE result = BE.BEfallthru;
90 90
91 if (exp) 91 if (exp)
92 { 92 {
103 result |= BE.BEthrow; 103 result |= BE.BEthrow;
104 } 104 }
105 return result; 105 return result;
106 } 106 }
107 107
108 int inlineCost(InlineCostState* ics) 108 override int inlineCost(InlineCostState* ics)
109 { 109 {
110 return exp ? exp.inlineCost(ics) : 0; 110 return exp ? exp.inlineCost(ics) : 0;
111 } 111 }
112 112
113 Expression doInline(InlineDoState ids) 113 override Expression doInline(InlineDoState ids)
114 { 114 {
115 version (LOG) { 115 version (LOG) {
116 if (exp) printf("ExpStatement.doInline() '%s'\n", exp.toChars()); 116 if (exp) printf("ExpStatement.doInline() '%s'\n", exp.toChars());
117 } 117 }
118 return exp ? exp.doInline(ids) : null; 118 return exp ? exp.doInline(ids) : null;
119 } 119 }
120 120
121 Statement inlineScan(InlineScanState* iss) 121 override Statement inlineScan(InlineScanState* iss)
122 { 122 {
123 version (LOG) { 123 version (LOG) {
124 printf("ExpStatement.inlineScan(%s)\n", toChars()); 124 printf("ExpStatement.inlineScan(%s)\n", toChars());
125 } 125 }
126 if (exp) 126 if (exp)
127 exp = exp.inlineScan(iss); 127 exp = exp.inlineScan(iss);
128 return this; 128 return this;
129 } 129 }
130 130
131 void toIR(IRState* irs) 131 override void toIR(IRState* irs)
132 { 132 {
133 Blockx* blx = irs.blx; 133 Blockx* blx = irs.blx;
134 134
135 //printf("ExpStatement.toIR(), exp = %s\n", exp ? exp.toChars() : ""); 135 //printf("ExpStatement.toIR(), exp = %s\n", exp ? exp.toChars() : "");
136 incUsage(irs, loc); 136 incUsage(irs, loc);