Changeset 0c327ce for src/AST/Expr.cpp


Ignore:
Timestamp:
Jul 12, 2024, 3:30:06 PM (5 weeks ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
76b507d
Parents:
9c447e2
Message:
  1. Add bound check to Serial function: now compiler generates the unchecked functions in ImplementEnumFunc?, and enum.hfa implements the bound check on top. Todo: Wrapped the checked version into a trait; 2. countof is now works on any type that implement Countof(). Because Countof() is implemented in enum.hfa for all CfaEnum?, we can call countof on { T | CfaEnum?(T) }
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Expr.cpp

    r9c447e2 r0c327ce  
    284284// --- CountExpr
    285285
     286CountExpr::CountExpr( const CodeLocation & loc, const Expr * e )
     287: Expr( loc, new BasicType( BasicKind::LongUnsignedInt) ), expr(e), type( nullptr ) {}
     288
    286289CountExpr::CountExpr( const CodeLocation & loc, const Type * t )
    287 : Expr( loc, new BasicType( BasicKind::LongUnsignedInt) ), type( t ) {}
     290: Expr( loc, new BasicType( BasicKind::LongUnsignedInt) ), expr(nullptr), type( t ) {}
    288291
    289292// --- AlignofExpr
Note: See TracChangeset for help on using the changeset viewer.