Ignore:
Timestamp:
May 23, 2019, 6:24:18 PM (3 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
arm-eh, cleanup-dtors, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr
Children:
6f4b7f2, d908563
Parents:
94b1f718 (diff), f1ec88a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r94b1f718 r21a44ca  
    1010// Created On       : Thu May 09 15::37::05 2019
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Tue May 21 15:30:00 2019
    13 // Update Count     : 5
     12// Last Modified On : Thu May 23 16:59:00 2019
     13// Update Count     : 6
    1414//
    1515
     
    121121        const ast::DeclWithType * declWithTypePostamble (
    122122                        DeclarationWithType * decl, const ast::DeclWithType * node ) {
    123                 declPostamble( decl, node );
     123                cache.emplace( node, decl );
    124124                decl->mangleName = node->mangleName;
    125125                decl->scopeLevel = node->scopeLevel;
     
    128128                decl->isDeleted = node->isDeleted;
    129129                // fs comes from constructor
    130                 cache.emplace( node, decl );
     130                declPostamble( decl, node );
    131131                return nullptr;
    132132        }
     
    162162        }
    163163
    164         // NamedTypeDecl
    165164        const ast::Decl * namedTypePostamble( NamedTypeDecl * decl, const ast::NamedTypeDecl * node ) {
    166                 declPostamble( decl, node );
    167165                // base comes from constructor
    168166                decl->parameters = get<TypeDecl>().acceptL( node->params );
    169167                decl->assertions = get<DeclarationWithType>().acceptL( node->assertions );
     168                declPostamble( decl, node );
    170169                return nullptr;
    171170        }
     
    197196
    198197        const ast::Decl * aggregatePostamble( AggregateDecl * decl, const ast::AggregateDecl * node ) {
     198                cache.emplace( node, decl );
    199199                decl->members = get<Declaration>().acceptL( node->members );
    200200                decl->parameters = get<TypeDecl>().acceptL( node->params );
     
    202202                // attributes come from constructor
    203203                decl->parent = get<AggregateDecl>().accept1( node->parent );
    204                 cache.emplace( node, decl );
     204                declPostamble( decl, node );
    205205                return nullptr;
    206206        }
     
    263263
    264264        const ast::Stmt * stmtPostamble( Statement * stmt, const ast::Stmt * node ) {
     265                cache.emplace( node, stmt );
    265266                stmt->location = node->location;
    266267                stmt->labels = makeLabelL( stmt, node->labels );
    267                 cache.emplace( node, stmt );
    268268                this->node = stmt;
    269269                return nullptr;
     
    279279        const ast::Stmt * visit( const ast::ExprStmt * node ) override final {
    280280                if ( inCache( node ) ) return nullptr;
    281                 auto stmt = new ExprStmt( get<Expression>().accept1( node->expr ) );
     281                auto stmt = new ExprStmt( nullptr );
     282                cache.emplace( node, stmt );
     283                stmt->expr = get<Expression>().accept1( node->expr );
    282284                return stmtPostamble( stmt, node );
    283285        }
     
    508510        TypeSubstitution * convertTypeSubstitution(const ast::TypeSubstitution * src) {
    509511
     512                if (!src) return nullptr;
     513
    510514                TypeSubstitution *rslt = new TypeSubstitution();
    511515
     
    18681872        virtual void visit( ImplicitCtorDtorStmt * old ) override final {
    18691873                if ( inCache( old ) ) return;
    1870                 this->node = new ast::ImplicitCtorDtorStmt(
    1871                         old->location,
    1872                         GET_ACCEPT_1(callStmt, Stmt),
     1874                auto stmt = new ast::ImplicitCtorDtorStmt(
     1875                        old->location,
     1876                        nullptr,
    18731877                        GET_LABELS_V(old->labels)
    18741878                );
     1879                this->node = stmt;
    18751880                cache.emplace( old, this->node );
     1881                stmt->callStmt = GET_ACCEPT_1(callStmt, Stmt);
    18761882        }
    18771883
Note: See TracChangeset for help on using the changeset viewer.