Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(704)

Delta Between Two Patch Sets: src/cmd/gc/subr.c

Issue 4442099: code review 4442099: gc: preserve original expression for errors (Closed)
Left Patch Set: Created 13 years, 11 months ago
Right Patch Set: diff -r 4abcd1a58d3d https://go.googlecode.com/hg Created 13 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « src/cmd/gc/go.h ('k') | src/cmd/gc/typecheck.c » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(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 "go.h" 5 #include "go.h"
6 #include "md5.h" 6 #include "md5.h"
7 #include "y.tab.h" 7 #include "y.tab.h"
8 #include "opnames.h" 8 #include "opnames.h"
9 #include "yerr.h" 9 #include "yerr.h"
10 10
(...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after
1447 if(n->type == T) 1447 if(n->type == T)
1448 fmtprint(fp, "%#N", n); 1448 fmtprint(fp, "%#N", n);
1449 else if(n->type->etype == TNIL) 1449 else if(n->type->etype == TNIL)
1450 fmtprint(fp, "nil"); 1450 fmtprint(fp, "nil");
1451 else 1451 else
1452 fmtprint(fp, "%#N (type %T)", n, n->type); 1452 fmtprint(fp, "%#N (type %T)", n, n->type);
1453 goto out; 1453 goto out;
1454 } 1454 }
1455 1455
1456 if(fp->flags & FmtSharp) { 1456 if(fp->flags & FmtSharp) {
1457 if(n->orig != N)
1458 n = n->orig;
1457 exprfmt(fp, n, 0); 1459 exprfmt(fp, n, 0);
1458 goto out; 1460 goto out;
1459 } 1461 }
1460 1462
1461 switch(n->op) { 1463 switch(n->op) {
1462 default: 1464 default:
1463 fmtprint(fp, "%O%J", n->op, n); 1465 fmtprint(fp, "%O%J", n->op, n);
1464 break; 1466 break;
1465 1467
1466 case ONAME: 1468 case ONAME:
(...skipping 2257 matching lines...) Expand 10 before | Expand all | Expand 10 after
3724 Strlit* 3726 Strlit*
3725 strlit(char *s) 3727 strlit(char *s)
3726 { 3728 {
3727 Strlit *t; 3729 Strlit *t;
3728 ········ 3730 ········
3729 t = mal(sizeof *t + strlen(s)); 3731 t = mal(sizeof *t + strlen(s));
3730 strcpy(t->s, s); 3732 strcpy(t->s, s);
3731 t->len = strlen(s); 3733 t->len = strlen(s);
3732 return t; 3734 return t;
3733 } 3735 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b