Left: | ||
Right: |
OLD | NEW |
---|---|
1 // Derived from Inferno utils/5c/txt.c | 1 // Derived from Inferno utils/5c/txt.c |
2 // http://code.google.com/p/inferno-os/source/browse/utils/5c/txt.c | 2 // http://code.google.com/p/inferno-os/source/browse/utils/5c/txt.c |
3 // | 3 // |
4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. | 4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. |
5 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) | 5 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) |
6 // Portions Copyright © 1997-1999 Vita Nuova Limited | 6 // Portions Copyright © 1997-1999 Vita Nuova Limited |
7 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov a.com) | 7 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov a.com) |
8 // Portions Copyright © 2004,2006 Bruce Ellis | 8 // Portions Copyright © 2004,2006 Bruce Ellis |
9 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) | 9 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) |
10 // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others | 10 // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
209 gargsize(int32 size) | 209 gargsize(int32 size) |
210 { | 210 { |
211 Node n1, n2; | 211 Node n1, n2; |
212 ········ | 212 ········ |
213 nodconst(&n1, types[TINT32], PCDATA_ArgSize); | 213 nodconst(&n1, types[TINT32], PCDATA_ArgSize); |
214 nodconst(&n2, types[TINT32], size); | 214 nodconst(&n2, types[TINT32], size); |
215 gins(APCDATA, &n1, &n2); | 215 gins(APCDATA, &n1, &n2); |
216 } | 216 } |
217 | 217 |
218 void | 218 void |
219 ggloblsym(Sym *s, int32 width, int dupok, int rodata) | 219 ggloblsym(Sym *s, int32 width, int dupok, int rodata, int hasptr) |
220 { | 220 { |
221 Prog *p; | 221 Prog *p; |
222 | 222 |
223 p = gins(AGLOBL, N, N); | 223 p = gins(AGLOBL, N, N); |
224 p->from.type = D_OREG; | 224 p->from.type = D_OREG; |
225 p->from.name = D_EXTERN; | 225 p->from.name = D_EXTERN; |
226 p->from.sym = linksym(s); | 226 p->from.sym = linksym(s); |
227 p->to.type = D_CONST; | 227 p->to.type = D_CONST; |
228 p->to.name = D_NONE; | 228 p->to.name = D_NONE; |
229 p->to.offset = width; | 229 p->to.offset = width; |
230 if(dupok) | 230 if(dupok) |
231 p->reg |= DUPOK; | 231 p->reg |= DUPOK; |
232 if(rodata) | 232 if(rodata) |
233 p->reg |= RODATA; | 233 p->reg |= RODATA; |
234 if(!hasptr) | |
rsc
2014/07/22 03:42:17
now that the flags have names, just make ggloblsym
dvyukov
2014/07/22 07:43:48
do you mean to take "int flags" and callers will p
| |
235 p->reg |= NOPTR; | |
234 } | 236 } |
235 | 237 |
236 void | 238 void |
237 gtrack(Sym *s) | 239 gtrack(Sym *s) |
238 { | 240 { |
239 Prog *p; | 241 Prog *p; |
240 ········ | 242 ········ |
241 p = gins(AUSEFIELD, N, N); | 243 p = gins(AUSEFIELD, N, N); |
242 p->from.type = D_OREG; | 244 p->from.type = D_OREG; |
243 p->from.name = D_EXTERN; | 245 p->from.name = D_EXTERN; |
(...skipping 1843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2087 naddr(&n2, a, 1); | 2089 naddr(&n2, a, 1); |
2088 goto yes; | 2090 goto yes; |
2089 | 2091 |
2090 yes: | 2092 yes: |
2091 return 1; | 2093 return 1; |
2092 | 2094 |
2093 no: | 2095 no: |
2094 sudoclean(); | 2096 sudoclean(); |
2095 return 0; | 2097 return 0; |
2096 } | 2098 } |
OLD | NEW |