Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    rd88f8b3b r2c04369  
    1010// Created On       : Thu May 09 15::37::05 2019
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Wed May 29 17:05:00 2019
    13 // Update Count     : 9
     12// Last Modified On : Tue May 28 12:00:00 2019
     13// Update Count     : 7
    1414//
    1515
     
    2525#include "AST/TypeSubstitution.hpp"
    2626
    27 #include "SymTab/Autogen.h"
    2827#include "SynTree/Attribute.h"
    2928#include "SynTree/Declaration.h"
    3029#include "SynTree/TypeSubstitution.h"
    31 
    32 #include "Validate/FindSpecialDecls.h"
    3330
    3431//================================================================================================
     
    4340        }
    4441};
    45 
    46 //================================================================================================
    47 namespace {
    48 
    49 // This is to preserve the SymTab::dereferenceOperator hack. It does not (and perhaps should not)
    50 // allow us to use the same stratagy in the new ast.
    51 ast::FunctionDecl * dereferenceOperator = nullptr;
    52 
    53 }
    5442
    5543//================================================================================================
     
    166154                        LinkageSpec::Spec( node->linkage.val ),
    167155                        get<FunctionType>().accept1( node->type ),
    168                         {},
     156                        get<CompoundStmt>().accept1( node->stmts ),
    169157                        get<Attribute>().acceptL( node->attributes ),
    170158                        Type::FuncSpecifiers( node->funcSpec.val )
    171159                );
    172                 cache.emplace( node, decl );
    173                 decl->statements = get<CompoundStmt>().accept1( node->stmts );
    174160                decl->withExprs = get<Expression>().acceptL( node->withExprs );
    175                 if ( dereferenceOperator == node ) {
    176                         Validate::dereferenceOperator = decl;
    177                 }
    178161                return declWithTypePostamble( decl, node );
    179162        }
     
    888871                );
    889872
     873                rslt->tempDecls = get<ObjectDecl>().acceptL(node->tempDecls);
     874                rslt->returnDecls = get<ObjectDecl>().acceptL(node->returnDecls);
     875                rslt->dtors = get<Expression>().acceptL(node->dtors);
     876
    890877                auto expr = visitBaseExpr( node, rslt );
    891878                this->node = expr;
     
    14381425                        old->name,
    14391426                        GET_ACCEPT_1(type, FunctionType),
    1440                         {},
     1427                        GET_ACCEPT_1(statements, CompoundStmt),
    14411428                        { old->storageClasses.val },
    14421429                        { old->linkage.val },
     
    14451432                };
    14461433                cache.emplace( old, decl );
    1447                 decl->stmts = GET_ACCEPT_1(statements, CompoundStmt);
    14481434                decl->scopeLevel = old->scopeLevel;
    14491435                decl->mangleName = old->mangleName;
     
    14531439
    14541440                this->node = decl;
    1455 
    1456                 if ( Validate::dereferenceOperator == old ) {
    1457                         dereferenceOperator = decl;
    1458                 }
    14591441        }
    14601442
     
    15021484        virtual void visit( EnumDecl * old ) override final {
    15031485                if ( inCache( old ) ) return;
    1504                 auto decl = new ast::EnumDecl(
     1486                auto decl = new ast::UnionDecl(
    15051487                        old->location,
    15061488                        old->name,
     
    15221504        virtual void visit( TraitDecl * old ) override final {
    15231505                if ( inCache( old ) ) return;
    1524                 auto decl = new ast::TraitDecl(
     1506                auto decl = new ast::UnionDecl(
    15251507                        old->location,
    15261508                        old->name,
     
    22832265                );
    22842266
     2267                rslt->tempDecls = GET_ACCEPT_V(tempDecls, ObjectDecl);
     2268                rslt->returnDecls = GET_ACCEPT_V(returnDecls, ObjectDecl);
     2269                rslt->dtors = GET_ACCEPT_V(dtors, Expr);
     2270
    22852271                this->node = visitBaseExpr( old, rslt );
    22862272        }
Note: See TracChangeset for help on using the changeset viewer.