Changeset a488783


Ignore:
Timestamp:
Jan 26, 2022, 2:42:52 PM (4 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
enum, forall-pointer-decay, master
Children:
bbfe226
Parents:
97fed44
Message:

Translated the first half of validate-D. HoistControlStruct? is pretty much the same, Autogen has changed a lot due to the changes in the AST.

Location:
src
Files:
4 added
7 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Copy.hpp

    r97fed44 ra488783  
    1010// Created On       : Wed Jul 10 16:13:00 2019
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Thr Nov 11  9:22:00 2021
    13 // Update Count     : 2
     12// Last Modified On : Wed Dec 15 11:07:00 2021
     13// Update Count     : 3
    1414//
    1515
     
    5252Node * deepCopy<Node>( const Node * localRoot );
    5353
     54template<typename node_t, enum Node::ref_type ref_t>
     55node_t * shallowCopy( const ptr_base<node_t, ref_t> & localRoot ) {
     56        return shallowCopy( localRoot.get() );
     57}
     58
     59template<typename node_t, enum Node::ref_type ref_t>
     60node_t * deepCopy( const ptr_base<node_t, ref_t> & localRoot ) {
     61        return deepCopy( localRoot.get() );
     62}
     63
    5464}
    5565
  • src/AST/Node.hpp

    r97fed44 ra488783  
    188188        }
    189189
     190        ptr_base & operator=( const node_t * node ) {
     191                assign( node );
     192                return *this;
     193        }
     194
    190195        template<typename o_node_t>
    191196        ptr_base & operator=( const o_node_t * node ) {
  • src/ControlStruct/module.mk

    r97fed44 ra488783  
    2222        ControlStruct/ForExprMutator.cc \
    2323        ControlStruct/ForExprMutator.h \
     24        ControlStruct/HoistControlDecls.cpp \
     25        ControlStruct/HoistControlDecls.hpp \
    2426        ControlStruct/LabelFixer.cc \
    2527        ControlStruct/LabelFixer.h \
  • src/SymTab/Validate.cc

    r97fed44 ra488783  
    453453        }
    454454
     455        void decayForallPointers( std::list< Declaration * > & translationUnit ) {
     456                PassVisitor<ForallPointerDecay_old> fpd;
     457                acceptAll( translationUnit, fpd );
     458        }
     459
    455460        void validate( std::list< Declaration * > &translationUnit, __attribute__((unused)) bool doDebug ) {
    456461                validate_A( translationUnit );
     
    470475                type->accept( fpd );
    471476        }
    472 
    473477
    474478        void HoistTypeDecls::handleType( Type * type ) {
  • src/SymTab/Validate.h

    r97fed44 ra488783  
    4242        void validate_E( std::list< Declaration * > &translationUnit );
    4343        void validate_F( std::list< Declaration * > &translationUnit );
     44        void decayForallPointers( std::list< Declaration * > & translationUnit );
    4445
    4546        const ast::Type * validateType(
  • src/Validate/module.mk

    r97fed44 ra488783  
    1616
    1717SRC_VALIDATE = \
     18        Validate/Autogen.cpp \
     19        Validate/Autogen.hpp \
    1820        Validate/CompoundLiteral.cpp \
    1921        Validate/CompoundLiteral.hpp \
  • src/main.cc

    r97fed44 ra488783  
    1010// Created On       : Fri May 15 23:12:02 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Tue Nov 30 10:25:00 2021
    13 // Update Count     : 659
     12// Last Modified On : Wed Jan 26 14:09:00 2022
     13// Update Count     : 670
    1414//
    1515
     
    5555#include "ControlStruct/ExceptTranslate.h"  // for translateEHM
    5656#include "ControlStruct/FixLabels.hpp"      // for fixLabels
     57#include "ControlStruct/HoistControlDecls.hpp" //  hoistControlDecls
    5758#include "ControlStruct/Mutate.h"           // for mutate
    5859#include "GenPoly/Box.h"                    // for box
     
    7374#include "SynTree/Visitor.h"                // for acceptAll
    7475#include "Tuples/Tuples.h"                  // for expandMemberTuples, expan...
     76#include "Validate/Autogen.hpp"             // for autogenerateRoutines
    7577#include "Validate/FindSpecialDecls.h"      // for findGlobalDecls
    7678#include "Validate/CompoundLiteral.hpp"     // for handleCompoundLiterals
     
    7880#include "Validate/LabelAddressFixer.hpp"   // for fixLabelAddresses
    7981#include "Virtual/ExpandCasts.h"            // for expandCasts
    80 
    8182
    8283static void NewPass( const char * const name ) {
     
    326327                PASS( "Validate-B", SymTab::validate_B( translationUnit ) );
    327328                PASS( "Validate-C", SymTab::validate_C( translationUnit ) );
    328                 PASS( "Validate-D", SymTab::validate_D( translationUnit ) );
    329329
    330330                CodeTools::fillLocations( translationUnit );
    331331
    332332                if( useNewAST ) {
     333                        PASS( "Apply Concurrent Keywords", Concurrency::applyKeywords( translationUnit ) );
     334                        PASS( "Forall Pointer Decay", SymTab::decayForallPointers( translationUnit ) );
     335                        CodeTools::fillLocations( translationUnit );
     336
    333337                        if (Stats::Counters::enabled) {
    334338                                ast::pass_visitor_stats.avg = Stats::Counters::build<Stats::Counters::AverageCounter<double>>("Average Depth - New");
     
    338342
    339343                        forceFillCodeLocations( transUnit );
     344
     345                        // Must happen before autogen routines are added.
     346                        PASS( "Hoist Control Declarations", ControlStruct::hoistControlDecls( transUnit ) );
     347
     348                        // Must be after enum and pointer decay.
     349                        // Must be before compound literals.
     350                        PASS( "Generate Autogen Routines", Validate::autogenerateRoutines( transUnit ) );
    340351
    341352                        PASS( "Implement Mutex", Concurrency::implementMutex( transUnit ) );
     
    406417                        translationUnit = convert( move( transUnit ) );
    407418                } else {
     419                        PASS( "Validate-D", SymTab::validate_D( translationUnit ) );
    408420                        PASS( "Validate-E", SymTab::validate_E( translationUnit ) );
    409421                        PASS( "Validate-F", SymTab::validate_F( translationUnit ) );
Note: See TracChangeset for help on using the changeset viewer.