Changeset aa8f9df for src/Tuples


Ignore:
Timestamp:
Sep 15, 2016, 3:22:50 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
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.
Message:

Merge branch 'replace-results-list' into tuples

Conflicts:

src/ResolvExpr/AlternativeFinder.cc
src/SymTab/Indexer.cc
src/SynTree/Mutator.cc
src/SynTree/Visitor.cc
src/Tuples/TupleAssignment.cc
src/Tuples/TupleAssignment.h

Location:
src/Tuples
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Tuples/TupleAssignment.cc

    rfd782b2 raa8f9df  
    8888        bool isTuple( Expression *expr ) {
    8989                if ( ! expr ) return false;
    90 
     90                assert( expr->has_result() );
    9191                // 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_results().size() > 1;
     92                return dynamic_cast<TupleExpr *>(expr) || expr->get_result()->size() > 1;
    9393        }
    9494
     
    102102
    103103        bool isTupleExpr( Expression *expr ) {
    104                 return expr->get_results().size() > 1;
     104                assert( expr->has_result() );
     105                return expr->get_result()->size() > 1;
    105106        }
    106107
     
    191192
    192193        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() ) );
    203196        }
    204197
  • src/Tuples/TupleExpansion.cc

    rfd782b2 raa8f9df  
    8585                        addDeclaration( decl );
    8686                }
     87                Type::Qualifiers qualifiers = newType->get_qualifiers();
    8788                delete newType;
    88                 return new StructInstType( newType->get_qualifiers(), typeMap[mangleName] );
     89                return new StructInstType( qualifiers, typeMap[mangleName] );
    8990        }
    9091
Note: See TracChangeset for help on using the changeset viewer.