Ignore:
Timestamp:
Nov 3, 2020, 4:06:20 PM (15 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
4406887
Parents:
daefe93
Message:

TranslationUnit? is now used at the top-level of the new-ast passes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    rdaefe93 r293dc1c  
    2525#include "AST/Init.hpp"
    2626#include "AST/Stmt.hpp"
     27#include "AST/TranslationUnit.hpp"
    2728#include "AST/TypeSubstitution.hpp"
    2829
     
    14041405};
    14051406
    1406 std::list< Declaration * > convert( const std::list< ast::ptr< ast::Decl > > && translationUnit ) {
     1407std::list< Declaration * > convert( const ast::TranslationUnit && translationUnit ) {
    14071408        ConverterNewToOld c;
    14081409        std::list< Declaration * > decls;
    1409         for(auto d : translationUnit) {
     1410        for(auto d : translationUnit.decls) {
    14101411                decls.emplace_back( c.decl( d ) );
    14111412        }
     
    28032804#undef GET_ACCEPT_1
    28042805
    2805 std::list< ast::ptr< ast::Decl > > convert( const std::list< Declaration * > && translationUnit ) {
     2806ast::TranslationUnit convert( const std::list< Declaration * > && translationUnit ) {
    28062807        ConverterOldToNew c;
    2807         std::list< ast::ptr< ast::Decl > > decls;
     2808        ast::TranslationUnit unit;
    28082809        for(auto d : translationUnit) {
    28092810                d->accept( c );
    2810                 decls.emplace_back( c.decl() );
     2811                unit.decls.emplace_back( c.decl() );
    28112812        }
    28122813        deleteAll(translationUnit);
    2813         return decls;
     2814        return unit;
    28142815}
Note: See TracChangeset for help on using the changeset viewer.