Changeset fed6a0f for src


Ignore:
Timestamp:
Jan 17, 2023, 4:27:18 PM (18 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master
Children:
5bf3976
Parents:
7b5694d
Message:

Header Clean-up: Moving more declarations to the header of the implementation file.

Location:
src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • src/AST/SymbolTable.cpp

    r7b5694d rfed6a0f  
    2222#include "Inspect.hpp"
    2323#include "Type.hpp"
    24 #include "CodeGen/OperatorTable.h"  // for isCtorDtorAssign
     24#include "CodeGen/OperatorTable.h"         // for isCtorDtorAssign
    2525#include "Common/SemanticError.h"
    2626#include "Common/Stats/Counter.h"
     
    2828#include "InitTweak/InitTweak.h"
    2929#include "ResolvExpr/Cost.h"
    30 #include "ResolvExpr/typeops.h"     // for referenceToRvalueConversion
     30#include "ResolvExpr/CandidateFinder.hpp"  // for referenceToRvalueConversion
    3131#include "ResolvExpr/Unify.h"
    3232#include "SymTab/Mangler.h"
  • src/ResolvExpr/AlternativeFinder.cc

    r7b5694d rfed6a0f  
    1414//
    1515
     16#include "AlternativeFinder.h"
     17
    1618#include <algorithm>               // for copy
    1719#include <cassert>                 // for strict_dynamic_cast, assert, assertf
     
    2729#include "CompilationState.h"      // for resolvep
    2830#include "Alternative.h"           // for AltList, Alternative
    29 #include "AlternativeFinder.h"
    3031#include "AST/Expr.hpp"
    3132#include "AST/SymbolTable.hpp"
     
    3334#include "Common/SemanticError.h"  // for SemanticError
    3435#include "Common/utility.h"        // for deleteAll, printAll, CodeLocation
     36#include "ConversionCost.h"        // for conversionCost
    3537#include "Cost.h"                  // for Cost, Cost::zero, operator<<, Cost...
    3638#include "ExplodedActual.h"        // for ExplodedActual
  • src/ResolvExpr/AlternativeFinder.h

    r7b5694d rfed6a0f  
    3434namespace ResolvExpr {
    3535        struct ArgPack;
     36
     37        Cost computeConversionCost( Type * actualType, Type * formalType, bool actualIsLvalue,
     38                const SymTab::Indexer & indexer, const TypeEnvironment & env );
     39
     40        void referenceToRvalueConversion( Expression *& expr, Cost & cost );
    3641
    3742        /// First index is which argument, second index is which alternative for that argument,
  • src/ResolvExpr/CandidateFinder.cpp

    r7b5694d rfed6a0f  
    2525#include "Candidate.hpp"
    2626#include "CompilationState.h"
     27#include "ConversionCost.h"       // for conversionCast
    2728#include "Cost.h"
    2829#include "ExplodedArg.hpp"
     
    3132#include "ResolveTypeof.h"
    3233#include "SatisfyAssertions.hpp"
    33 #include "typeops.h"              // for adjustExprType, conversionCost, polyCost, specCost
     34#include "typeops.h"              // for adjustExprType, polyCost, specCost
    3435#include "Unify.h"
    3536#include "AST/Expr.hpp"
  • src/ResolvExpr/CandidateFinder.hpp

    r7b5694d rfed6a0f  
    6363        const ast::SymbolTable & symtab, const ast::TypeEnvironment & env );
    6464
     65/// Create an expression that preforms reference to rvalue conversion on
     66/// the given expression and update the cost of the expression.
     67const ast::Expr * referenceToRvalueConversion(
     68        const ast::Expr * expr, Cost & cost );
     69
    6570} // namespace ResolvExpr
    6671
  • src/ResolvExpr/ConversionCost.h

    r7b5694d rfed6a0f  
    3232namespace ResolvExpr {
    3333        class TypeEnvironment;
     34
     35        Cost conversionCost(
     36                const Type * src, const Type * dest, bool srcIsLvalue,
     37                const SymTab::Indexer & indexer, const TypeEnvironment & env );
    3438
    3539        typedef std::function<Cost(const Type *, const Type *, bool,
     
    8084        const ast::SymbolTable &, const ast::TypeEnvironment &)>;
    8185
     86Cost conversionCost(
     87        const ast::Type * src, const ast::Type * dst, bool srcIsLvalue,
     88        const ast::SymbolTable & symtab, const ast::TypeEnvironment & env );
     89
     90Cost convertToReferenceCost( const ast::Type * src, const ast::ReferenceType * dest,
     91        bool srcIsLvalue, const ast::SymbolTable & indexer, const ast::TypeEnvironment & env,
     92        PtrsCalculation func );
     93
    8294#warning when the old ConversionCost is removed, get ride of the _new suffix.
    8395class ConversionCost_new : public ast::WithShortCircuiting {
     
    119131};
    120132
    121 Cost convertToReferenceCost( const ast::Type * src, const ast::ReferenceType * dest,
    122         bool srcIsLvalue, const ast::SymbolTable & indexer, const ast::TypeEnvironment & env,
    123         PtrsCalculation func );
    124 
    125133} // namespace ResolvExpr
    126134
  • src/ResolvExpr/ResolveAssertions.cc

    r7b5694d rfed6a0f  
    3131#include "Common/utility.h"         // for sort_mins
    3232#include "GenPoly/GenPoly.h"        // for getFunctionType
     33#include "ResolvExpr/AlternativeFinder.h"  // for computeConversionCost
    3334#include "ResolvExpr/RenameVars.h"  // for renameTyVars
    3435#include "SymTab/Indexer.h"         // for Indexer
  • src/ResolvExpr/typeops.h

    r7b5694d rfed6a0f  
    8686                const ast::SymbolTable & symtab, const ast::TypeEnvironment & env );
    8787
    88         // in ConversionCost.cc
    89         Cost conversionCost( const Type * src, const Type * dest, bool srcIsLvalue,
    90                 const SymTab::Indexer & indexer, const TypeEnvironment & env );
    91         Cost conversionCost(
    92                 const ast::Type * src, const ast::Type * dst, bool srcIsLvalue,
    93                 const ast::SymbolTable & symtab, const ast::TypeEnvironment & env );
    94 
    95         // in AlternativeFinder.cc
    96         Cost computeConversionCost( Type * actualType, Type * formalType, bool actualIsLvalue,
    97                 const SymTab::Indexer & indexer, const TypeEnvironment & env );
    98 
    9988        // in PtrsAssignable.cc
    10089        int ptrsAssignable( const Type * src, const Type * dest, const TypeEnvironment & env );
     
    137126                return false;
    138127        }
    139 
    140         // in AlternativeFinder.cc
    141         void referenceToRvalueConversion( Expression *& expr, Cost & cost );
    142         // in CandidateFinder.cpp
    143         const ast::Expr * referenceToRvalueConversion( const ast::Expr * expr, Cost & cost );
    144128
    145129        /// flatten tuple type into list of types
  • src/SymTab/Indexer.cc

    r7b5694d rfed6a0f  
    3131#include "InitTweak/InitTweak.h"   // for isConstructor, isCopyFunction, isC...
    3232#include "Mangler.h"               // for Mangler
    33 #include "ResolvExpr/typeops.h"    // for referenceToRvalueConversion
     33#include "ResolvExpr/AlternativeFinder.h"  // for referenceToRvalueConversion
    3434#include "ResolvExpr/Unify.h"      // for typesCompatible
    3535#include "SynTree/LinkageSpec.h"   // for isMangled, isOverridable, Spec
Note: See TracChangeset for help on using the changeset viewer.