LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 #include <u.h> | 5 #include <u.h> |
6 #include <libc.h> | 6 #include <libc.h> |
7 #include "go.h" | 7 #include "go.h" |
8 #include "md5.h" | 8 #include "md5.h" |
9 #include "y.tab.h" | 9 #include "y.tab.h" |
10 #include "opnames.h" | 10 #include "opnames.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 void | 202 void |
203 warn(char *fmt, ...) | 203 warn(char *fmt, ...) |
204 { | 204 { |
205 va_list arg; | 205 va_list arg; |
206 | 206 |
207 va_start(arg, fmt); | 207 va_start(arg, fmt); |
208 adderr(parserline(), fmt, arg); | 208 adderr(parserline(), fmt, arg); |
209 va_end(arg); | 209 va_end(arg); |
210 | 210 |
211 hcrash(); | 211 hcrash(); |
| 212 } |
| 213 |
| 214 void |
| 215 warnl(int line, char *fmt, ...) |
| 216 { |
| 217 va_list arg; |
| 218 |
| 219 va_start(arg, fmt); |
| 220 adderr(line, fmt, arg); |
| 221 va_end(arg); |
212 } | 222 } |
213 | 223 |
214 void | 224 void |
215 fatal(char *fmt, ...) | 225 fatal(char *fmt, ...) |
216 { | 226 { |
217 va_list arg; | 227 va_list arg; |
218 | 228 |
219 flusherrors(); | 229 flusherrors(); |
220 | 230 |
221 print("%L: internal compiler error: ", lineno); | 231 print("%L: internal compiler error: ", lineno); |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 { | 488 { |
479 Node *n; | 489 Node *n; |
480 | 490 |
481 n = mal(sizeof(*n)); | 491 n = mal(sizeof(*n)); |
482 n->op = op; | 492 n->op = op; |
483 n->left = nleft; | 493 n->left = nleft; |
484 n->right = nright; | 494 n->right = nright; |
485 n->lineno = parserline(); | 495 n->lineno = parserline(); |
486 n->xoffset = BADWIDTH; | 496 n->xoffset = BADWIDTH; |
487 n->orig = n; | 497 n->orig = n; |
| 498 n->curfn = curfn; |
488 return n; | 499 return n; |
489 } | 500 } |
490 | 501 |
491 int | 502 int |
492 algtype(Type *t) | 503 algtype(Type *t) |
493 { | 504 { |
494 int a; | 505 int a; |
495 | 506 |
496 if(issimple[t->etype] || isptr[t->etype] || | 507 if(issimple[t->etype] || isptr[t->etype] || |
497 t->etype == TCHAN || t->etype == TFUNC || t->etype == TMAP) { | 508 t->etype == TCHAN || t->etype == TFUNC || t->etype == TMAP) { |
(...skipping 3401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3899 Strlit* | 3910 Strlit* |
3900 strlit(char *s) | 3911 strlit(char *s) |
3901 { | 3912 { |
3902 Strlit *t; | 3913 Strlit *t; |
3903 ········ | 3914 ········ |
3904 t = mal(sizeof *t + strlen(s)); | 3915 t = mal(sizeof *t + strlen(s)); |
3905 strcpy(t->s, s); | 3916 strcpy(t->s, s); |
3906 t->len = strlen(s); | 3917 t->len = strlen(s); |
3907 return t; | 3918 return t; |
3908 } | 3919 } |
LEFT | RIGHT |