Changeset bb9924c
- Timestamp:
- Nov 10, 2021, 7:21:57 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- f95634e
- Parents:
- 01d433e
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
r01d433e rbb9924c 1041 1041 1042 1042 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 1047 1043 auto rslt = new StmtExpr( 1048 get<CompoundStmt>().accept1( stmts)1044 get<CompoundStmt>().accept1(node->stmts) 1049 1045 ); 1050 1046 1051 1047 rslt->returnDecls = get<ObjectDecl>().acceptL(node->returnDecls); 1052 1048 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 //} 1057 1055 1058 1056 auto expr = visitBaseExpr( node, rslt ); -
src/Tuples/TupleExpansionNew.cpp
r01d433e rbb9924c 22 22 struct UniqueExprExpander final : public ast::WithDeclsToAdd<> { 23 23 const ast::Expr * postvisit( const ast::UniqueExpr * unqExpr ); 24 std::map< int, const ast::Expr *> decls; // not vector, because order added may not be increasing order24 std::map< int, ast::ptr<ast::Expr> > decls; // not vector, because order added may not be increasing order 25 25 }; 26 26 } // namespace … … 39 39 if ( ! decls.count( id ) ) { 40 40 ast::ptr< ast::Expr > assignUnq; 41 ast::ptr< ast::VariableExpr >var = unqExpr->var;41 const ast::VariableExpr * var = unqExpr->var; 42 42 if ( unqExpr->object ) { 43 43 // an object was generated to represent this unique expression -- it should be added to the list of declarations now 44 44 declsToAddBefore.push_back( unqExpr->object.as< ast::Decl >() ); 45 45 // deep copy required due to unresolved issues with UniqueExpr 46 assignUnq = ast::UntypedExpr::createAssign( loc, var, ast::deepCopy( unqExpr->expr.get() ));46 assignUnq = ast::UntypedExpr::createAssign( loc, var, unqExpr->expr ); 47 47 } else { 48 ast::ptr< ast::Expr > expr = unqExpr->expr; 49 ast::ptr< ast::CommaExpr > commaExpr = expr.strict_as< ast::CommaExpr >(); 48 const auto commaExpr = unqExpr->expr.strict_as< ast::CommaExpr >(); 50 49 assignUnq = commaExpr->arg1; 51 50 } … … 64 63 } 65 64 //delete unqExpr; 66 return decls[id];65 return ast::deepCopy(decls[id].get()); 67 66 } 68 67 } // namespace
Note: See TracChangeset
for help on using the changeset viewer.