Changeset b7fd9daf for src/AST


Ignore:
Timestamp:
Nov 10, 2021, 7:47:45 PM (4 years ago)
Author:
Fangren Yu <f37yu@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
3249dd8b
Parents:
1622af5 (diff), f95634e (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 'new-ast-unique-expr'

Location:
src/AST
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r1622af5 rb7fd9daf  
    10411041
    10421042        const ast::Expr * visit( const ast::StmtExpr * node ) override final {
    1043                 auto stmts = node->stmts;
    1044                 // disable sharing between multiple StmtExprs explicitly.
    1045                 // this should no longer be true.
    1046 
    10471043                auto rslt = new StmtExpr(
    1048                         get<CompoundStmt>().accept1(stmts)
     1044                        get<CompoundStmt>().accept1(node->stmts)
    10491045                );
    10501046
    10511047                rslt->returnDecls = get<ObjectDecl>().acceptL(node->returnDecls);
    10521048                rslt->dtors       = get<Expression>().acceptL(node->dtors);
    1053                 if (node->resultExpr) {
    1054                         // this MUST be found by children visit
    1055                         rslt->resultExpr  = strict_dynamic_cast<ExprStmt *>(readonlyCache.at(node->resultExpr));
    1056                 }
     1049
     1050                // is this even used after convert?
     1051                //if (tmp->resultExpr) {
     1052                //      // this MUST be found by children visit
     1053                //      rslt->resultExpr  = strict_dynamic_cast<ExprStmt *>(readonlyCache.at(tmp->resultExpr));
     1054                //}
    10571055
    10581056                auto expr = visitBaseExpr( node, rslt );
  • src/AST/Copy.hpp

    r1622af5 rb7fd9daf  
    8888        }
    8989
     90        void postvisit( const StmtExpr * node ) {
     91                readonlyInsert( &node->resultExpr );
     92        }
     93
    9094        void postvisit( const MemberExpr * node ) {
    9195                readonlyInsert( &node->member );
     
    122126node_t * deepCopy( const node_t * localRoot ) {
    123127        Pass< DeepCopyCore > dc;
    124         node_t const * newRoot = localRoot->accept( dc );
     128        node_t const * newRoot = strict_dynamic_cast<node_t const*>(localRoot->accept( dc ));
    125129        dc.core.readonlyUpdates();
    126130        return const_cast< node_t * >( newRoot );
  • src/AST/Expr.hpp

    r1622af5 rb7fd9daf  
    767767
    768768/// An expression which must only be evaluated once
    769 class UniqueExpr final : public Expr {
     769class
     770UniqueExpr final : public Expr {
    770771        static unsigned long long nextId;
    771772public:
Note: See TracChangeset for help on using the changeset viewer.