Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CastCost.cc

    r251ce80 r46da46b  
    1313// Update Count     : 9
    1414//
    15 
    16 #include "CastCost.hpp"
    1715
    1816#include <cassert>                       // for assert
     
    2422#include "ConversionCost.h"              // for ConversionCost
    2523#include "Cost.h"                        // for Cost, Cost::infinity
    26 #include "ResolvExpr/ConversionCost.h"   // for conversionCost
    27 #include "ResolvExpr/PtrsCastable.hpp"   // for ptrsCastable
    2824#include "ResolvExpr/TypeEnvironment.h"  // for TypeEnvironment, EqvClass
    29 #include "ResolvExpr/typeops.h"          // for ptrsCastable
    30 #include "ResolvExpr/Unify.h"            // for typesCompatibleIgnoreQualifiers
    3125#include "SymTab/Indexer.h"              // for Indexer
    3226#include "SynTree/Declaration.h"         // for TypeDecl, NamedTypeDecl
    3327#include "SynTree/Type.h"                // for PointerType, Type, TypeInstType
     28#include "typeops.h"                     // for typesCompatibleIgnoreQualifiers
    3429
    3530#if 0
     
    165160                                if (
    166161                                        pointerType->qualifiers <= ptr->qualifiers
    167                                         && typesCompatibleIgnoreQualifiers( pointerType->base, ptr->base, env )
     162                                        && typesCompatibleIgnoreQualifiers( pointerType->base, ptr->base, symtab, env )
    168163                                ) {
    169164                                        cost = Cost::safe;
     
    232227        )
    233228
    234         if ( typesCompatibleIgnoreQualifiers( src, dst, env ) ) {
     229        if ( typesCompatibleIgnoreQualifiers( src, dst, symtab, env ) ) {
    235230                PRINT( std::cerr << "compatible!" << std::endl; )
     231                if (dynamic_cast<const ast::ZeroType *>(dst) || dynamic_cast<const ast::OneType *>(dst)) {
     232                        return Cost::spec;
     233                }
    236234                return Cost::zero;
    237235        } else if ( dynamic_cast< const ast::VoidType * >( dst ) ) {
Note: See TracChangeset for help on using the changeset viewer.