Changeset 68c9165 for src/ResolvExpr


Ignore:
Timestamp:
May 23, 2019, 11:35:04 AM (7 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
20a5977, effe5b0
Parents:
b0ec971 (diff), 3ca912a (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.
git-author:
Aaron Moss <a3moss@…> (05/23/19 11:34:34)
git-committer:
Aaron Moss <a3moss@…> (05/23/19 11:35:04)
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Unify.cc

    rb0ec971 r68c9165  
    179179                                result = false;
    180180                        } else {
    181                                 result = env.bindVarToVar( 
    182                                         var1, var2, TypeDecl::Data{ entry1->second, entry2->second }, needAssertions, 
     181                                result = env.bindVarToVar(
     182                                        var1, var2, TypeDecl::Data{ entry1->second, entry2->second }, needAssertions,
    183183                                        haveAssertions, openVars, widenMode, indexer );
    184184                        }
     
    648648
    649649        ast::ptr<ast::Type> extractResultType( const ast::FunctionType * func ) {
    650                 assert(!"restore after AST added to build");
    651                 // if ( func->returns.empty() ) return new ast::VoidType{};
    652                 // if ( func->returns.size() == 1 ) return func->returns[0]->get_type();
    653 
    654                 // std::vector<ast::ptr<ast::Type>> tys;
    655                 // for ( const ast::DeclWithType * decl : func->returns ) {
    656                 //      tys.emplace_back( decl->get_type() );
    657                 // }
    658                 // return new ast::TupleType{ std::move(tys) };
     650                if ( func->returns.empty() ) return new ast::VoidType{};
     651                if ( func->returns.size() == 1 ) return func->returns[0]->get_type();
     652
     653                std::vector<ast::ptr<ast::Type>> tys;
     654                for ( const ast::DeclWithType * decl : func->returns ) {
     655                        tys.emplace_back( decl->get_type() );
     656                }
     657                return new ast::TupleType{ std::move(tys) };
    659658        }
    660659} // namespace ResolvExpr
Note: See TracChangeset for help on using the changeset viewer.