Changeset 8ff586c


Ignore:
Timestamp:
Jun 19, 2020, 3:35:58 PM (4 years ago)
Author:
Fangren Yu <f37yu@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
81da70a5
Parents:
1cf2a9b
Message:

eliminate sharing in StmtExpr? for backward convert

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r1cf2a9b r8ff586c  
    2020
    2121#include "AST/Attribute.hpp"
     22#include "AST/Copy.hpp"
    2223#include "AST/Decl.hpp"
    2324#include "AST/Expr.hpp"
     
    990991
    991992        const ast::Expr * visit( const ast::StmtExpr * node ) override final {
     993                auto stmts = node->stmts;
     994                // disable sharing between multiple StmtExprs explicitly.
     995                if (inCache(stmts)) {
     996                        stmts = ast::deepCopy(stmts.get());
     997                }
    992998                auto rslt = new StmtExpr(
    993                         get<CompoundStmt>().accept1(node->stmts)
     999                        get<CompoundStmt>().accept1(stmts)
    9941000                );
    9951001
Note: See TracChangeset for help on using the changeset viewer.