- Timestamp:
- Apr 18, 2024, 8:38:33 PM (8 months ago)
- Branches:
- master
- Children:
- 38093ae
- Parents:
- cdb4eaa
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/ConversionCost.cc
rcdb4eaa r748c751 379 379 void ConversionCost::postvisit( const ast::EnumAttrType * src ) { 380 380 auto dstAsEnumAttrType = dynamic_cast<const ast::EnumAttrType *>(dst); 381 if ( src->attr == ast::EnumAttribute::Label ) { 382 if ( dstAsEnumAttrType && dstAsEnumAttrType->attr == ast::EnumAttribute::Label ) { 383 cost = costCalc( src->instance, dstAsEnumAttrType->instance, srcIsLvalue, symtab, env ); 384 } 385 // Add Conversion To String 386 } else if ( src->attr == ast::EnumAttribute::Value ) { 381 assert( src->attr != ast::EnumAttribute::Label ); 382 if ( src->attr == ast::EnumAttribute::Value ) { 387 383 if ( dstAsEnumAttrType && dstAsEnumAttrType->attr == ast::EnumAttribute::Value) { 388 384 cost = costCalc( src->instance, dstAsEnumAttrType->instance, srcIsLvalue, symtab, env ); -
src/Validate/ImplementEnumFunc.cpp
rcdb4eaa r748c751 296 296 {new ast::ObjectDecl(getLocation(), "_i", new ast::EnumInstType(decl))}, 297 297 {new ast::ObjectDecl(getLocation(), "_ret", 298 new ast::EnumAttrType(new ast::EnumInstType(decl), 299 ast::EnumAttribute::Posn))}); 298 new ast::BasicType(ast::BasicType::UnsignedInt))}); 300 299 } 301 300
Note: See TracChangeset
for help on using the changeset viewer.