Ignore:
Timestamp:
Jul 12, 2019, 1:51:32 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
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
Message:

Removed uses of lookupMutableXXX

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    rfce4e31 r8fd52e90  
    642642
    643643        void LinkReferenceToTypes_old::postvisit( EnumInstType * enumInst ) {
    644                 EnumDecl * st = local_indexer->lookupMutableEnum( enumInst->name );
     644                const EnumDecl * st = local_indexer->lookupEnum( enumInst->name );
    645645                // it's not a semantic error if the enum is not found, just an implicit forward declaration
    646646                if ( st ) {
    647                         enumInst->baseEnum = st;
     647                        enumInst->baseEnum = const_cast<EnumDecl *>(st); // Just linking in the node
    648648                } // if
    649649                if ( ! st || ! st->body ) {
     
    662662
    663663        void LinkReferenceToTypes_old::postvisit( StructInstType * structInst ) {
    664                 StructDecl * st = local_indexer->lookupMutableStruct( structInst->name );
     664                const StructDecl * st = local_indexer->lookupStruct( structInst->name );
    665665                // it's not a semantic error if the struct is not found, just an implicit forward declaration
    666666                if ( st ) {
    667                         structInst->baseStruct = st;
     667                        structInst->baseStruct = const_cast<StructDecl *>(st); // Just linking in the node
    668668                } // if
    669669                if ( ! st || ! st->body ) {
     
    675675
    676676        void LinkReferenceToTypes_old::postvisit( UnionInstType * unionInst ) {
    677                 UnionDecl * un = local_indexer->lookupMutableUnion( unionInst->name );
     677                const UnionDecl * un = local_indexer->lookupUnion( unionInst->name );
    678678                // it's not a semantic error if the union is not found, just an implicit forward declaration
    679679                if ( un ) {
    680                         unionInst->baseUnion = un;
     680                        unionInst->baseUnion = const_cast<UnionDecl *>(un); // Just linking in the node
    681681                } // if
    682682                if ( ! un || ! un->body ) {
     
    762762        void LinkReferenceToTypes_old::postvisit( TraitInstType * traitInst ) {
    763763                // handle other traits
    764                 TraitDecl * traitDecl = local_indexer->lookupMutableTrait( traitInst->name );
     764                const TraitDecl * traitDecl = local_indexer->lookupTrait( traitInst->name );
    765765                if ( ! traitDecl ) {
    766766                        SemanticError( traitInst->location, "use of undeclared trait " + traitInst->name );
     
    769769                        SemanticError( traitInst, "incorrect number of trait parameters: " );
    770770                } // if
    771                 traitInst->baseTrait = traitDecl;
     771                traitInst->baseTrait = const_cast<TraitDecl *>(traitDecl); // Just linking in the node
    772772
    773773                // need to carry over the 'sized' status of each decl in the instance
Note: See TracChangeset for help on using the changeset viewer.