- Timestamp:
- Jan 18, 2023, 12:14:42 PM (15 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 378de69, a0d1f1c
- Parents:
- fed6a0f
- Location:
- src
- Files:
-
- 7 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/InstantiateGeneric.cc
rfed6a0f r5bf3976 28 28 #include "GenPoly.h" // for isPolyType, typesPolyCompatible 29 29 #include "InitTweak/InitTweak.h" 30 #include "ResolvExpr/ typeops.h"// for adjustExprType30 #include "ResolvExpr/AdjustExprType.hpp" // for adjustExprType 31 31 #include "ResolvExpr/Unify.h" // for typesCompatible 32 32 #include "ScopedSet.h" // for ScopedSet, ScopedSet<>::iterator -
src/GenPoly/InstantiateGenericNew.cpp
rfed6a0f r5bf3976 32 32 #include "GenPoly/GenPoly.h" // for isPolyType, typesPolyCompatible 33 33 #include "GenPoly/ScrubTyVars.h" // for scrubAll 34 #include "ResolvExpr/ typeops.h"// for adjustExprType34 #include "ResolvExpr/AdjustExprType.hpp" // for adjustExprType 35 35 #include "ResolvExpr/Unify.h" // for typesCompatible 36 36 -
src/ResolvExpr/AlternativeFinder.cc
rfed6a0f r5bf3976 28 28 29 29 #include "CompilationState.h" // for resolvep 30 #include "AdjustExprType.hpp" // for adjustExprType 30 31 #include "Alternative.h" // for AltList, Alternative 31 32 #include "AST/Expr.hpp" 32 33 #include "AST/SymbolTable.hpp" 33 34 #include "AST/Type.hpp" 35 #include "CastCost.hpp" // for castCost 34 36 #include "Common/SemanticError.h" // for SemanticError 35 37 #include "Common/utility.h" // for deleteAll, printAll, CodeLocation … … 38 40 #include "ExplodedActual.h" // for ExplodedActual 39 41 #include "InitTweak/InitTweak.h" // for getFunctionName 42 #include "PolyCost.hpp" // for polyCost 40 43 #include "RenameVars.h" // for RenameVars, global_renamer 41 44 #include "ResolveAssertions.h" // for resolveAssertions 42 45 #include "ResolveTypeof.h" // for resolveTypeof 43 46 #include "Resolver.h" // for resolveStmtExpr 47 #include "SpecCost.hpp" // for specCost 44 48 #include "SymTab/Indexer.h" // for Indexer 45 49 #include "SymTab/Mangler.h" // for Mangler … … 53 57 #include "Tuples/Explode.h" // for explode 54 58 #include "Tuples/Tuples.h" // for isTtype, handleTupleAssignment 59 #include "typeops.h" // for combos 55 60 #include "Unify.h" // for unify 56 #include "typeops.h" // for adjustExprType, polyCost, castCost57 61 58 62 #define PRINT( text ) if ( resolvep ) { text } -
src/ResolvExpr/CandidateFinder.cpp
rfed6a0f r5bf3976 23 23 #include <vector> 24 24 25 #include "AdjustExprType.hpp" 25 26 #include "Candidate.hpp" 27 #include "CastCost.hpp" // for castCost 26 28 #include "CompilationState.h" 27 29 #include "ConversionCost.h" // for conversionCast 28 30 #include "Cost.h" 29 31 #include "ExplodedArg.hpp" 32 #include "PolyCost.hpp" 30 33 #include "RenameVars.h" // for renameTyVars 31 34 #include "Resolver.h" 32 35 #include "ResolveTypeof.h" 33 36 #include "SatisfyAssertions.hpp" 34 #include "typeops.h" // for adjustExprType, polyCost, specCost 37 #include "SpecCost.hpp" 38 #include "typeops.h" // for combos 35 39 #include "Unify.h" 36 40 #include "AST/Expr.hpp" -
src/ResolvExpr/CastCost.cc
rfed6a0f r5bf3976 13 13 // Update Count : 9 14 14 // 15 16 #include "CastCost.hpp" 15 17 16 18 #include <cassert> // for assert … … 22 24 #include "ConversionCost.h" // for ConversionCost 23 25 #include "Cost.h" // for Cost, Cost::infinity 26 #include "ResolvExpr/ConversionCost.h" // for conversionCost 27 #include "ResolvExpr/PtrsCastable.hpp" // for ptrsCastable 24 28 #include "ResolvExpr/TypeEnvironment.h" // for TypeEnvironment, EqvClass 25 29 #include "ResolvExpr/typeops.h" // for ptrsCastable -
src/ResolvExpr/CommonType.cc
rfed6a0f r5bf3976 13 13 // Update Count : 24 14 14 // 15 16 #include "CommonType.hpp" 15 17 16 18 #include <cassert> // for strict_dynamic_cast -
src/ResolvExpr/ConversionCost.cc
rfed6a0f r5bf3976 22 22 #include "ResolvExpr/Cost.h" // for Cost 23 23 #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 25 26 #include "SymTab/Indexer.h" // for Indexer 26 27 #include "SynTree/Declaration.h" // for TypeDecl, NamedTypeDecl 27 28 #include "SynTree/Type.h" // for Type, BasicType, TypeInstType 28 #include "typeops.h" // for typesCompatibleIgnoreQualifiers29 29 30 30 -
src/ResolvExpr/PtrsAssignable.cc
rfed6a0f r5bf3976 14 14 // 15 15 16 #include " typeops.h"16 #include "PtrsAssignable.hpp" 17 17 18 18 #include "AST/Pass.hpp" -
src/ResolvExpr/PtrsCastable.cc
rfed6a0f r5bf3976 14 14 // 15 15 16 #include "PtrsCastable.hpp" 17 16 18 #include "AST/Decl.hpp" 17 19 #include "AST/Pass.hpp" … … 19 21 #include "AST/TypeEnvironment.hpp" 20 22 #include "Common/PassVisitor.h" 23 #include "ResolvExpr/PtrsAssignable.hpp" // for ptrsAssignable 21 24 #include "ResolvExpr/TypeEnvironment.h" // for EqvClass, TypeEnvironment 22 25 #include "SymTab/Indexer.h" // for Indexer … … 24 27 #include "SynTree/Type.h" // for TypeInstType, Type, BasicType 25 28 #include "SynTree/Visitor.h" // for Visitor 26 #include "typeops.h" // for ptrsAssignable27 29 28 30 namespace ResolvExpr { … … 291 293 return objectCast( src, env, symtab ); 292 294 } 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 ); 296 296 } 297 297 } -
src/ResolvExpr/ResolveAssertions.cc
rfed6a0f r5bf3976 26 26 #include <vector> // for vector 27 27 28 #include "AdjustExprType.hpp" // for adjustExprType 28 29 #include "Alternative.h" // for Alternative, AssertionItem, AssertionList 29 30 #include "Common/FilterCombos.h" // for filterCombos … … 33 34 #include "ResolvExpr/AlternativeFinder.h" // for computeConversionCost 34 35 #include "ResolvExpr/RenameVars.h" // for renameTyVars 36 #include "SpecCost.hpp" // for specCost 35 37 #include "SymTab/Indexer.h" // for Indexer 36 38 #include "SymTab/Mangler.h" // for Mangler 37 39 #include "SynTree/Expression.h" // for InferredParams 38 40 #include "TypeEnvironment.h" // for TypeEnvironment, etc. 39 #include "typeops.h" // for adjustExprType, specCost40 41 #include "Unify.h" // for unify 41 42 -
src/ResolvExpr/SatisfyAssertions.cpp
rfed6a0f r5bf3976 23 23 #include <vector> 24 24 25 #include "AdjustExprType.hpp" 25 26 #include "Candidate.hpp" 26 27 #include "CandidateFinder.hpp" 28 #include "CommonType.hpp" 27 29 #include "Cost.h" 28 30 #include "RenameVars.h" 31 #include "SpecCost.hpp" 29 32 #include "typeops.h" 30 33 #include "Unify.h" -
src/ResolvExpr/Unify.cc
rfed6a0f r5bf3976 33 33 #include "AST/TypeEnvironment.hpp" 34 34 #include "Common/PassVisitor.h" // for PassVisitor 35 #include "CommonType.hpp" // for commonType 35 36 #include "FindOpenVars.h" // for findOpenVars 37 #include "SpecCost.hpp" // for SpecCost 36 38 #include "SynTree/LinkageSpec.h" // for C 37 39 #include "SynTree/Constant.h" // for Constant … … 43 45 #include "Tuples/Tuples.h" // for isTtype 44 46 #include "TypeEnvironment.h" // for EqvClass, AssertionSet, OpenVarSet 45 #include "typeops.h" // for flatten, occurs , commonType47 #include "typeops.h" // for flatten, occurs 46 48 47 49 namespace ast { -
src/ResolvExpr/WidenMode.h
rfed6a0f r5bf3976 19 19 struct WidenMode { 20 20 WidenMode( bool first, bool second ): first( first ), second( second ) {} 21 21 22 22 WidenMode &operator|=( const WidenMode &other ) { 23 23 first |= other.first; second |= other.second; return *this; … … 35 35 WidenMode newWM( *this ); newWM &= other; return newWM; 36 36 } 37 37 38 38 operator bool() { return first && second; } 39 39 -
src/ResolvExpr/module.mk
rfed6a0f r5bf3976 17 17 SRC_RESOLVEXPR = \ 18 18 ResolvExpr/AdjustExprType.cc \ 19 ResolvExpr/AdjustExprType.hpp \ 19 20 ResolvExpr/Alternative.cc \ 20 21 ResolvExpr/AlternativeFinder.cc \ … … 26 27 ResolvExpr/Candidate.hpp \ 27 28 ResolvExpr/CastCost.cc \ 29 ResolvExpr/CastCost.hpp \ 28 30 ResolvExpr/CommonType.cc \ 31 ResolvExpr/CommonType.hpp \ 29 32 ResolvExpr/ConversionCost.cc \ 30 33 ResolvExpr/ConversionCost.h \ … … 40 43 ResolvExpr/Occurs.cc \ 41 44 ResolvExpr/PolyCost.cc \ 45 ResolvExpr/PolyCost.hpp \ 42 46 ResolvExpr/PtrsAssignable.cc \ 47 ResolvExpr/PtrsAssignable.hpp \ 43 48 ResolvExpr/PtrsCastable.cc \ 49 ResolvExpr/PtrsCastable.hpp \ 44 50 ResolvExpr/RenameVars.cc \ 45 51 ResolvExpr/RenameVars.h \ … … 54 60 ResolvExpr/SatisfyAssertions.hpp \ 55 61 ResolvExpr/SpecCost.cc \ 62 ResolvExpr/SpecCost.hpp \ 56 63 ResolvExpr/TypeEnvironment.cc \ 57 64 ResolvExpr/TypeEnvironment.h \ -
src/ResolvExpr/typeops.h
rfed6a0f r5bf3976 10 10 // Created On : Sun May 17 07:28:22 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Tue Oct 1 09:45:00 201913 // Update Count : 612 // Last Modified On : Wed Jan 18 11:54:00 2023 13 // Update Count : 7 14 14 // 15 15 … … 60 60 } 61 61 } 62 63 // in AdjustExprType.cc64 /// Replaces array types with the equivalent pointer, and function types with a pointer-to-function65 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 Indexer68 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 } // while75 }76 77 /// Replaces array types with equivalent pointer, and function types with a pointer-to-function78 const ast::Type * adjustExprType(79 const ast::Type * type, const ast::TypeEnvironment & env, const ast::SymbolTable & symtab );80 81 // in CastCost.cc82 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.cc89 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.cc94 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.cc100 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 & symtab105 );106 107 // in PolyCost.cc108 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.cc113 int specCost( Type * type );114 int specCost( const ast::Type * type );115 62 116 63 // in Occurs.cc … … 171 118 } 172 119 173 174 120 return new ast::TupleType{ std::move(types) }; 175 121 }
Note: See TracChangeset
for help on using the changeset viewer.