Changeset 5bf3976 for src


Ignore:
Timestamp:
Jan 18, 2023, 12:14:42 PM (15 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master
Children:
378de69, a0d1f1c
Parents:
fed6a0f
Message:

Header Clean-Up: Created new headers for new AST typeops and moved declarations.

Location:
src
Files:
7 added
15 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/InstantiateGeneric.cc

    rfed6a0f r5bf3976  
    2828#include "GenPoly.h"                   // for isPolyType, typesPolyCompatible
    2929#include "InitTweak/InitTweak.h"
    30 #include "ResolvExpr/typeops.h"        // for adjustExprType
     30#include "ResolvExpr/AdjustExprType.hpp"  // for adjustExprType
    3131#include "ResolvExpr/Unify.h"          // for typesCompatible
    3232#include "ScopedSet.h"                 // for ScopedSet, ScopedSet<>::iterator
  • src/GenPoly/InstantiateGenericNew.cpp

    rfed6a0f r5bf3976  
    3232#include "GenPoly/GenPoly.h"           // for isPolyType, typesPolyCompatible
    3333#include "GenPoly/ScrubTyVars.h"       // for scrubAll
    34 #include "ResolvExpr/typeops.h"        // for adjustExprType
     34#include "ResolvExpr/AdjustExprType.hpp"  // for adjustExprType
    3535#include "ResolvExpr/Unify.h"          // for typesCompatible
    3636
  • src/ResolvExpr/AlternativeFinder.cc

    rfed6a0f r5bf3976  
    2828
    2929#include "CompilationState.h"      // for resolvep
     30#include "AdjustExprType.hpp"      // for adjustExprType
    3031#include "Alternative.h"           // for AltList, Alternative
    3132#include "AST/Expr.hpp"
    3233#include "AST/SymbolTable.hpp"
    3334#include "AST/Type.hpp"
     35#include "CastCost.hpp"            // for castCost
    3436#include "Common/SemanticError.h"  // for SemanticError
    3537#include "Common/utility.h"        // for deleteAll, printAll, CodeLocation
     
    3840#include "ExplodedActual.h"        // for ExplodedActual
    3941#include "InitTweak/InitTweak.h"   // for getFunctionName
     42#include "PolyCost.hpp"            // for polyCost
    4043#include "RenameVars.h"            // for RenameVars, global_renamer
    4144#include "ResolveAssertions.h"     // for resolveAssertions
    4245#include "ResolveTypeof.h"         // for resolveTypeof
    4346#include "Resolver.h"              // for resolveStmtExpr
     47#include "SpecCost.hpp"            // for specCost
    4448#include "SymTab/Indexer.h"        // for Indexer
    4549#include "SymTab/Mangler.h"        // for Mangler
     
    5357#include "Tuples/Explode.h"        // for explode
    5458#include "Tuples/Tuples.h"         // for isTtype, handleTupleAssignment
     59#include "typeops.h"               // for combos
    5560#include "Unify.h"                 // for unify
    56 #include "typeops.h"               // for adjustExprType, polyCost, castCost
    5761
    5862#define PRINT( text ) if ( resolvep ) { text }
  • src/ResolvExpr/CandidateFinder.cpp

    rfed6a0f r5bf3976  
    2323#include <vector>
    2424
     25#include "AdjustExprType.hpp"
    2526#include "Candidate.hpp"
     27#include "CastCost.hpp"           // for castCost
    2628#include "CompilationState.h"
    2729#include "ConversionCost.h"       // for conversionCast
    2830#include "Cost.h"
    2931#include "ExplodedArg.hpp"
     32#include "PolyCost.hpp"
    3033#include "RenameVars.h"           // for renameTyVars
    3134#include "Resolver.h"
    3235#include "ResolveTypeof.h"
    3336#include "SatisfyAssertions.hpp"
    34 #include "typeops.h"              // for adjustExprType, polyCost, specCost
     37#include "SpecCost.hpp"
     38#include "typeops.h"              // for combos
    3539#include "Unify.h"
    3640#include "AST/Expr.hpp"
  • src/ResolvExpr/CastCost.cc

    rfed6a0f r5bf3976  
    1313// Update Count     : 9
    1414//
     15
     16#include "CastCost.hpp"
    1517
    1618#include <cassert>                       // for assert
     
    2224#include "ConversionCost.h"              // for ConversionCost
    2325#include "Cost.h"                        // for Cost, Cost::infinity
     26#include "ResolvExpr/ConversionCost.h"   // for conversionCost
     27#include "ResolvExpr/PtrsCastable.hpp"   // for ptrsCastable
    2428#include "ResolvExpr/TypeEnvironment.h"  // for TypeEnvironment, EqvClass
    2529#include "ResolvExpr/typeops.h"          // for ptrsCastable
  • src/ResolvExpr/CommonType.cc

    rfed6a0f r5bf3976  
    1313// Update Count     : 24
    1414//
     15
     16#include "CommonType.hpp"
    1517
    1618#include <cassert>                       // for strict_dynamic_cast
  • src/ResolvExpr/ConversionCost.cc

    rfed6a0f r5bf3976  
    2222#include "ResolvExpr/Cost.h"             // for Cost
    2323#include "ResolvExpr/TypeEnvironment.h"  // for EqvClass, TypeEnvironment
    24 #include "ResolvExpr/Unify.h"
     24#include "ResolvExpr/Unify.h"            // for typesCompatibleIgnoreQualifiers
     25#include "ResolvExpr/PtrsAssignable.hpp" // for ptrsAssignable
    2526#include "SymTab/Indexer.h"              // for Indexer
    2627#include "SynTree/Declaration.h"         // for TypeDecl, NamedTypeDecl
    2728#include "SynTree/Type.h"                // for Type, BasicType, TypeInstType
    28 #include "typeops.h"                     // for typesCompatibleIgnoreQualifiers
    2929
    3030
  • src/ResolvExpr/PtrsAssignable.cc

    rfed6a0f r5bf3976  
    1414//
    1515
    16 #include "typeops.h"
     16#include "PtrsAssignable.hpp"
    1717
    1818#include "AST/Pass.hpp"
  • src/ResolvExpr/PtrsCastable.cc

    rfed6a0f r5bf3976  
    1414//
    1515
     16#include "PtrsCastable.hpp"
     17
    1618#include "AST/Decl.hpp"
    1719#include "AST/Pass.hpp"
     
    1921#include "AST/TypeEnvironment.hpp"
    2022#include "Common/PassVisitor.h"
     23#include "ResolvExpr/PtrsAssignable.hpp" // for ptrsAssignable
    2124#include "ResolvExpr/TypeEnvironment.h"  // for EqvClass, TypeEnvironment
    2225#include "SymTab/Indexer.h"              // for Indexer
     
    2427#include "SynTree/Type.h"                // for TypeInstType, Type, BasicType
    2528#include "SynTree/Visitor.h"             // for Visitor
    26 #include "typeops.h"                     // for ptrsAssignable
    2729
    2830namespace ResolvExpr {
     
    291293                return objectCast( src, env, symtab );
    292294        } else {
    293                 ast::Pass< PtrsCastable_new > ptrs{ dst, env, symtab };
    294                 src->accept( ptrs );
    295                 return ptrs.core.result;
     295                return ast::Pass<PtrsCastable_new>::read( src, dst, env, symtab );
    296296        }
    297297}
  • src/ResolvExpr/ResolveAssertions.cc

    rfed6a0f r5bf3976  
    2626#include <vector>                   // for vector
    2727
     28#include "AdjustExprType.hpp"       // for adjustExprType
    2829#include "Alternative.h"            // for Alternative, AssertionItem, AssertionList
    2930#include "Common/FilterCombos.h"    // for filterCombos
     
    3334#include "ResolvExpr/AlternativeFinder.h"  // for computeConversionCost
    3435#include "ResolvExpr/RenameVars.h"  // for renameTyVars
     36#include "SpecCost.hpp"             // for specCost
    3537#include "SymTab/Indexer.h"         // for Indexer
    3638#include "SymTab/Mangler.h"         // for Mangler
    3739#include "SynTree/Expression.h"     // for InferredParams
    3840#include "TypeEnvironment.h"        // for TypeEnvironment, etc.
    39 #include "typeops.h"                // for adjustExprType, specCost
    4041#include "Unify.h"                  // for unify
    4142
  • src/ResolvExpr/SatisfyAssertions.cpp

    rfed6a0f r5bf3976  
    2323#include <vector>
    2424
     25#include "AdjustExprType.hpp"
    2526#include "Candidate.hpp"
    2627#include "CandidateFinder.hpp"
     28#include "CommonType.hpp"
    2729#include "Cost.h"
    2830#include "RenameVars.h"
     31#include "SpecCost.hpp"
    2932#include "typeops.h"
    3033#include "Unify.h"
  • src/ResolvExpr/Unify.cc

    rfed6a0f r5bf3976  
    3333#include "AST/TypeEnvironment.hpp"
    3434#include "Common/PassVisitor.h"     // for PassVisitor
     35#include "CommonType.hpp"           // for commonType
    3536#include "FindOpenVars.h"           // for findOpenVars
     37#include "SpecCost.hpp"             // for SpecCost
    3638#include "SynTree/LinkageSpec.h"    // for C
    3739#include "SynTree/Constant.h"       // for Constant
     
    4345#include "Tuples/Tuples.h"          // for isTtype
    4446#include "TypeEnvironment.h"        // for EqvClass, AssertionSet, OpenVarSet
    45 #include "typeops.h"                // for flatten, occurs, commonType
     47#include "typeops.h"                // for flatten, occurs
    4648
    4749namespace ast {
  • src/ResolvExpr/WidenMode.h

    rfed6a0f r5bf3976  
    1919        struct WidenMode {
    2020                WidenMode( bool first, bool second ): first( first ), second( second ) {}
    21                
     21
    2222                WidenMode &operator|=( const WidenMode &other ) {
    2323                        first |= other.first; second |= other.second; return *this;
     
    3535                        WidenMode newWM( *this ); newWM &= other; return newWM;
    3636                }
    37                
     37
    3838                operator bool() { return first && second; }
    3939
  • src/ResolvExpr/module.mk

    rfed6a0f r5bf3976  
    1717SRC_RESOLVEXPR = \
    1818      ResolvExpr/AdjustExprType.cc \
     19      ResolvExpr/AdjustExprType.hpp \
    1920      ResolvExpr/Alternative.cc \
    2021      ResolvExpr/AlternativeFinder.cc \
     
    2627      ResolvExpr/Candidate.hpp \
    2728      ResolvExpr/CastCost.cc \
     29      ResolvExpr/CastCost.hpp \
    2830      ResolvExpr/CommonType.cc \
     31      ResolvExpr/CommonType.hpp \
    2932      ResolvExpr/ConversionCost.cc \
    3033      ResolvExpr/ConversionCost.h \
     
    4043      ResolvExpr/Occurs.cc \
    4144      ResolvExpr/PolyCost.cc \
     45      ResolvExpr/PolyCost.hpp \
    4246      ResolvExpr/PtrsAssignable.cc \
     47      ResolvExpr/PtrsAssignable.hpp \
    4348      ResolvExpr/PtrsCastable.cc \
     49      ResolvExpr/PtrsCastable.hpp \
    4450      ResolvExpr/RenameVars.cc \
    4551      ResolvExpr/RenameVars.h \
     
    5460      ResolvExpr/SatisfyAssertions.hpp \
    5561      ResolvExpr/SpecCost.cc \
     62      ResolvExpr/SpecCost.hpp \
    5663      ResolvExpr/TypeEnvironment.cc \
    5764      ResolvExpr/TypeEnvironment.h \
  • src/ResolvExpr/typeops.h

    rfed6a0f r5bf3976  
    1010// Created On       : Sun May 17 07:28:22 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Tue Oct  1 09:45:00 2019
    13 // Update Count     : 6
     12// Last Modified On : Wed Jan 18 11:54:00 2023
     13// Update Count     : 7
    1414//
    1515
     
    6060                }
    6161        }
    62 
    63         // in AdjustExprType.cc
    64         /// Replaces array types with the equivalent pointer, and function types with a pointer-to-function
    65         void adjustExprType( Type *& type, const TypeEnvironment & env, const SymTab::Indexer & indexer );
    66 
    67         /// Replaces array types with the equivalent pointer, and function types with a pointer-to-function using empty TypeEnvironment and Indexer
    68         void adjustExprType( Type *& type );
    69 
    70         template< typename ForwardIterator >
    71         void adjustExprTypeList( ForwardIterator begin, ForwardIterator end, const TypeEnvironment & env, const SymTab::Indexer & indexer ) {
    72                 while ( begin != end ) {
    73                         adjustExprType( *begin++, env, indexer );
    74                 } // while
    75         }
    76 
    77         /// Replaces array types with equivalent pointer, and function types with a pointer-to-function
    78         const ast::Type * adjustExprType(
    79                 const ast::Type * type, const ast::TypeEnvironment & env, const ast::SymbolTable & symtab );
    80 
    81         // in CastCost.cc
    82         Cost castCost( const Type * src, const Type * dest, bool srcIsLvalue,
    83                 const SymTab::Indexer & indexer, const TypeEnvironment & env );
    84         Cost castCost(
    85                 const ast::Type * src, const ast::Type * dst, bool srcIsLvalue,
    86                 const ast::SymbolTable & symtab, const ast::TypeEnvironment & env );
    87 
    88         // in PtrsAssignable.cc
    89         int ptrsAssignable( const Type * src, const Type * dest, const TypeEnvironment & env );
    90         int ptrsAssignable( const ast::Type * src, const ast::Type * dst,
    91                 const ast::TypeEnvironment & env );
    92 
    93         // in PtrsCastable.cc
    94         int ptrsCastable( const Type * src, const Type * dest, const TypeEnvironment & env, const SymTab::Indexer & indexer );
    95         int ptrsCastable(
    96                 const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab,
    97                 const ast::TypeEnvironment & env );
    98 
    99         // in CommonType.cc
    100         Type * commonType( Type * type1, Type * type2, bool widenFirst, bool widenSecond, const SymTab::Indexer & indexer, TypeEnvironment & env, const OpenVarSet & openVars );
    101         ast::ptr< ast::Type > commonType(
    102                 const ast::ptr< ast::Type > & type1, const ast::ptr< ast::Type > & type2,
    103                         ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have,
    104                         const ast::OpenVarSet & open, WidenMode widen, const ast::SymbolTable & symtab
    105         );
    106 
    107         // in PolyCost.cc
    108         int polyCost( Type * type, const TypeEnvironment & env, const SymTab::Indexer & indexer );
    109         int polyCost(
    110                 const ast::Type * type, const ast::SymbolTable & symtab, const ast::TypeEnvironment & env );
    111 
    112         // in SpecCost.cc
    113         int specCost( Type * type );
    114         int specCost( const ast::Type * type );
    11562
    11663        // in Occurs.cc
     
    171118                }
    172119
    173 
    174120                return new ast::TupleType{ std::move(types) };
    175121        }
Note: See TracChangeset for help on using the changeset viewer.