Changeset e0330d2c for src/CodeGen


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

File:
1 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 ) {
Note: See TracChangeset for help on using the changeset viewer.