LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2012 The Go Authors. All rights reserved. | 1 // Copyright 2012 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 "a.h" | 5 #include "a.h" |
6 #include <stdio.h> | 6 #include <stdio.h> |
7 | 7 |
8 /* | 8 /* |
9 * Helpers for building cmd/gc. | 9 * Helpers for building cmd/gc. |
10 */ | 10 */ |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 q++; | 48 q++; |
49 p = q+xstrlen(q)-1; | 49 p = q+xstrlen(q)-1; |
50 if(*p == ',') | 50 if(*p == ',') |
51 *p = '\0'; | 51 *p = '\0'; |
52 bwritestr(&out, bprintf(&b, " [O%s] = \"%s\",\n", q, q
)); | 52 bwritestr(&out, bprintf(&b, " [O%s] = \"%s\",\n", q, q
)); |
53 } | 53 } |
54 } | 54 } |
55 ········ | 55 ········ |
56 bwritestr(&out, bprintf(&b, "};\n")); | 56 bwritestr(&out, bprintf(&b, "};\n")); |
57 | 57 |
58 » writefile(&out, file); | 58 » writefile(&out, file, 0); |
59 | 59 |
60 bfree(&in); | 60 bfree(&in); |
61 bfree(&b); | 61 bfree(&b); |
62 bfree(&out); | 62 bfree(&out); |
63 vfree(&lines); | 63 vfree(&lines); |
64 vfree(&fields); | 64 vfree(&fields); |
65 } | 65 } |
66 | 66 |
67 // mkenam reads [568].out.h and writes enam.c | 67 // mkenam reads [568].out.h and writes enam.c |
68 // The format is much the same as the Go opcodes above. | 68 // The format is much the same as the Go opcodes above. |
(...skipping 21 matching lines...) Expand all Loading... |
90 if(p) | 90 if(p) |
91 *p = '\0'; | 91 *p = '\0'; |
92 p = xstrstr(lines.p[i], "\n"); | 92 p = xstrstr(lines.p[i], "\n"); |
93 if(p) | 93 if(p) |
94 *p = '\0'; | 94 *p = '\0'; |
95 p = lines.p[i] + 2; | 95 p = lines.p[i] + 2; |
96 bwritestr(&out, bprintf(&b, "\t\"%s\",\n", p)); | 96 bwritestr(&out, bprintf(&b, "\t\"%s\",\n", p)); |
97 } | 97 } |
98 } | 98 } |
99 bwritestr(&out, "};\n"); | 99 bwritestr(&out, "};\n"); |
100 » writefile(&out, file); | 100 » writefile(&out, file, 0); |
101 | 101 |
102 bfree(&b); | 102 bfree(&b); |
103 bfree(&in); | 103 bfree(&in); |
104 bfree(&out); | 104 bfree(&out); |
105 vfree(&lines); | 105 vfree(&lines); |
106 } | 106 } |
LEFT | RIGHT |