Changeset 4f68f6d
- Timestamp:
- May 17, 2018, 4:22:05 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
- Children:
- d20a343
- Parents:
- d01811a
- Location:
- src/Tuples
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Tuples/TupleAssignment.cc
rd01811a r4f68f6d 154 154 lhsAlt.expr = new CastExpr( lhsAlt.expr, 155 155 new ReferenceType( Type::Qualifiers(), 156 lhsAlt.expr-> get_result()->clone() ) );156 lhsAlt.expr->result->clone() ) ); 157 157 } 158 158 … … 298 298 ObjectDecl * TupleAssignSpotter::Matcher::newObject( UniqueName & namer, Expression * expr ) { 299 299 assert( expr->result && ! expr->get_result()->isVoid() ); 300 ObjectDecl * ret = new ObjectDecl( namer.newName(), Type::StorageClasses(), LinkageSpec::Cforall, nullptr, expr-> get_result()->clone(), new SingleInit( expr->clone() ) );300 ObjectDecl * ret = new ObjectDecl( namer.newName(), Type::StorageClasses(), LinkageSpec::Cforall, nullptr, expr->result->clone(), new SingleInit( expr->clone() ) ); 301 301 // if expression type is a reference, don't need to construct anything, a simple initializer is sufficient. 302 if ( ! dynamic_cast< ReferenceType * >( expr-> get_result()) ) {302 if ( ! dynamic_cast< ReferenceType * >( expr->result ) ) { 303 303 ConstructorInit * ctorInit = InitTweak::genCtorInit( ret ); 304 304 ret->init = ctorInit; -
src/Tuples/TupleExpansion.cc
rd01811a r4f68f6d 227 227 228 228 Expression * TupleIndexExpander::postmutate( TupleIndexExpr * tupleExpr ) { 229 Expression * tuple = tupleExpr-> get_tuple();229 Expression * tuple = tupleExpr->tuple; 230 230 assert( tuple ); 231 tupleExpr-> set_tuple( nullptr );232 unsigned int idx = tupleExpr-> get_index();233 TypeSubstitution * env = tupleExpr-> get_env();234 tupleExpr-> set_env( nullptr );231 tupleExpr->tuple = nullptr; 232 unsigned int idx = tupleExpr->index; 233 TypeSubstitution * env = tupleExpr->env; 234 tupleExpr->env = nullptr; 235 235 delete tupleExpr; 236 236 237 StructInstType * type = strict_dynamic_cast< StructInstType * >( tuple-> get_result());238 StructDecl * structDecl = type-> get_baseStruct();239 assert( structDecl-> get_members().size() > idx );240 Declaration * member = *std::next(structDecl-> get_members().begin(), idx);237 StructInstType * type = strict_dynamic_cast< StructInstType * >( tuple->result ); 238 StructDecl * structDecl = type->baseStruct; 239 assert( structDecl->members.size() > idx ); 240 Declaration * member = *std::next(structDecl->members.begin(), idx); 241 241 MemberExpr * memExpr = new MemberExpr( strict_dynamic_cast< DeclarationWithType * >( member ), tuple ); 242 memExpr-> set_env( env );242 memExpr->env = env; 243 243 return memExpr; 244 244 }
Note: See TracChangeset
for help on using the changeset viewer.