Mercurial > projects > ldc
comparison dmd/statement.c @ 1640:9bf06e02070b
Merge DMD 1.057.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Mon, 08 Mar 2010 21:39:20 +0100 |
parents | 44b145be2ef5 |
children |
comparison
equal
deleted
inserted
replaced
1639:41145d30acb8 | 1640:9bf06e02070b |
---|---|
1 | 1 |
2 // Compiler implementation of the D programming language | 2 // Compiler implementation of the D programming language |
3 // Copyright (c) 1999-2009 by Digital Mars | 3 // Copyright (c) 1999-2010 by Digital Mars |
4 // All Rights Reserved | 4 // All Rights Reserved |
5 // written by Walter Bright | 5 // written by Walter Bright |
6 // http://www.digitalmars.com | 6 // http://www.digitalmars.com |
7 // License for redistribution is by either the Artistic License | 7 // License for redistribution is by either the Artistic License |
8 // in artistic.txt, or the GNU General Public License in gnu.txt. | 8 // in artistic.txt, or the GNU General Public License in gnu.txt. |
99 va_end( ap ); | 99 va_end( ap ); |
100 } | 100 } |
101 | 101 |
102 void Statement::warning(const char *format, ...) | 102 void Statement::warning(const char *format, ...) |
103 { | 103 { |
104 if (global.params.warnings && !global.gag) | 104 va_list ap; |
105 { | 105 va_start(ap, format); |
106 va_list ap; | 106 ::vwarning(loc, format, ap); |
107 va_start(ap, format); | 107 va_end( ap ); |
108 ::vwarning(loc, format, ap); | |
109 va_end( ap ); | |
110 } | |
111 } | 108 } |
112 | 109 |
113 int Statement::hasBreak() | 110 int Statement::hasBreak() |
114 { | 111 { |
115 //printf("Statement::hasBreak()\n"); | 112 //printf("Statement::hasBreak()\n"); |
735 for (size_t i = 0; i < statements->dim; i++) | 732 for (size_t i = 0; i < statements->dim; i++) |
736 { | 733 { |
737 Statement *s = (Statement *) statements->data[i]; | 734 Statement *s = (Statement *) statements->data[i]; |
738 if (s) | 735 if (s) |
739 { | 736 { |
737 //printf("[%d]: %s\n", i, s->toChars()); | |
740 s = s->semantic(scd); | 738 s = s->semantic(scd); |
741 statements->data[i] = s; | 739 statements->data[i] = s; |
742 } | 740 } |
743 } | 741 } |
744 | 742 |
795 result |= r & ~(BEbreak | BEcontinue); | 793 result |= r & ~(BEbreak | BEcontinue); |
796 } | 794 } |
797 } | 795 } |
798 return result; | 796 return result; |
799 } | 797 } |
798 | |
800 | 799 |
801 int UnrolledLoopStatement::comeFrom() | 800 int UnrolledLoopStatement::comeFrom() |
802 { int comefrom = FALSE; | 801 { int comefrom = FALSE; |
803 | 802 |
804 //printf("UnrolledLoopStatement::comeFrom()\n"); | 803 //printf("UnrolledLoopStatement::comeFrom()\n"); |
3464 * exp; return; | 3463 * exp; return; |
3465 */ | 3464 */ |
3466 Statement *s = new ExpStatement(loc, exp); | 3465 Statement *s = new ExpStatement(loc, exp); |
3467 exp = NULL; | 3466 exp = NULL; |
3468 s = s->semantic(sc); | 3467 s = s->semantic(sc); |
3469 loc = 0; | |
3470 return new CompoundStatement(loc, s, this); | 3468 return new CompoundStatement(loc, s, this); |
3471 } | 3469 } |
3472 | 3470 |
3473 return this; | 3471 return this; |
3474 } | 3472 } |