Ignore:
Timestamp:
Sep 9, 2024, 5:15:32 PM (37 hours ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
f5dbc8d
Parents:
5c6d439
Message:

Removed SizeofExpr::expr and AlignofExpr::expr, expressions that would be stored there are wrapped in TypeofType? and stored in the type field. Some special cases to hide the typeof in code generation were added. In addition, initializer length is calculated in more cases so that the full type of more arrays is known sooner. Other than that, most of the code changes were just stripping out the conditional code and checks no longer needed. Some tests had to be updated, because the typeof is not hidden in dumps and the resolver replaces known typeof expressions with the type. The extension case caused some concern but it appears that just hides warnings in the expression which no longer exists.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Box.cpp

    r5c6d439 rb6f2e7ab  
    19251925ast::Expr const * PolyGenericCalculator::postvisit(
    19261926                ast::SizeofExpr const * expr ) {
    1927         ast::Type const * type = expr->type ? expr->type : expr->expr->result;
    1928         ast::Expr const * gen = genSizeof( expr->location, type );
     1927        ast::Expr const * gen = genSizeof( expr->location, expr->type );
    19291928        return ( gen ) ? gen : expr;
    19301929}
     
    19321931ast::Expr const * PolyGenericCalculator::postvisit(
    19331932                ast::AlignofExpr const * expr ) {
    1934         ast::Type const * type = expr->type ? expr->type : expr->expr->result;
    1935         ast::Expr const * gen = genAlignof( expr->location, type );
     1933        ast::Expr const * gen = genAlignof( expr->location, expr->type );
    19361934        return ( gen ) ? gen : expr;
    19371935}
Note: See TracChangeset for help on using the changeset viewer.