Ignore:
Timestamp:
Jun 8, 2023, 3:19:43 PM (12 months ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT
Parents:
044ae62
Message:

Finish Adt POC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Validate/LinkReferenceToTypes.cpp

    r044ae62 rfa2c005  
    2020#include "Validate/ForallPointerDecay.hpp"
    2121#include "Validate/NoIdSymbolTable.hpp"
     22#include <assert.h>
    2223
    2324namespace Validate {
     
    3536        ast::UnionInstType const * postvisit( ast::UnionInstType const * type );
    3637        ast::TraitInstType const * postvisit( ast::TraitInstType const * type );
     38        ast::AdtInstType const * postvisit( ast::AdtInstType const * type );
    3739        void previsit( ast::QualifiedType const * type );
    3840        void postvisit( ast::QualifiedType const * type );
     
    107109                auto mut = ast::mutate( type );
    108110                forwardStructs[ mut->name ].push_back( mut );
     111                type = mut;
     112        }
     113        return type;
     114}
     115
     116ast::AdtInstType const * LinkTypesCore::postvisit( ast::AdtInstType const * type ) {
     117        ast::AdtDecl const * decl = symtab.lookupAdt( type->name );
     118        assert( decl != nullptr );
     119        if ( decl ) {
     120                auto mut = ast::mutate( type );
     121                mut->base = const_cast<ast::AdtDecl *>( decl );
    109122                type = mut;
    110123        }
Note: See TracChangeset for help on using the changeset viewer.