Ignore:
Timestamp:
Sep 21, 2022, 9:22:24 AM (2 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master, pthread-emulation
Children:
20737104
Parents:
b6c3688
Message:

Used the WithCodeLocation? helper in more passes. This cleans up some code and should improve efficiency.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Validate/GenericParameter.cpp

    rb6c3688 re9e9f56  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // GenericParameter.hpp -- Generic parameter related passes.
     7// GenericParameter.cpp -- Generic parameter related passes.
    88//
    99// Author           : Andrew Beach
    1010// Created On       : Fri Mar 21 10:02:00 2022
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Apr 22 16:43:00 2022
    13 // Update Count     : 1
     12// Last Modified On : Tue Sep 20 16:28:00 2022
     13// Update Count     : 2
    1414//
    1515
     
    119119}
    120120
    121 struct ValidateGenericParamsCore : public ast::WithGuards {
    122         const CodeLocation * locationPtr = nullptr;
    123 
    124         void previsit( const ast::ParseNode * node ) {
    125                 GuardValue( locationPtr ) = &node->location;
    126         }
    127 
     121struct ValidateGenericParamsCore : public ast::WithCodeLocation {
    128122        const ast::StructInstType * previsit( const ast::StructInstType * type ) {
    129                 assert( locationPtr );
    130                 return validateGeneric( *locationPtr, type );
     123                assert( location );
     124                return validateGeneric( *location, type );
    131125        }
    132126
    133127        const ast::UnionInstType * previsit( const ast::UnionInstType * type ) {
    134                 assert( locationPtr );
    135                 return validateGeneric( *locationPtr, type );
     128                assert( location );
     129                return validateGeneric( *location, type );
    136130        }
    137131};
Note: See TracChangeset for help on using the changeset viewer.