Changeset c4b9fa9


Ignore:
Timestamp:
Dec 1, 2023, 3:19:03 PM (3 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
2f8d351, 539a8c8
Parents:
dd900b5
Message:

Just some random clean-up in Box pass while I was musing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Box.cpp

    rdd900b5 rc4b9fa9  
    16261626
    16271627/// Converts polymorphic type into a suitable monomorphic representation.
    1628 /// Currently: __attribute__((aligned(8) )) char[size_T];
     1628/// Currently: __attribute__(( aligned(8) )) char[size_T];
    16291629ast::Type * polyToMonoType( CodeLocation const & location,
    16301630                ast::Type const * declType ) {
     
    16321632        auto size = new ast::NameExpr( location,
    16331633                sizeofName( Mangle::mangleType( declType ) ) );
    1634         auto aligned = new ast::Attribute( "aligned",
    1635                 { ast::ConstantExpr::from_int( location, 8 ) } );
    16361634        auto ret = new ast::ArrayType( charType, size,
    16371635                ast::VariableLen, ast::DynamicDim, ast::CV::Qualifiers() );
    1638         ret->attributes.push_back( aligned );
     1636        ret->attributes.emplace_back( new ast::Attribute( "aligned",
     1637                { ast::ConstantExpr::from_int( location, 8 ) } ) );
    16391638        return ret;
    16401639}
     
    17671766long findMember( ast::DeclWithType const * memberDecl,
    17681767                const ast::vector<ast::Decl> & baseDecls ) {
    1769         for ( auto pair : enumerate( baseDecls ) ) {
    1770                 if ( isMember( memberDecl, pair.val.get() ) ) {
    1771                         return pair.idx;
     1768        for ( auto const & [index, value] : enumerate( baseDecls ) ) {
     1769                if ( isMember( memberDecl, value.get() ) ) {
     1770                        return index;
    17721771                }
    17731772        }
Note: See TracChangeset for help on using the changeset viewer.