Changeset 7b5694d


Ignore:
Timestamp:
Jan 17, 2023, 2:05:52 PM (17 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master
Children:
fed6a0f
Parents:
e563edf
Message:

Header Clean-up: Moved more things from typeops to Unify.

Location:
src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Expr.cpp

    re563edf r7b5694d  
    3030#include "Common/SemanticError.h"
    3131#include "GenPoly/Lvalue.h"        // for referencesPermissable
    32 #include "ResolvExpr/typeops.h"    // for extractResultType
     32#include "ResolvExpr/Unify.h"      // for extractResultType
    3333#include "Tuples/Tuples.h"         // for makeTupleType
    3434
  • src/GenPoly/GenPoly.cc

    re563edf r7b5694d  
    490490                }
    491491
     492                /// Flattens a list of types.
     493                // There is another flattenList in Unify.
    492494                void flattenList( vector<ast::ptr<ast::Type>> const & src,
    493495                                vector<ast::ptr<ast::Type>> & out ) {
  • src/ResolvExpr/Unify.h

    re563edf r7b5694d  
    8585        const ast::TypeEnvironment & env = {} );
    8686
     87/// Creates the type represented by the list of returnVals in a FunctionType.
     88/// The caller owns the return value.
     89Type * extractResultType( FunctionType * functionType );
     90/// Creates or extracts the type represented by returns in a `FunctionType`.
     91ast::ptr<ast::Type> extractResultType( const ast::FunctionType * func );
     92
     93std::vector<ast::ptr<ast::Type>> flattenList(
     94        const std::vector<ast::ptr<ast::Type>> & src, ast::TypeEnvironment & env
     95);
     96
    8797} // namespace ResolvExpr
    8898
  • src/ResolvExpr/typeops.h

    re563edf r7b5694d  
    108108                const ast::TypeEnvironment & env );
    109109
    110         /// creates the type represented by the list of returnVals in a FunctionType. The caller owns the return value.
    111         Type * extractResultType( FunctionType * functionType );
    112         /// Creates or extracts the type represented by the list of returns in a `FunctionType`.
    113         ast::ptr<ast::Type> extractResultType( const ast::FunctionType * func );
    114 
    115110        // in CommonType.cc
    116111        Type * commonType( Type * type1, Type * type2, bool widenFirst, bool widenSecond, const SymTab::Indexer & indexer, TypeEnvironment & env, const OpenVarSet & openVars );
     
    119114                        ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have,
    120115                        const ast::OpenVarSet & open, WidenMode widen, const ast::SymbolTable & symtab
    121         );
    122         // in Unify.cc
    123         std::vector< ast::ptr< ast::Type > > flattenList(
    124                 const std::vector< ast::ptr< ast::Type > > & src, ast::TypeEnvironment & env
    125116        );
    126117
     
    206197        }
    207198
    208        
    209 
    210199        // in TypeEnvironment.cc
    211200        bool isFtype( const Type * type );
  • src/SynTree/ApplicationExpr.cc

    re563edf r7b5694d  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // ApplicationExpr.cc.cc --
     7// ApplicationExpr.cc --
    88//
    99// Author           : Richard C. Bilson
     
    2626#include "Expression.h"          // for ParamEntry, ApplicationExpr, Expression
    2727#include "InitTweak/InitTweak.h" // for getFunction
    28 #include "ResolvExpr/typeops.h"  // for extractResultType
     28#include "ResolvExpr/Unify.h"    // for extractResultType
    2929#include "Type.h"                // for Type, PointerType, FunctionType
    3030
  • src/Validate/FixReturnTypes.cpp

    re563edf r7b5694d  
    2020#include "AST/Type.hpp"
    2121#include "CodeGen/CodeGenerator.h"
    22 #include "ResolvExpr/typeops.h"
     22#include "ResolvExpr/Unify.h"
    2323
    2424namespace ast {
Note: See TracChangeset for help on using the changeset viewer.