Changeset e9e9f56 for src/Tuples


Ignore:
Timestamp:
Sep 21, 2022, 9:22:24 AM (23 months 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/Tuples/TupleExpansionNew.cpp

    rb6c3688 re9e9f56  
    1010// Created On       : Mon Aug 23 15:36:09 2021
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Aug 15 17:00:00 2022
    13 // Update Count     : 3
     12// Last Modified On : Tue Sep 20 16:17:00 2022
     13// Update Count     : 4
    1414//
    1515
     
    102102/// Replaces Tuple Assign & Index Expressions, and Tuple Types.
    103103struct TupleMainExpander final :
     104                public ast::WithCodeLocation,
     105                public ast::WithDeclsToAdd<>,
    104106                public ast::WithGuards,
    105                 public ast::WithVisitorRef<TupleMainExpander>,
    106                 public ast::WithDeclsToAdd<> {
     107                public ast::WithVisitorRef<TupleMainExpander> {
    107108        ast::Expr const * postvisit( ast::TupleAssignExpr const * expr ) {
    108109                // Just move the env on the new top level expression.
     
    111112        }
    112113
    113         void previsit( ast::ParseNode const * node ) {
    114                 GuardValue( location ) = &node->location;
    115         }
    116 
    117         void previsit( ast::CompoundStmt const * stmt ) {
    118                 previsit( (ast::ParseNode const *)stmt );
     114        void previsit( ast::CompoundStmt const * ) {
    119115                GuardScope( typeMap );
    120116        }
     
    217213private:
    218214        ScopedMap< int, ast::StructDecl const * > typeMap;
    219         CodeLocation const * location = nullptr;
    220215};
    221216
Note: See TracChangeset for help on using the changeset viewer.