Mercurial > projects > ddmd
comparison dmd/TemplateInstance.d @ 72:2e2a5c3f943a
reduced warnings by adding override to the methods
think this also normalizes different line endings used all over the place
author | Trass3r |
---|---|
date | Sat, 28 Aug 2010 16:19:48 +0200 |
parents | 6557375aff35 |
children | 7e0d548de9e6 |
comparison
equal
deleted
inserted
replaced
71:8e24ef1dd139 | 72:2e2a5c3f943a |
---|---|
240 } | 240 } |
241 } | 241 } |
242 return a; | 242 return a; |
243 } | 243 } |
244 | 244 |
245 Dsymbol syntaxCopy(Dsymbol s) | 245 override Dsymbol syntaxCopy(Dsymbol s) |
246 { | 246 { |
247 TemplateInstance ti; | 247 TemplateInstance ti; |
248 | 248 |
249 if (s) | 249 if (s) |
250 ti = cast(TemplateInstance)s; | 250 ti = cast(TemplateInstance)s; |
255 | 255 |
256 ScopeDsymbol.syntaxCopy(ti); | 256 ScopeDsymbol.syntaxCopy(ti); |
257 return ti; | 257 return ti; |
258 } | 258 } |
259 | 259 |
260 void semantic(Scope sc) | 260 override void semantic(Scope sc) |
261 { | 261 { |
262 if (global.errors) | 262 if (global.errors) |
263 { | 263 { |
264 if (!global.gag) | 264 if (!global.gag) |
265 { | 265 { |
605 version (LOG) { | 605 version (LOG) { |
606 printf("-TemplateInstance.semantic('%s', this=%p)\n", toChars(), this); | 606 printf("-TemplateInstance.semantic('%s', this=%p)\n", toChars(), this); |
607 } | 607 } |
608 } | 608 } |
609 | 609 |
610 void semantic2(Scope sc) | 610 override void semantic2(Scope sc) |
611 { | 611 { |
612 int i; | 612 int i; |
613 | 613 |
614 if (semanticRun >= 2) | 614 if (semanticRun >= 2) |
615 return; | 615 return; |
643 version (LOG) { | 643 version (LOG) { |
644 printf("-TemplateInstance.semantic2('%s')\n", toChars()); | 644 printf("-TemplateInstance.semantic2('%s')\n", toChars()); |
645 } | 645 } |
646 } | 646 } |
647 | 647 |
648 void semantic3(Scope sc) | 648 override void semantic3(Scope sc) |
649 { | 649 { |
650 version (LOG) { | 650 version (LOG) { |
651 printf("TemplateInstance.semantic3('%s'), semanticRun = %d\n", toChars(), semanticRun); | 651 printf("TemplateInstance.semantic3('%s'), semanticRun = %d\n", toChars(), semanticRun); |
652 } | 652 } |
653 //if (toChars()[0] == 'D') *(char*)0=0; | 653 //if (toChars()[0] == 'D') *(char*)0=0; |
668 sc = sc.pop(); | 668 sc = sc.pop(); |
669 sc.pop(); | 669 sc.pop(); |
670 } | 670 } |
671 } | 671 } |
672 | 672 |
673 void inlineScan() | 673 override void inlineScan() |
674 { | 674 { |
675 version (LOG) { | 675 version (LOG) { |
676 printf("TemplateInstance.inlineScan('%s')\n", toChars()); | 676 printf("TemplateInstance.inlineScan('%s')\n", toChars()); |
677 } | 677 } |
678 if (!errors && members) | 678 if (!errors && members) |
683 s.inlineScan(); | 683 s.inlineScan(); |
684 } | 684 } |
685 } | 685 } |
686 } | 686 } |
687 | 687 |
688 void toCBuffer(OutBuffer buf, HdrGenState* hgs) | 688 override void toCBuffer(OutBuffer buf, HdrGenState* hgs) |
689 { | 689 { |
690 int i; | 690 int i; |
691 | 691 |
692 Identifier id = name; | 692 Identifier id = name; |
693 buf.writestring(id.toChars()); | 693 buf.writestring(id.toChars()); |
708 nest--; | 708 nest--; |
709 } | 709 } |
710 buf.writeByte(')'); | 710 buf.writeByte(')'); |
711 } | 711 } |
712 | 712 |
713 Dsymbol toAlias() // resolve real symbol | 713 override Dsymbol toAlias() // resolve real symbol |
714 { | 714 { |
715 version (LOG) { | 715 version (LOG) { |
716 printf("TemplateInstance.toAlias()\n"); | 716 printf("TemplateInstance.toAlias()\n"); |
717 } | 717 } |
718 if (!inst) | 718 if (!inst) |
730 } | 730 } |
731 | 731 |
732 return inst; | 732 return inst; |
733 } | 733 } |
734 | 734 |
735 string kind() | 735 override string kind() |
736 { | 736 { |
737 return "template instance"; | 737 return "template instance"; |
738 } | 738 } |
739 | 739 |
740 bool oneMember(Dsymbol* ps) | 740 override bool oneMember(Dsymbol* ps) |
741 { | 741 { |
742 *ps = null; | 742 *ps = null; |
743 return true; | 743 return true; |
744 } | 744 } |
745 | 745 |
746 string toChars() | 746 override string toChars() |
747 { | 747 { |
748 scope OutBuffer buf = new OutBuffer(); | 748 scope OutBuffer buf = new OutBuffer(); |
749 HdrGenState hgs; | 749 HdrGenState hgs; |
750 | 750 |
751 toCBuffer(buf, &hgs); | 751 toCBuffer(buf, &hgs); |
752 return buf.extractString(); | 752 return buf.extractString(); |
753 } | 753 } |
754 | 754 |
755 string mangle() | 755 override string mangle() |
756 { | 756 { |
757 OutBuffer buf = new OutBuffer(); | 757 OutBuffer buf = new OutBuffer(); |
758 string id; | 758 string id; |
759 | 759 |
760 static if (0) { | 760 static if (0) { |
784 { | 784 { |
785 if (global.gag) | 785 if (global.gag) |
786 return; | 786 return; |
787 } | 787 } |
788 | 788 |
789 void toObjFile(int multiobj) // compile to .obj file | 789 override void toObjFile(int multiobj) // compile to .obj file |
790 { | 790 { |
791 version (LOG) { | 791 version (LOG) { |
792 printf("TemplateInstance.toObjFile('%s', this = %p)\n", toChars(), this); | 792 printf("TemplateInstance.toObjFile('%s', this = %p)\n", toChars(), this); |
793 } | 793 } |
794 if (!errors && members) | 794 if (!errors && members) |
1421 buf.data = null; | 1421 buf.data = null; |
1422 //printf("\tgenIdent = %s\n", id); | 1422 //printf("\tgenIdent = %s\n", id); |
1423 return new Identifier(id, TOKidentifier); | 1423 return new Identifier(id, TOKidentifier); |
1424 } | 1424 } |
1425 | 1425 |
1426 TemplateInstance isTemplateInstance() { return this; } | 1426 override TemplateInstance isTemplateInstance() { return this; } |
1427 | 1427 |
1428 AliasDeclaration isAliasDeclaration() | 1428 override AliasDeclaration isAliasDeclaration() |
1429 { | 1429 { |
1430 assert(false); | 1430 assert(false); |
1431 } | 1431 } |
1432 } | 1432 } |