Changeset 54e41b3 for src/ResolvExpr


Ignore:
Timestamp:
May 16, 2019, 1:46:28 PM (6 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:
24afc53
Parents:
89c2f7c9
Message:

Add first half of ast::Expr subclasses

Location:
src/ResolvExpr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Unify.cc

    r89c2f7c9 r54e41b3  
    2121#include <string>                 // for string, operator==, operator!=, bas...
    2222#include <utility>                // for pair, move
    23 
     23#include <vector>
     24
     25#include "AST/Node.hpp"
     26#include "AST/Type.hpp"
    2427#include "Common/PassVisitor.h"   // for PassVisitor
    2528#include "FindOpenVars.h"         // for findOpenVars
     
    630633        }
    631634
    632         // xxx - compute once and store in the FunctionType?
    633635        Type * extractResultType( FunctionType * function ) {
    634636                if ( function->get_returnVals().size() == 0 ) {
     
    644646                }
    645647        }
     648
     649        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) };
     659        }
    646660} // namespace ResolvExpr
    647661
  • src/ResolvExpr/typeops.h

    r89c2f7c9 r54e41b3  
    1818#include <vector>
    1919
     20#include "AST/Node.hpp"
     21#include "AST/Type.hpp"
    2022#include "SynTree/SynTree.h"
    2123#include "SynTree/Type.h"
     
    99101        /// creates the type represented by the list of returnVals in a FunctionType. The caller owns the return value.
    100102        Type * extractResultType( FunctionType * functionType );
     103        /// Creates or extracts the type represented by the list of returns in a `FunctionType`.
     104        ast::ptr<ast::Type> extractResultType( const ast::FunctionType * func );
    101105
    102106        // in CommonType.cc
Note: See TracChangeset for help on using the changeset viewer.