comparison dmd2/dsymbol.c @ 953:5fa3e0ea06e9

Merged a bunch recent dmd v1 frontend changes into the dmd v2 tree.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Fri, 13 Feb 2009 22:20:30 +0100
parents 356e65836fb5
children 638d16625da2
comparison
equal deleted inserted replaced
952:29da57670853 953:5fa3e0ea06e9
554 //printf("\ts = '%s'\n", s->toChars()); 554 //printf("\ts = '%s'\n", s->toChars());
555 m = s->isModule(); 555 m = s->isModule();
556 if (m) 556 if (m)
557 return m; 557 return m;
558 s = s->parent; 558 s = s->parent;
559 }
560 return NULL;
561 }
562
563
564 /**********************************
565 * Determine which Module a Dsymbol will be compiled in.
566 * This may be different from getModule for templates.
567 */
568
569 Module *Dsymbol::getCompilationModule()
570 {
571 Module *m;
572 TemplateInstance *ti;
573 Dsymbol *s;
574
575 //printf("Dsymbol::getModule()\n");
576 s = this;
577 while (s)
578 {
579 //printf("\ts = '%s'\n", s->toChars());
580 m = s->isModule();
581 if (m)
582 return m;
583 ti = s->isTemplateInstance();
584 if (ti && ti->tmodule)
585 return ti->tmodule;
586 s = s->parent;
559 } 587 }
560 return NULL; 588 return NULL;
561 } 589 }
562 590
563 /************************************* 591 /*************************************