Ignore:
Timestamp:
Feb 3, 2025, 11:46:55 AM (2 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
54f70c6
Parents:
bbbff10
Message:

I set out to do a enum rework. It ended up being much the same and I unwound the core rework. But I hope the new names are a bit clearer and other minor fixes are helpful, so I am keeping those.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/ResolvExpr/CastCost.cpp

    rbbbff10 r90e683b  
    5353                void postvisit( const ast::EnumInstType * enumInst ) {
    5454                        cost = conversionCost( enumInst, dst, srcIsLvalue, symtab, env );
    55                         if ( enumInst->base->isTyped() ) {
    56                                 auto baseConversionCost = 
     55                        if ( enumInst->base->is_typed_enum() ) {
     56                                auto baseConversionCost =
    5757                                        castCost( enumInst->base->base, dst, srcIsLvalue, symtab, env );
    58                                 cost = baseConversionCost < cost? baseConversionCost: cost;
     58                                cost = baseConversionCost < cost ? baseConversionCost : cost;
    5959                        }
    6060                        static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicKind::SignedInt ) };
    6161                        Cost intCost = costCalc( integer, dst, srcIsLvalue, symtab, env );
    6262                        intCost.incSafe();
    63                         cost = intCost < cost? intCost: cost;
     63                        cost = intCost < cost ? intCost : cost;
    6464                }
    6565
Note: See TracChangeset for help on using the changeset viewer.