Mercurial > projects > ldc
comparison dmd/dsymbol.c @ 946:1714836f2c0b
Mostly rewrite debug info generation in terms of llvm/Analysis/DebugInfo.h.
Add getCompilationModule to Dsymbol and fix template compile unit decision code.
Runtime compiles with -g again.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 08 Feb 2009 16:50:22 +0100 |
parents | e83ba4ae4878 |
children | b30fe7e1dbb9 |
comparison
equal
deleted
inserted
replaced
945:03d7c4aac654 | 946:1714836f2c0b |
---|---|
547 { | 547 { |
548 //printf("\ts = '%s'\n", s->toChars()); | 548 //printf("\ts = '%s'\n", s->toChars()); |
549 m = s->isModule(); | 549 m = s->isModule(); |
550 if (m) | 550 if (m) |
551 return m; | 551 return m; |
552 s = s->parent; | |
553 } | |
554 return NULL; | |
555 } | |
556 | |
557 | |
558 /********************************** | |
559 * Determine which Module a Dsymbol will be compiled in. | |
560 * This may be different from getModule for templates. | |
561 */ | |
562 | |
563 Module *Dsymbol::getCompilationModule() | |
564 { | |
565 Module *m; | |
566 TemplateInstance *ti; | |
567 Dsymbol *s; | |
568 | |
569 //printf("Dsymbol::getModule()\n"); | |
570 s = this; | |
571 while (s) | |
572 { | |
573 //printf("\ts = '%s'\n", s->toChars()); | |
574 m = s->isModule(); | |
575 if (m) | |
576 return m; | |
577 ti = s->isTemplateInstance(); | |
578 if (ti && ti->tmodule) | |
579 return ti->tmodule; | |
552 s = s->parent; | 580 s = s->parent; |
553 } | 581 } |
554 return NULL; | 582 return NULL; |
555 } | 583 } |
556 | 584 |