Mercurial > projects > ldc
comparison dmd/attrib.c @ 1630:44b145be2ef5
Merge dmd 1.056.
author | Robert Clipsham <robert@octarineparrot.com> |
---|---|
date | Sat, 06 Feb 2010 15:53:52 +0000 |
parents | a413ae7329bf |
children |
comparison
equal
deleted
inserted
replaced
1629:b07d683ba4d0 | 1630:44b145be2ef5 |
---|---|
390 scstc &= ~(STCauto | STCscope | STCstatic | STCtls | STCmanifest | STCgshared); | 390 scstc &= ~(STCauto | STCscope | STCstatic | STCtls | STCmanifest | STCgshared); |
391 if (stc & (STCconst | STCimmutable | STCmanifest)) | 391 if (stc & (STCconst | STCimmutable | STCmanifest)) |
392 scstc &= ~(STCconst | STCimmutable | STCmanifest); | 392 scstc &= ~(STCconst | STCimmutable | STCmanifest); |
393 if (stc & (STCgshared | STCshared | STCtls)) | 393 if (stc & (STCgshared | STCshared | STCtls)) |
394 scstc &= ~(STCgshared | STCshared | STCtls); | 394 scstc &= ~(STCgshared | STCshared | STCtls); |
395 if (stc & (STCsafe | STCtrusted | STCsystem)) | |
396 scstc &= ~(STCsafe | STCtrusted | STCsystem); | |
395 scstc |= stc; | 397 scstc |= stc; |
396 | 398 |
397 setScopeNewSc(sc, scstc, sc->linkage, sc->protection, sc->explicitProtection, sc->structalign); | 399 setScopeNewSc(sc, scstc, sc->linkage, sc->protection, sc->explicitProtection, sc->structalign); |
398 } | 400 } |
399 } | 401 } |
413 scstc &= ~(STCauto | STCscope | STCstatic | STCtls | STCmanifest | STCgshared); | 415 scstc &= ~(STCauto | STCscope | STCstatic | STCtls | STCmanifest | STCgshared); |
414 if (stc & (STCconst | STCimmutable | STCmanifest)) | 416 if (stc & (STCconst | STCimmutable | STCmanifest)) |
415 scstc &= ~(STCconst | STCimmutable | STCmanifest); | 417 scstc &= ~(STCconst | STCimmutable | STCmanifest); |
416 if (stc & (STCgshared | STCshared | STCtls)) | 418 if (stc & (STCgshared | STCshared | STCtls)) |
417 scstc &= ~(STCgshared | STCshared | STCtls); | 419 scstc &= ~(STCgshared | STCshared | STCtls); |
420 if (stc & (STCsafe | STCtrusted | STCsystem)) | |
421 scstc &= ~(STCsafe | STCtrusted | STCsystem); | |
418 scstc |= stc; | 422 scstc |= stc; |
419 | 423 |
420 semanticNewSc(sc, scstc, sc->linkage, sc->protection, sc->explicitProtection, sc->structalign); | 424 semanticNewSc(sc, scstc, sc->linkage, sc->protection, sc->explicitProtection, sc->structalign); |
421 } | 425 } |
422 } | 426 } |
451 { STCnothrow, TOKnothrow }, | 455 { STCnothrow, TOKnothrow }, |
452 { STCpure, TOKpure }, | 456 { STCpure, TOKpure }, |
453 { STCref, TOKref }, | 457 { STCref, TOKref }, |
454 { STCtls, TOKtls }, | 458 { STCtls, TOKtls }, |
455 { STCgshared, TOKgshared }, | 459 { STCgshared, TOKgshared }, |
460 { STCproperty, TOKat }, | |
461 { STCsafe, TOKat }, | |
462 { STCtrusted, TOKat }, | |
463 { STCdisable, TOKat }, | |
456 #endif | 464 #endif |
457 }; | 465 }; |
458 | 466 |
459 for (int i = 0; i < sizeof(table)/sizeof(table[0]); i++) | 467 for (int i = 0; i < sizeof(table)/sizeof(table[0]); i++) |
460 { | 468 { |
712 { sc = scope; | 720 { sc = scope; |
713 scx = scope; | 721 scx = scope; |
714 scope = NULL; | 722 scope = NULL; |
715 } | 723 } |
716 | 724 |
725 unsigned dprogress_save = Module::dprogress; | |
726 | |
717 assert(sc->parent); | 727 assert(sc->parent); |
718 | 728 |
719 Dsymbol *parent = sc->parent->pastMixin(); | 729 Dsymbol *parent = sc->parent->pastMixin(); |
720 AggregateDeclaration *ad = parent->isAggregateDeclaration(); | 730 AggregateDeclaration *ad = parent->isAggregateDeclaration(); |
721 | 731 |
741 // printf("\tad = %p\n", ad); | 751 // printf("\tad = %p\n", ad); |
742 // printf("\taad = %p\n", &aad); | 752 // printf("\taad = %p\n", &aad); |
743 | 753 |
744 sc = sc->push(); | 754 sc = sc->push(); |
745 sc->anonAgg = &aad; | 755 sc->anonAgg = &aad; |
746 sc->stc &= ~(STCauto | STCscope | STCstatic | STCtls); | 756 sc->stc &= ~(STCauto | STCscope | STCstatic | STCtls | STCgshared); |
747 sc->inunion = isunion; | 757 sc->inunion = isunion; |
748 sc->offset = 0; | 758 sc->offset = 0; |
749 sc->flags = 0; | 759 sc->flags = 0; |
750 aad.structalign = sc->structalign; | 760 aad.structalign = sc->structalign; |
751 aad.parent = ad; | 761 aad.parent = ad; |
773 { | 783 { |
774 scope = scx ? scx : new Scope(*sc); | 784 scope = scx ? scx : new Scope(*sc); |
775 scope->setNoFree(); | 785 scope->setNoFree(); |
776 scope->module->addDeferredSemantic(this); | 786 scope->module->addDeferredSemantic(this); |
777 } | 787 } |
788 Module::dprogress = dprogress_save; | |
778 //printf("\tforward reference %p\n", this); | 789 //printf("\tforward reference %p\n", this); |
779 return; | 790 return; |
780 } | 791 } |
781 if (sem == 0) | 792 if (sem == 0) |
782 { Module::dprogress++; | 793 { Module::dprogress++; |
803 //printf("\tadding members of aad (%p) to '%s'\n", &aad, ad->toChars()); | 814 //printf("\tadding members of aad (%p) to '%s'\n", &aad, ad->toChars()); |
804 for (unsigned i = 0; i < aad.fields.dim; i++) | 815 for (unsigned i = 0; i < aad.fields.dim; i++) |
805 { | 816 { |
806 VarDeclaration *v = (VarDeclaration *)aad.fields.data[i]; | 817 VarDeclaration *v = (VarDeclaration *)aad.fields.data[i]; |
807 | 818 |
808 // LDC | 819 #if IN_LLVM |
809 v->offset2 = sc->offset; | 820 v->offset2 = sc->offset; |
810 | 821 #endif |
811 v->offset += sc->offset; | 822 v->offset += sc->offset; |
812 | 823 |
813 // LDC | 824 #if IN_LLVM |
814 if (!v->anonDecl) | 825 if (!v->anonDecl) |
815 v->anonDecl = this; | 826 v->anonDecl = this; |
816 | 827 #endif |
817 ad->fields.push(v); | 828 ad->fields.push(v); |
818 } | 829 } |
819 | 830 |
820 // Add size of aad to ad | 831 // Add size of aad to ad |
821 if (adisunion) | 832 if (adisunion) |
1367 | 1378 |
1368 StringExp *se = (StringExp *)e; | 1379 StringExp *se = (StringExp *)e; |
1369 char *name = (char *)mem.malloc(se->len + 1); | 1380 char *name = (char *)mem.malloc(se->len + 1); |
1370 memcpy(name, se->string, se->len); | 1381 memcpy(name, se->string, se->len); |
1371 name[se->len] = 0; | 1382 name[se->len] = 0; |
1383 #if OMFOBJ | |
1384 /* The OMF format allows library names to be inserted | |
1385 * into the object file. The linker will then automatically | |
1386 * search that library, too. | |
1387 */ | |
1372 obj_includelib(name); | 1388 obj_includelib(name); |
1389 #elif ELFOBJ || MACHOBJ | |
1390 /* The format does not allow embedded library names, | |
1391 * so instead append the library name to the list to be passed | |
1392 * to the linker. | |
1393 */ | |
1394 global.params.libfiles->push((void *) name); | |
1395 #else | |
1396 error("pragma lib not supported"); | |
1397 #endif | |
1373 } | 1398 } |
1374 #if DMDV2 | 1399 #if DMDV2 |
1375 else if (ident == Id::startaddress) | 1400 else if (ident == Id::startaddress) |
1376 { | 1401 { |
1377 assert(args && args->dim == 1); | 1402 assert(args && args->dim == 1); |