Mercurial > projects > ldc
comparison dmd2/dsymbol.c @ 1526:54b3c1394d62
Merged dmdfe 2.031.
author | Robert Clipsham <robert@octarineparrot.com> |
---|---|
date | Tue, 07 Jul 2009 02:26:11 +0100 |
parents | 638d16625da2 |
children | e4f7b5d9c68a |
comparison
equal
deleted
inserted
replaced
1525:d28cd7c45267 | 1526:54b3c1394d62 |
---|---|
1 | 1 |
2 // Compiler implementation of the D programming language | 2 // Compiler implementation of the D programming language |
3 // Copyright (c) 1999-2008 by Digital Mars | 3 // Copyright (c) 1999-2009 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. |
46 this->csym = NULL; | 46 this->csym = NULL; |
47 this->isym = NULL; | 47 this->isym = NULL; |
48 #endif | 48 #endif |
49 this->loc = 0; | 49 this->loc = 0; |
50 this->comment = NULL; | 50 this->comment = NULL; |
51 this->scope = NULL; | |
51 | 52 |
52 #if IN_LLVM | 53 #if IN_LLVM |
53 this->llvmInternal = LLVMnone; | 54 this->llvmInternal = LLVMnone; |
54 this->irsym = NULL; | 55 this->irsym = NULL; |
55 #endif | 56 #endif |
65 this->csym = NULL; | 66 this->csym = NULL; |
66 this->isym = NULL; | 67 this->isym = NULL; |
67 #endif | 68 #endif |
68 this->loc = 0; | 69 this->loc = 0; |
69 this->comment = NULL; | 70 this->comment = NULL; |
71 this->scope = NULL; | |
70 | 72 |
71 #if IN_LLVM | 73 #if IN_LLVM |
72 this->llvmInternal = LLVMnone; | 74 this->llvmInternal = LLVMnone; |
73 this->irsym = NULL; | 75 this->irsym = NULL; |
74 #endif | 76 #endif |
191 q -= len; | 193 q -= len; |
192 memcpy(q, t, len); | 194 memcpy(q, t, len); |
193 if (q == s) | 195 if (q == s) |
194 break; | 196 break; |
195 q--; | 197 q--; |
198 #if TARGET_NET | |
199 if (AggregateDeclaration* ad = p->isAggregateDeclaration()) | |
200 { | |
201 if (ad->isNested() && p->parent && p->parent->isAggregateDeclaration()) | |
202 { | |
203 *q = '/'; | |
204 continue; | |
205 } | |
206 } | |
207 #endif | |
196 *q = '.'; | 208 *q = '.'; |
197 } | 209 } |
198 return s; | 210 return s; |
199 } | 211 } |
200 | 212 |
267 int Dsymbol::isAnonymous() | 279 int Dsymbol::isAnonymous() |
268 { | 280 { |
269 return ident ? 0 : 1; | 281 return ident ? 0 : 1; |
270 } | 282 } |
271 | 283 |
284 /************************************* | |
285 * Set scope for future semantic analysis so we can | |
286 * deal better with forward references. | |
287 */ | |
288 | |
289 void Dsymbol::setScope(Scope *sc) | |
290 { | |
291 //printf("Dsymbol::setScope() %p %s\n", this, toChars()); | |
292 if (!sc->nofree) | |
293 sc->setNoFree(); // may need it even after semantic() finishes | |
294 scope = sc; | |
295 } | |
296 | |
297 /************************************* | |
298 * Does semantic analysis on the public face of declarations. | |
299 */ | |
300 | |
272 void Dsymbol::semantic(Scope *sc) | 301 void Dsymbol::semantic(Scope *sc) |
273 { | 302 { |
274 error("%p has no semantic routine", this); | 303 error("%p has no semantic routine", this); |
275 } | 304 } |
276 | 305 |
306 /************************************* | |
307 * Does semantic analysis on initializers and members of aggregates. | |
308 */ | |
309 | |
277 void Dsymbol::semantic2(Scope *sc) | 310 void Dsymbol::semantic2(Scope *sc) |
278 { | 311 { |
279 // Most Dsymbols have no further semantic analysis needed | 312 // Most Dsymbols have no further semantic analysis needed |
280 } | 313 } |
281 | 314 |
315 /************************************* | |
316 * Does semantic analysis on function bodies. | |
317 */ | |
318 | |
282 void Dsymbol::semantic3(Scope *sc) | 319 void Dsymbol::semantic3(Scope *sc) |
283 { | 320 { |
284 // Most Dsymbols have no further semantic analysis needed | 321 // Most Dsymbols have no further semantic analysis needed |
285 } | 322 } |
286 | 323 |
324 /************************************* | |
325 * Look for function inlining possibilities. | |
326 */ | |
327 | |
287 void Dsymbol::inlineScan() | 328 void Dsymbol::inlineScan() |
288 { | 329 { |
289 // Most Dsymbols have no further semantic analysis needed | 330 // Most Dsymbols aren't functions |
290 } | 331 } |
291 | 332 |
292 /********************************************* | 333 /********************************************* |
293 * Search for ident as member of s. | 334 * Search for ident as member of s. |
294 * Input: | 335 * Input: |
342 { | 383 { |
343 error("%s is not a template, it is a %s", id->toChars(), sm->kind()); | 384 error("%s is not a template, it is a %s", id->toChars(), sm->kind()); |
344 return NULL; | 385 return NULL; |
345 } | 386 } |
346 ti->tempdecl = td; | 387 ti->tempdecl = td; |
347 if (!ti->semanticdone) | 388 if (!ti->semanticRun) |
348 ti->semantic(sc); | 389 ti->semantic(sc); |
349 sm = ti->toAlias(); | 390 sm = ti->toAlias(); |
350 break; | 391 break; |
351 } | 392 } |
352 | 393 |