Changeset 8fd52e90 for src/SymTab/Validate.cc
- Timestamp:
- Jul 12, 2019, 1:51:32 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 6f096d2, c6dc7f2
- Parents:
- fce4e31
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
rfce4e31 r8fd52e90 642 642 643 643 void LinkReferenceToTypes_old::postvisit( EnumInstType * enumInst ) { 644 EnumDecl * st = local_indexer->lookupMutableEnum( enumInst->name );644 const EnumDecl * st = local_indexer->lookupEnum( enumInst->name ); 645 645 // it's not a semantic error if the enum is not found, just an implicit forward declaration 646 646 if ( st ) { 647 enumInst->baseEnum = st;647 enumInst->baseEnum = const_cast<EnumDecl *>(st); // Just linking in the node 648 648 } // if 649 649 if ( ! st || ! st->body ) { … … 662 662 663 663 void LinkReferenceToTypes_old::postvisit( StructInstType * structInst ) { 664 StructDecl * st = local_indexer->lookupMutableStruct( structInst->name );664 const StructDecl * st = local_indexer->lookupStruct( structInst->name ); 665 665 // it's not a semantic error if the struct is not found, just an implicit forward declaration 666 666 if ( st ) { 667 structInst->baseStruct = st;667 structInst->baseStruct = const_cast<StructDecl *>(st); // Just linking in the node 668 668 } // if 669 669 if ( ! st || ! st->body ) { … … 675 675 676 676 void LinkReferenceToTypes_old::postvisit( UnionInstType * unionInst ) { 677 UnionDecl * un = local_indexer->lookupMutableUnion( unionInst->name );677 const UnionDecl * un = local_indexer->lookupUnion( unionInst->name ); 678 678 // it's not a semantic error if the union is not found, just an implicit forward declaration 679 679 if ( un ) { 680 unionInst->baseUnion = un;680 unionInst->baseUnion = const_cast<UnionDecl *>(un); // Just linking in the node 681 681 } // if 682 682 if ( ! un || ! un->body ) { … … 762 762 void LinkReferenceToTypes_old::postvisit( TraitInstType * traitInst ) { 763 763 // handle other traits 764 TraitDecl * traitDecl = local_indexer->lookupMutableTrait( traitInst->name );764 const TraitDecl * traitDecl = local_indexer->lookupTrait( traitInst->name ); 765 765 if ( ! traitDecl ) { 766 766 SemanticError( traitInst->location, "use of undeclared trait " + traitInst->name ); … … 769 769 SemanticError( traitInst, "incorrect number of trait parameters: " ); 770 770 } // if 771 traitInst->baseTrait = traitDecl;771 traitInst->baseTrait = const_cast<TraitDecl *>(traitDecl); // Just linking in the node 772 772 773 773 // need to carry over the 'sized' status of each decl in the instance
Note: See TracChangeset
for help on using the changeset viewer.