Changeset aa8f9df for src/Tuples
- Timestamp:
- Sep 15, 2016, 3:22:50 PM (8 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, resolv-new, with_gc
- Children:
- 4ab9536
- Parents:
- fd782b2 (diff), 906e24d (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. - Location:
- src/Tuples
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Tuples/TupleAssignment.cc
rfd782b2 raa8f9df 88 88 bool isTuple( Expression *expr ) { 89 89 if ( ! expr ) return false; 90 90 assert( expr->has_result() ); 91 91 // xxx - used to include cast to varExpr and call to isTupleVar, but this doesn't seem like it should be necessary 92 return dynamic_cast<TupleExpr *>(expr) || expr->get_result s().size() > 1;92 return dynamic_cast<TupleExpr *>(expr) || expr->get_result()->size() > 1; 93 93 } 94 94 … … 102 102 103 103 bool isTupleExpr( Expression *expr ) { 104 return expr->get_results().size() > 1; 104 assert( expr->has_result() ); 105 return expr->get_result()->size() > 1; 105 106 } 106 107 … … 191 192 192 193 ObjectDecl * newObject( UniqueName & namer, Expression * expr ) { 193 Type * type; 194 assert( expr->get_results().size() >= 1 ); 195 if ( expr->get_results().size() > 1 ) { 196 TupleType * tt = new TupleType( Type::Qualifiers() ); 197 cloneAll( expr->get_results(), tt->get_types() ); 198 type = tt; 199 } else { 200 type = expr->get_results().front()->clone(); 201 } 202 return new ObjectDecl( namer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, type, new SingleInit( expr->clone() ) ); 194 assert( expr->has_result() && ! expr->get_result()->isVoid() ); 195 return new ObjectDecl( namer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, expr->get_result()->clone(), new SingleInit( expr->clone() ) ); 203 196 } 204 197 -
src/Tuples/TupleExpansion.cc
rfd782b2 raa8f9df 85 85 addDeclaration( decl ); 86 86 } 87 Type::Qualifiers qualifiers = newType->get_qualifiers(); 87 88 delete newType; 88 return new StructInstType( newType->get_qualifiers(), typeMap[mangleName] );89 return new StructInstType( qualifiers, typeMap[mangleName] ); 89 90 } 90 91
Note: See TracChangeset
for help on using the changeset viewer.