Changeset e0330d2c


Ignore:
Timestamp:
Dec 18, 2024, 6:37:11 PM (5 weeks ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master
Children:
e0f3bd2
Parents:
faf9e19
Message:

Remove unnecessary special case for zero_t in code gen that caused unused-variable warning in thunks.

Add instructions for tidying warnings (with the present zero_t case as its running example) as a "proposal."

The code gen change is safe because a corresponding case for one_t was always "missing" and the the variable at issue is never used meaningfully. (Prior work has size_t lowered as int. While that's a dubious choice, it's beyond what I'm fixing here.)

Mark these tests as now clean of warnings:

array-collections/array-basic
ctrl-flow/loopctrl
vector
vector_math/vec2_int
vector_math/vec2_float
vector_math/vec3_float
vector_math/vec4_float
zero_one

Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cpp

    rfaf9e19 re0330d2c  
    742742        extension( expr );
    743743        const OperatorInfo * opInfo;
    744         if ( dynamic_cast<ast::ZeroType const *>( expr->var->get_type() ) ) {
    745                 output << "0";
    746         } else if ( expr->var->linkage == ast::Linkage::Intrinsic
     744        if ( expr->var->linkage == ast::Linkage::Intrinsic
    747745                        && ( opInfo = operatorLookup( expr->var->name ) )
    748746                        && opInfo->type == OT_CONSTANT ) {
  • tests/Makefile.am

    rfaf9e19 re0330d2c  
    5050# Indented list entries are finer-grained targets under the test.
    5151# Making this association implicit would be ideal, but requires learning more automake than is affordable.
    52 WFLGAS_OPT_LAX = \
     52WFLGAS_OPT_LAX =  \
    5353        abs \
    5454        alloc \
    5555        alloc2 \
    5656        array \
    57         array-collections/array-basic \
    5857        array-collections/array-raii-c \
    5958        array-collections/array-raii-cfa \
     
    188187        ctrl-flow/ifwhileCtl \
    189188        ctrl-flow/labelledExit \
    190         ctrl-flow/loopctrl \
    191189        ctrl-flow/loop_else \
    192190        designations \
     
    306304        variableDeclarator \
    307305        vector \
    308         vector_math/vec2_int \
    309         vector_math/vec2_float \
    310         vector_math/vec3_float \
    311         vector_math/vec4_float \
    312         warnings/self-assignment \
    313         zero_one
     306        warnings/self-assignment
    314307
    315308WFLAGS=${if ${filter ${WFLGAS_OPT_LAX},${@}},${WFLAGS_LAX},${WFLAGS_STRICT}}
  • tests/array-collections/array-basic.cfa

    rfaf9e19 re0330d2c  
    1212    // numeric subscripts
    1313    ptrdiff_t ix = 1, iy = 2, iz = 3;
    14     array( float, Ny, Nz ) & yz = xyz[ix];
    15     array( float, Nz ) & z = xyz[ix][iy];
    16     float & val = xyz[ix][iy][iz];
     14    array( float, Ny, Nz ) & yz = xyz[ix];      (void) yz;
     15    array( float, Nz ) & z = xyz[ix][iy];       (void) z;
     16    float & val = xyz[ix][iy][iz];              (void) val;
    1717
    1818    // deferral subscript
Note: See TracChangeset for help on using the changeset viewer.