Changeset be4335b


Ignore:
Timestamp:
Feb 2, 2024, 6:31:52 PM (11 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
47bd204
Parents:
bd67442
Message:

The remaining improvements I had planned for the Box pass are either very hard or (on reflection) of questionable value, and none are required. Cleans up some loose threads before I may move on.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Box.cpp

    rbd67442 rbe4335b  
    2525#include "AST/GenericSubstitution.hpp" // for genericSubstitution
    2626#include "CodeGen/OperatorTable.h"     // for isAssignment
     27#include "Common/Iterate.hpp"          // for group_iterate
    2728#include "Common/ScopedMap.h"          // for ScopedMap
     29#include "Common/ToString.hpp"         // for toCString
    2830#include "Common/UniqueName.h"         // for UniqueName
    29 #include "Common/utility.h"            // for toCString, group_iterate
    3031#include "GenPoly/FindFunction.h"      // for findFunction
    3132#include "GenPoly/GenPoly.h"           // for getFunctionType, ...
     
    236237        ) );
    237238        // TODO: Polymorphic types will be out of the struct declaration scope.
    238         // Should be removed by PolyGenericCalculator.
     239        // This breaks invariants until it is corrected later.
    239240        for ( auto const & member : enumerate( decl->members ) ) {
    240241                auto dwt = member.val.strict_as<ast::DeclWithType>();
     
    309310        ) );
    310311        // TODO: Polymorphic types will be out of the union declaration scope.
     312        // This breaks invariants until it is corrected later.
    311313        for ( auto const & member : decl->members ) {
    312314                auto dwt = member.strict_as<ast::DeclWithType>();
     
    575577                if ( adapters.contains( mangleName ) ) continue;
    576578                std::string adapterName = makeAdapterName( mangleName );
    577                 // TODO: The forwarding here is problematic because these
    578                 // declarations are not rooted anywhere in the translation unit.
     579                // NODE: This creates floating nodes, breaking invariants.
     580                // This is corrected in the RewireAdapters sub-pass.
    579581                adapters.insert(
    580582                        mangleName,
     
    639641
    640642        TypeVarMap exprTypeVars;
    641         // TODO: Should this take into account the variables already bound in
    642         // scopeTypeVars ([ex] remove them from exprTypeVars)?
    643643        makeTypeVarMap( function, exprTypeVars );
    644644        auto dynRetType = isDynRet( function, exprTypeVars );
     
    15211521
    15221522// --------------------------------------------------------------------------
    1523 // TODO: Ideally, there would be no floating nodes at all.
    15241523/// Corrects the floating nodes created in CallAdapter.
    15251524struct RewireAdapters final : public ast::WithGuards {
     
    18371836
    18381837        // Not all members of a polymorphic type are themselves of a polymorphic
    1839         // type; in this cas the member expression should be wrapped and
     1838        // type; in this case the member expression should be wrapped and
    18401839        // dereferenced to form an lvalue.
    18411840        if ( !isPolyType( memberType, scopeTypeVars ) ) {
Note: See TracChangeset for help on using the changeset viewer.