Changeset d84f2ae


Ignore:
Timestamp:
Jan 8, 2025, 1:00:13 PM (12 days ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master
Children:
658f3179
Parents:
190a833
Message:

Fix transpiler-induced unused parameter on layoutof.

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Box.cpp

    r190a833 rd84f2ae  
    9595                ast::TypeInstType inst( sizedParam );
    9696                std::string paramName = Mangle::mangleType( &inst );
    97                 params.emplace_back( new ast::ObjectDecl(
     97                auto sizeofParam = new ast::ObjectDecl(
    9898                        sizedParam->location,
    9999                        sizeofName( paramName ),
    100100                        getLayoutCType( transUnit )
    101                 ) );
    102                 auto alignParam = new ast::ObjectDecl(
     101                );
     102                sizeofParam->attributes.push_back( new ast::Attribute( "unused" ) );
     103                params.emplace_back( sizeofParam );
     104                auto alignofParam = new ast::ObjectDecl(
    103105                        sizedParam->location,
    104106                        alignofName( paramName ),
    105107                        getLayoutCType( transUnit )
    106108                );
    107                 alignParam->attributes.push_back( new ast::Attribute( "unused" ) );
    108                 params.emplace_back( alignParam );
     109                alignofParam->attributes.push_back( new ast::Attribute( "unused" ) );
     110                params.emplace_back( alignofParam );
    109111        }
    110112}
  • tests/.expect/functions.arm64.txt

    r190a833 rd84f2ae  
    123123struct _tuple2_ {
    124124};
    125 static inline void _layoutof__tuple2_(unsigned long int *_sizeof__tuple2_, unsigned long int *_alignof__tuple2_, unsigned long int *_offsetof__tuple2_, const unsigned long int _sizeof_Y15tuple_param_2_0, __attribute__ ((unused)) const unsigned long int _alignof_Y15tuple_param_2_0, const unsigned long int _sizeof_Y15tuple_param_2_1, __attribute__ ((unused)) const unsigned long int _alignof_Y15tuple_param_2_1){
     125static inline void _layoutof__tuple2_(unsigned long int *_sizeof__tuple2_, unsigned long int *_alignof__tuple2_, unsigned long int *_offsetof__tuple2_, __attribute__ ((unused)) const unsigned long int _sizeof_Y15tuple_param_2_0, __attribute__ ((unused)) const unsigned long int _alignof_Y15tuple_param_2_0, __attribute__ ((unused)) const unsigned long int _sizeof_Y15tuple_param_2_1, __attribute__ ((unused)) const unsigned long int _alignof_Y15tuple_param_2_1){
    126126    ((void)((*_sizeof__tuple2_)=0));
    127127    ((void)((*_alignof__tuple2_)=1));
     
    160160struct _tuple3_ {
    161161};
    162 static inline void _layoutof__tuple3_(unsigned long int *_sizeof__tuple3_, unsigned long int *_alignof__tuple3_, unsigned long int *_offsetof__tuple3_, const unsigned long int _sizeof_Y15tuple_param_3_0, __attribute__ ((unused)) const unsigned long int _alignof_Y15tuple_param_3_0, const unsigned long int _sizeof_Y15tuple_param_3_1, __attribute__ ((unused)) const unsigned long int _alignof_Y15tuple_param_3_1, const unsigned long int _sizeof_Y15tuple_param_3_2, __attribute__ ((unused)) const unsigned long int _alignof_Y15tuple_param_3_2){
     162static inline void _layoutof__tuple3_(unsigned long int *_sizeof__tuple3_, unsigned long int *_alignof__tuple3_, unsigned long int *_offsetof__tuple3_, __attribute__ ((unused)) const unsigned long int _sizeof_Y15tuple_param_3_0, __attribute__ ((unused)) const unsigned long int _alignof_Y15tuple_param_3_0, __attribute__ ((unused)) const unsigned long int _sizeof_Y15tuple_param_3_1, __attribute__ ((unused)) const unsigned long int _alignof_Y15tuple_param_3_1, __attribute__ ((unused)) const unsigned long int _sizeof_Y15tuple_param_3_2, __attribute__ ((unused)) const unsigned long int _alignof_Y15tuple_param_3_2){
    163163    ((void)((*_sizeof__tuple3_)=0));
    164164    ((void)((*_alignof__tuple3_)=1));
  • tests/.expect/functions.x64.txt

    r190a833 rd84f2ae  
    123123struct _tuple2_ {
    124124};
    125 static inline void _layoutof__tuple2_(unsigned long int *_sizeof__tuple2_, unsigned long int *_alignof__tuple2_, unsigned long int *_offsetof__tuple2_, const unsigned long int _sizeof_Y15tuple_param_2_0, __attribute__ ((unused)) const unsigned long int _alignof_Y15tuple_param_2_0, const unsigned long int _sizeof_Y15tuple_param_2_1, __attribute__ ((unused)) const unsigned long int _alignof_Y15tuple_param_2_1){
     125static inline void _layoutof__tuple2_(unsigned long int *_sizeof__tuple2_, unsigned long int *_alignof__tuple2_, unsigned long int *_offsetof__tuple2_, __attribute__ ((unused)) const unsigned long int _sizeof_Y15tuple_param_2_0, __attribute__ ((unused)) const unsigned long int _alignof_Y15tuple_param_2_0, __attribute__ ((unused)) const unsigned long int _sizeof_Y15tuple_param_2_1, __attribute__ ((unused)) const unsigned long int _alignof_Y15tuple_param_2_1){
    126126    ((void)((*_sizeof__tuple2_)=0));
    127127    ((void)((*_alignof__tuple2_)=1));
     
    160160struct _tuple3_ {
    161161};
    162 static inline void _layoutof__tuple3_(unsigned long int *_sizeof__tuple3_, unsigned long int *_alignof__tuple3_, unsigned long int *_offsetof__tuple3_, const unsigned long int _sizeof_Y15tuple_param_3_0, __attribute__ ((unused)) const unsigned long int _alignof_Y15tuple_param_3_0, const unsigned long int _sizeof_Y15tuple_param_3_1, __attribute__ ((unused)) const unsigned long int _alignof_Y15tuple_param_3_1, const unsigned long int _sizeof_Y15tuple_param_3_2, __attribute__ ((unused)) const unsigned long int _alignof_Y15tuple_param_3_2){
     162static inline void _layoutof__tuple3_(unsigned long int *_sizeof__tuple3_, unsigned long int *_alignof__tuple3_, unsigned long int *_offsetof__tuple3_, __attribute__ ((unused)) const unsigned long int _sizeof_Y15tuple_param_3_0, __attribute__ ((unused)) const unsigned long int _alignof_Y15tuple_param_3_0, __attribute__ ((unused)) const unsigned long int _sizeof_Y15tuple_param_3_1, __attribute__ ((unused)) const unsigned long int _alignof_Y15tuple_param_3_1, __attribute__ ((unused)) const unsigned long int _sizeof_Y15tuple_param_3_2, __attribute__ ((unused)) const unsigned long int _alignof_Y15tuple_param_3_2){
    163163    ((void)((*_sizeof__tuple3_)=0));
    164164    ((void)((*_alignof__tuple3_)=1));
  • tests/.expect/functions.x86.txt

    r190a833 rd84f2ae  
    123123struct _tuple2_ {
    124124};
    125 static inline void _layoutof__tuple2_(unsigned int *_sizeof__tuple2_, unsigned int *_alignof__tuple2_, unsigned int *_offsetof__tuple2_, const unsigned int _sizeof_Y15tuple_param_2_0, __attribute__ ((unused)) const unsigned int _alignof_Y15tuple_param_2_0, const unsigned int _sizeof_Y15tuple_param_2_1, __attribute__ ((unused)) const unsigned int _alignof_Y15tuple_param_2_1){
     125static inline void _layoutof__tuple2_(unsigned int *_sizeof__tuple2_, unsigned int *_alignof__tuple2_, unsigned int *_offsetof__tuple2_, __attribute__ ((unused)) const unsigned int _sizeof_Y15tuple_param_2_0, __attribute__ ((unused)) const unsigned int _alignof_Y15tuple_param_2_0, __attribute__ ((unused)) const unsigned int _sizeof_Y15tuple_param_2_1, __attribute__ ((unused)) const unsigned int _alignof_Y15tuple_param_2_1){
    126126    ((void)((*_sizeof__tuple2_)=0));
    127127    ((void)((*_alignof__tuple2_)=1));
     
    160160struct _tuple3_ {
    161161};
    162 static inline void _layoutof__tuple3_(unsigned int *_sizeof__tuple3_, unsigned int *_alignof__tuple3_, unsigned int *_offsetof__tuple3_, const unsigned int _sizeof_Y15tuple_param_3_0, __attribute__ ((unused)) const unsigned int _alignof_Y15tuple_param_3_0, const unsigned int _sizeof_Y15tuple_param_3_1, __attribute__ ((unused)) const unsigned int _alignof_Y15tuple_param_3_1, const unsigned int _sizeof_Y15tuple_param_3_2, __attribute__ ((unused)) const unsigned int _alignof_Y15tuple_param_3_2){
     162static inline void _layoutof__tuple3_(unsigned int *_sizeof__tuple3_, unsigned int *_alignof__tuple3_, unsigned int *_offsetof__tuple3_, __attribute__ ((unused)) const unsigned int _sizeof_Y15tuple_param_3_0, __attribute__ ((unused)) const unsigned int _alignof_Y15tuple_param_3_0, __attribute__ ((unused)) const unsigned int _sizeof_Y15tuple_param_3_1, __attribute__ ((unused)) const unsigned int _alignof_Y15tuple_param_3_1, __attribute__ ((unused)) const unsigned int _sizeof_Y15tuple_param_3_2, __attribute__ ((unused)) const unsigned int _alignof_Y15tuple_param_3_2){
    163163    ((void)((*_sizeof__tuple3_)=0));
    164164    ((void)((*_alignof__tuple3_)=1));
  • tests/Makefile.am

    r190a833 rd84f2ae  
    7676        concurrency/actors/static \
    7777        concurrency/actors/types \
    78         concurrency/channels/big_elems \
    7978        concurrency/channels/churn \
    8079        concurrency/channels/contend \
    8180        concurrency/channels/daisy_chain \
    8281        concurrency/channels/hot_potato \
    83         concurrency/channels/ping_pong \
    8482        concurrency/channels/pub_sub \
    85         concurrency/channels/zero_size \
    86         concurrency/cofor \
    8783        concurrency/futures/multi \
    8884        concurrency/futures/select_future \
    8985        concurrency/futures/typed \
    90         concurrency/futures/wait_any \
    9186        concurrency/lockfree_stack \
    92         concurrency/mutexstmt/locks \
    93         concurrency/mutexstmt/tuple \
    94         concurrency/once \
    9587        concurrency/pthread/bounded_buffer \
    9688        concurrency/pthread/pthread_attr_test \
     
    9991        concurrency/pthread/pthread_key_test \
    10092        concurrency/pthread/pthread_once_test \
    101         concurrency/thread \
    10293        concurrency/unified_locking/block_spin_lock \
    10394        concurrency/unified_locking/exp_backoff \
     
    115106        concurrency/waituntil/basic_else \
    116107        concurrency/waituntil/channel_close \
    117         concurrency/waituntil/channel_zero_size \
    118108        concurrency/waituntil/channels \
    119109        concurrency/waituntil/futures \
    120110        concurrency/waituntil/locks \
    121         concurrency/waituntil/one_chan \
    122111        concurrency/waituntil/repeat_close \
    123112        concurrency/waituntil/timeout \
     
    129118        exceptions/defaults \
    130119        exceptions/defaults-threads \
    131         exceptions/polymorphic \
    132120        exceptions/try-leave-catch \
    133         exceptions/virtual-poly \
    134121        forall \
    135122        function-operator \
     
    152139        poly-many-arsz \
    153140        polymorphism \
    154         poly-o-cycle \
    155         raii/boxed-types \
    156141        raii/ctor-autogen \
    157142        raii/dtor-early-exit \
     
    159144        references \
    160145        shortCircuit \
    161         smart-pointers \
    162146        sum \
    163147        switch \
  • tests/nowarn/unused.cfa

    r190a833 rd84f2ae  
    1212struct my_array {
    1313    float strides[N];
     14};
     15
     16// layoutof curious_size_dep doesn't need sizeof T
     17forall(T *)
     18struct curious_size_dep {
     19    int x;
    1420};
    1521
Note: See TracChangeset for help on using the changeset viewer.