Changeset 1ba88a0 for src


Ignore:
Timestamp:
Sep 4, 2016, 3:25:32 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
b16898e
Parents:
85517ddb
Message:

implement implicit ctor/dtor deletion, track managed types when inserting ConstructorInit? nodes, remove fallbackInit case, update tests

Location:
src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • src/Common/utility.h

    r85517ddb r1ba88a0  
    261261
    262262template< typename T >
    263 struct ReverseIter {
     263struct reverseIterate_t {
    264264        T& ref;
    265265
    266         ReverseIter( T & ref ) : ref(ref) {}
     266        reverseIterate_t( T & ref ) : ref(ref) {}
    267267
    268268        typedef typename T::reverse_iterator iterator;
     
    272272
    273273template< typename T >
    274 ReverseIter< T > ReverseIterate( T & ref ) {
    275         return ReverseIter< T >( ref );
     274reverseIterate_t< T > reverseIterate( T & ref ) {
     275        return reverseIterate_t< T >( ref );
    276276}
    277277
  • src/GenPoly/Box.cc

    r85517ddb r1ba88a0  
    158158                class PolyGenericCalculator : public PolyMutator {
    159159                public:
     160                        typedef PolyMutator Parent;
     161                        using Parent::mutate;
     162
    160163                        template< typename DeclClass >
    161164                        DeclClass *handleDecl( DeclClass *decl, Type *type );
     
    16751678                DeclClass * PolyGenericCalculator::handleDecl( DeclClass *decl, Type *type ) {
    16761679                        beginTypeScope( type );
     1680                        // knownLayouts.beginScope();
     1681                        // knownOffsets.beginScope();
     1682
     1683                        DeclClass *ret = static_cast< DeclClass *>( Parent::mutate( decl ) );
     1684
     1685                        // knownOffsets.endScope();
     1686                        // knownLayouts.endScope();
     1687                        endTypeScope();
     1688                        return ret;
     1689                }
     1690
     1691                ObjectDecl * PolyGenericCalculator::mutate( ObjectDecl *objectDecl ) {
     1692                        return handleDecl( objectDecl, objectDecl->get_type() );
     1693                }
     1694
     1695                DeclarationWithType * PolyGenericCalculator::mutate( FunctionDecl *functionDecl ) {
    16771696                        knownLayouts.beginScope();
    16781697                        knownOffsets.beginScope();
    16791698
    1680                         DeclClass *ret = static_cast< DeclClass *>( Mutator::mutate( decl ) );
    1681 
     1699                        DeclarationWithType * decl = handleDecl( functionDecl, functionDecl->get_functionType() );
    16821700                        knownOffsets.endScope();
    16831701                        knownLayouts.endScope();
    1684                         endTypeScope();
    1685                         return ret;
    1686                 }
    1687 
    1688                 ObjectDecl * PolyGenericCalculator::mutate( ObjectDecl *objectDecl ) {
    1689                         return handleDecl( objectDecl, objectDecl->get_type() );
    1690                 }
    1691 
    1692                 DeclarationWithType * PolyGenericCalculator::mutate( FunctionDecl *functionDecl ) {
    1693                         return handleDecl( functionDecl, functionDecl->get_functionType() );
     1702                        return decl;
    16941703                }
    16951704
     
    17001709                TypeDecl * PolyGenericCalculator::mutate( TypeDecl *typeDecl ) {
    17011710                        scopeTyVars[ typeDecl->get_name() ] = typeDecl->get_kind();
    1702                         return Mutator::mutate( typeDecl );
     1711                        return Parent::mutate( typeDecl );
    17031712                }
    17041713
     
    17061715                        beginTypeScope( pointerType );
    17071716
    1708                         Type *ret = Mutator::mutate( pointerType );
     1717                        Type *ret = Parent::mutate( pointerType );
    17091718
    17101719                        endTypeScope();
     
    17241733                        }
    17251734
    1726                         Type *ret = Mutator::mutate( funcType );
     1735                        Type *ret = Parent::mutate( funcType );
    17271736
    17281737                        endTypeScope();
     
    17451754                                }
    17461755                        }
    1747                         return Mutator::mutate( declStmt );
     1756                        return Parent::mutate( declStmt );
    17481757                }
    17491758
     
    17871796                Expression *PolyGenericCalculator::mutate( MemberExpr *memberExpr ) {
    17881797                        // mutate, exiting early if no longer MemberExpr
    1789                         Expression *expr = Mutator::mutate( memberExpr );
     1798                        Expression *expr = Parent::mutate( memberExpr );
    17901799                        memberExpr = dynamic_cast< MemberExpr* >( expr );
    17911800                        if ( ! memberExpr ) return expr;
     
    19721981                Expression *PolyGenericCalculator::mutate( OffsetofExpr *offsetofExpr ) {
    19731982                        // mutate, exiting early if no longer OffsetofExpr
    1974                         Expression *expr = Mutator::mutate( offsetofExpr );
     1983                        Expression *expr = Parent::mutate( offsetofExpr );
    19751984                        offsetofExpr = dynamic_cast< OffsetofExpr* >( expr );
    19761985                        if ( ! offsetofExpr ) return expr;
  • src/GenPoly/PolyMutator.h

    r85517ddb r1ba88a0  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // PolyMutator.h -- 
     7// PolyMutator.h --
    88//
    99// Author           : Richard C. Bilson
     
    3030        class PolyMutator : public Mutator {
    3131          public:
     32                typedef Mutator Parent;
     33                using Parent::mutate;
     34
    3235                PolyMutator();
    3336
     
    4245                virtual Statement* mutate(ExprStmt *catchStmt);
    4346                virtual Statement* mutate(ReturnStmt *catchStmt);
    44  
     47
    4548                virtual Expression* mutate(UntypedExpr *untypedExpr);
    4649
     
    5457                Statement* mutateStatement( Statement *stmt );
    5558                Expression* mutateExpression( Expression *expr );
    56  
     59
    5760                TyVarMap scopeTyVars;
    5861                TypeSubstitution *env;
     
    6063                std::list< Statement* > stmtsToAddAfter;
    6164        };
    62 } // namespace 
     65} // namespace
    6366
    6467#endif // _POLYMUTATOR_H
  • src/InitTweak/FixInit.cc

    r85517ddb r1ba88a0  
    787787                                // need to iterate through members in reverse in order for
    788788                                // ctor/dtor statements to come out in the right order
    789                                 for ( Declaration * member : ReverseIterate( structDecl->get_members() ) ) {
     789                                for ( Declaration * member : reverseIterate( structDecl->get_members() ) ) {
    790790                                        DeclarationWithType * field = dynamic_cast< DeclarationWithType * >( member );
    791791                                        // skip non-DWT members
  • src/InitTweak/GenInit.cc

    r85517ddb r1ba88a0  
    2525#include "SynTree/Mutator.h"
    2626#include "SymTab/Autogen.h"
     27#include "SymTab/Mangler.h"
    2728#include "GenPoly/PolyMutator.h"
    2829#include "GenPoly/DeclMutator.h"
     30#include "GenPoly/ScopedSet.h"
    2931
    3032namespace InitTweak {
     
    5557        class CtorDtor : public GenPoly::PolyMutator {
    5658          public:
     59                typedef GenPoly::PolyMutator Parent;
     60                using Parent::mutate;
    5761                /// create constructor and destructor statements for object declarations.
    5862                /// the actual call statements will be added in after the resolver has run
     
    6569                // should not traverse into any of these declarations to find objects
    6670                // that need to be constructed or destructed
    67                 virtual Declaration* mutate( StructDecl *aggregateDecl ) { return aggregateDecl; }
     71                virtual Declaration* mutate( StructDecl *aggregateDecl );
    6872                virtual Declaration* mutate( UnionDecl *aggregateDecl ) { return aggregateDecl; }
    6973                virtual Declaration* mutate( EnumDecl *aggregateDecl ) { return aggregateDecl; }
     
    7478                virtual Type * mutate( FunctionType *funcType ) { return funcType; }
    7579
    76           protected:
     80                virtual CompoundStmt * mutate( CompoundStmt * compoundStmt );
     81
     82          private:
     83                // set of mangled type names for which a constructor or destructor exists in the current scope.
     84                // these types require a ConstructorInit node to be generated, anything else is a POD type and thus
     85                // should not have a ConstructorInit generated.
     86
     87                bool isManaged( ObjectDecl * objDecl ) const ; // determine if object is managed
     88                void handleDWT( DeclarationWithType * dwt ); // add type to managed if ctor/dtor
     89                GenPoly::ScopedSet< std::string > managedTypes;
     90                bool inFunction = false;
    7791        };
    7892
     
    142156
    143157        DeclarationWithType* ReturnFixer::mutate( FunctionDecl *functionDecl ) {
    144                 std::list<DeclarationWithType*> oldReturnVals = returnVals;
    145                 std::string oldFuncName = funcName;
     158                ValueGuard< std::list<DeclarationWithType*> > oldReturnVals( returnVals );
     159                ValueGuard< std::string > oldFuncName( funcName );
    146160
    147161                FunctionType * type = functionDecl->get_functionType();
     
    149163                funcName = functionDecl->get_name();
    150164                DeclarationWithType * decl = Mutator::mutate( functionDecl );
    151                 returnVals = oldReturnVals;
    152                 funcName = oldFuncName;
    153165                return decl;
    154166        }
     
    197209
    198210        DeclarationWithType * HoistArrayDimension::mutate( FunctionDecl *functionDecl ) {
    199                 bool oldInFunc = inFunction;
     211                ValueGuard< bool > oldInFunc( inFunction );
    200212                inFunction = true;
    201213                DeclarationWithType * decl = Parent::mutate( functionDecl );
    202                 inFunction = oldInFunc;
    203214                return decl;
    204215        }
     
    209220        }
    210221
     222        bool CtorDtor::isManaged( ObjectDecl * objDecl ) const {
     223                Type * type = objDecl->get_type();
     224                while ( ArrayType * at = dynamic_cast< ArrayType * >( type ) ) {
     225                        type = at->get_base();
     226                }
     227                return managedTypes.find( SymTab::Mangler::mangle( type ) ) != managedTypes.end();
     228        }
     229
     230        void CtorDtor::handleDWT( DeclarationWithType * dwt ) {
     231                // if this function is a user-defined constructor or destructor, mark down the type as "managed"
     232                if ( ! LinkageSpec::isOverridable( dwt->get_linkage() ) && isCtorDtor( dwt->get_name() ) ) {
     233                        std::list< DeclarationWithType * > & params = GenPoly::getFunctionType( dwt->get_type() )->get_parameters();
     234                        assert( ! params.empty() );
     235                        PointerType * type = safe_dynamic_cast< PointerType * >( params.front()->get_type() );
     236                        managedTypes.insert( SymTab::Mangler::mangle( type->get_base() ) );
     237                }
     238        }
     239
    211240        DeclarationWithType * CtorDtor::mutate( ObjectDecl * objDecl ) {
    212                 // hands off if designated, if @=, or if extern
    213                 if ( tryConstruct( objDecl ) ) {
     241                handleDWT( objDecl );
     242                // hands off if @=, extern, builtin, etc.
     243                // if global but initializer is not constexpr, always try to construct, since this is not legal C
     244                if ( ( tryConstruct( objDecl ) && isManaged( objDecl ) ) || (! inFunction && ! isConstExpr( objDecl->get_init() ) ) ) {
     245                        // constructed objects cannot be designated
     246                        if ( isDesignated( objDecl->get_init() ) ) throw SemanticError( "Cannot include designations in the initializer for a managed Object. If this is really what you want, then initialize with @=.", objDecl );
     247                        // xxx - constructed objects should not have initializers nested too deeply
     248
    214249                        // call into genImplicitCall from Autogen.h to generate calls to ctor/dtor
    215250                        // for each constructable object
     
    241276                        }
    242277                }
    243                 return Mutator::mutate( objDecl );
     278                return Parent::mutate( objDecl );
    244279        }
    245280
    246281        DeclarationWithType * CtorDtor::mutate( FunctionDecl *functionDecl ) {
     282                ValueGuard< bool > oldInFunc = inFunction;
     283                inFunction = true;
     284
     285                handleDWT( functionDecl );
     286
     287                managedTypes.beginScope();
     288                // go through assertions and recursively add seen ctor/dtors
     289                for ( TypeDecl * tyDecl : functionDecl->get_functionType()->get_forall() ) {
     290                        for ( DeclarationWithType *& assertion : tyDecl->get_assertions() ) {
     291                                assertion = assertion->acceptMutator( *this );
     292                        }
     293                }
    247294                // parameters should not be constructed and destructed, so don't mutate FunctionType
    248295                mutateAll( functionDecl->get_oldDecls(), *this );
    249296                functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) );
     297
     298                managedTypes.endScope();
    250299                return functionDecl;
    251300        }
     301
     302        Declaration* CtorDtor::mutate( StructDecl *aggregateDecl ) {
     303                // don't construct members, but need to take note if there is a managed member,
     304                // because that means that this type is also managed
     305                for ( Declaration * member : aggregateDecl->get_members() ) {
     306                        if ( ObjectDecl * field = dynamic_cast< ObjectDecl * >( member ) ) {
     307                                if ( isManaged( field ) ) {
     308                                        managedTypes.insert( SymTab::Mangler::mangle( aggregateDecl ) );
     309                                        break;
     310                                }
     311                        }
     312                }
     313                return aggregateDecl;
     314        }
     315
     316        CompoundStmt * CtorDtor::mutate( CompoundStmt * compoundStmt ) {
     317                managedTypes.beginScope();
     318                CompoundStmt * stmt = Parent::mutate( compoundStmt );
     319                managedTypes.endScope();
     320                return stmt;
     321        }
     322
    252323} // namespace InitTweak
    253324
  • src/InitTweak/InitTweak.cc

    r85517ddb r1ba88a0  
    232232                return ! LinkageSpec::isBuiltin( objDecl->get_linkage() ) &&
    233233                        (objDecl->get_init() == NULL ||
    234                                 ( objDecl->get_init() != NULL && objDecl->get_init()->get_maybeConstructed() )) &&
    235                         ! isDesignated( objDecl->get_init() )
     234                                ( objDecl->get_init() != NULL && objDecl->get_init()->get_maybeConstructed() ))
    236235                        && objDecl->get_storageClass() != DeclarationNode::Extern;
    237236        }
     
    391390                virtual void visit( ApplicationExpr *applicationExpr ) { isConstExpr = false; }
    392391                virtual void visit( UntypedExpr *untypedExpr ) { isConstExpr = false; }
    393                 virtual void visit( NameExpr *nameExpr ) { isConstExpr = false; }
    394                 virtual void visit( CastExpr *castExpr ) { isConstExpr = false; }
     392                virtual void visit( NameExpr *nameExpr ) {
     393                        // xxx - temporary hack, because 0 and 1 really should be constexprs, even though they technically aren't in Cforall today
     394                        if ( nameExpr->get_name() != "0" && nameExpr->get_name() != "1" ) isConstExpr = false;
     395                }
     396                // virtual void visit( CastExpr *castExpr ) { isConstExpr = false; }
     397                virtual void visit( AddressExpr *addressExpr ) {
     398                        // address of a variable or member expression is constexpr
     399                        Expression * arg = addressExpr->get_arg();
     400                        if ( ! dynamic_cast< NameExpr * >( arg) && ! dynamic_cast< VariableExpr * >( arg ) && ! dynamic_cast< MemberExpr * >( arg ) && ! dynamic_cast< UntypedMemberExpr * >( arg ) ) isConstExpr = false;
     401                }
    395402                virtual void visit( LabelAddressExpr *labAddressExpr ) { isConstExpr = false; }
    396403                virtual void visit( UntypedMemberExpr *memberExpr ) { isConstExpr = false; }
    397404                virtual void visit( MemberExpr *memberExpr ) { isConstExpr = false; }
    398405                virtual void visit( VariableExpr *variableExpr ) { isConstExpr = false; }
    399                 virtual void visit( ConstantExpr *constantExpr ) { /* bottom out */ }
    400406                // these might be okay?
    401407                // virtual void visit( SizeofExpr *sizeofExpr );
  • src/ResolvExpr/Resolver.cc

    r85517ddb r1ba88a0  
    528528
    529529        void Resolver::visit( ConstructorInit *ctorInit ) {
    530                 try {
    531                         maybeAccept( ctorInit->get_ctor(), *this );
    532                         maybeAccept( ctorInit->get_dtor(), *this );
    533                 } catch ( SemanticError ) {
    534                         // no alternatives for the constructor initializer - fallback on C-style initializer
    535                         // xxx - not sure if this makes a ton of sense - should maybe never be able to have this situation?
    536                         fallbackInit( ctorInit );
    537                         return;
    538                 }
     530                // xxx - fallback init has been removed => remove fallbackInit function and remove complexity from FixInit and remove C-init from ConstructorInit
     531                maybeAccept( ctorInit->get_ctor(), *this );
     532                maybeAccept( ctorInit->get_dtor(), *this );
    539533
    540534                // found a constructor - can get rid of C-style initializer
  • src/SymTab/Indexer.cc

    r85517ddb r1ba88a0  
    2121#include <unordered_set>
    2222#include <utility>
     23#include <algorithm>
    2324
    2425#include "Mangler.h"
     
    3334#include "SynTree/Initializer.h"
    3435#include "SynTree/Statement.h"
     36
     37#include "InitTweak/InitTweak.h"
    3538
    3639#define debugPrint(x) if ( doDebug ) { std::cout << x; }
     
    99102
    100103                if ( --toFree->refCount == 0 ) delete toFree;
     104        }
     105
     106        void Indexer::removeSpecialOverrides( const std::string &id, std::list< DeclarationWithType * > & out ) const {
     107                // only need to perform this step for constructors and destructors
     108                if ( ! InitTweak::isCtorDtor( id ) ) return;
     109
     110                // helpful data structure
     111                struct ValueType {
     112                        struct DeclBall {
     113                                FunctionDecl * decl;
     114                                bool isUserDefinedFunc; // properties for this particular decl
     115                                bool isDefaultFunc;
     116                                bool isCopyFunc;
     117                        };
     118                        // properties for this type
     119                        bool userDefinedFunc = false; // any user defined function found
     120                        bool userDefinedDefaultFunc = false; // user defined default ctor found
     121                        bool userDefinedCopyFunc = false; // user defined copy ctor found
     122                        std::list< DeclBall > decls;
     123
     124                        // another FunctionDecl for the current type was found - determine
     125                        // if it has special properties and update data structure accordingly
     126                        ValueType & operator+=( FunctionDecl * function ) {
     127                                bool isUserDefinedFunc = ! LinkageSpec::isOverridable( function->get_linkage() );
     128                                bool isDefaultFunc = function->get_functionType()->get_parameters().size() == 1;
     129                                bool isCopyFunc = InitTweak::isCopyConstructor( function );
     130                                decls.push_back( DeclBall{ function, isUserDefinedFunc, isDefaultFunc, isCopyFunc } );
     131                                userDefinedFunc = userDefinedFunc || isUserDefinedFunc;
     132                                userDefinedDefaultFunc = userDefinedDefaultFunc || (isUserDefinedFunc && isDefaultFunc);
     133                                userDefinedCopyFunc = userDefinedCopyFunc || (isUserDefinedFunc && isCopyFunc);
     134                                return *this;
     135                        }
     136                }; // ValueType
     137
     138                std::list< DeclarationWithType * > copy;
     139                copy.splice( copy.end(), out );
     140
     141                // organize discovered declarations by type
     142                std::unordered_map< std::string, ValueType > funcMap;
     143                for ( DeclarationWithType * decl : copy ) {
     144                        if ( FunctionDecl * function = dynamic_cast< FunctionDecl * >( decl ) ) {
     145                                std::list< DeclarationWithType * > params = function->get_functionType()->get_parameters();
     146                                assert( ! params.empty() );
     147                                funcMap[ Mangler::mangle( params.front()->get_type() ) ] += function;
     148                        } else {
     149                                out.push_back( decl );
     150                        }
     151                }
     152
     153                // if a type contains user defined ctor/dtors, then special rules trigger, which determine
     154                // the set of ctor/dtors that are seen by the requester. In particular, if the user defines
     155                // a default ctor, then the generated default ctor should never be seen, likewise for copy ctor
     156                // and dtor. If the user defines any ctor/dtor, then no generated field ctors should be seen.
     157                for ( std::pair< const std::string, ValueType > & pair : funcMap ) {
     158                        ValueType & val = pair.second;
     159                        for ( ValueType::DeclBall ball : val.decls ) {
     160                                if ( ! val.userDefinedFunc || ball.isUserDefinedFunc || (! val.userDefinedDefaultFunc && ball.isDefaultFunc) || (! val.userDefinedCopyFunc && ball.isCopyFunc) ) {
     161                                        // decl conforms to the rules described above, so it should be seen by the requester
     162                                        out.push_back( ball.decl );
     163                                }
     164                        }
     165                }
    101166        }
    102167
     
    461526                        searchTables = searchTables->base.tables;
    462527                }
     528
     529                // some special functions, e.g. constructors and destructors
     530                // remove autogenerated functions when they are defined so that
     531                // they can never be matched
     532                removeSpecialOverrides( id, out );
    463533        }
    464534
  • src/SymTab/Indexer.h

    r85517ddb r1ba88a0  
    128128                static void deleteRef( Impl *toFree );
    129129
     130                // Removes matching autogenerated constructors and destructors
     131                // so that they will not be selected
     132                // void removeSpecialOverrides( FunctionDecl *decl );
     133                void removeSpecialOverrides( const std::string &id, std::list< DeclarationWithType * > & out ) const;
     134
    130135                /// Ensures that tables variable is writable (i.e. allocated, uniquely owned by this Indexer, and at the current scope)
    131136                void makeWritable();
  • src/tests/.expect/64/declarationSpecifier.txt

    r85517ddb r1ba88a0  
    530530    return ((int )_retVal0);
    531531}
    532 __attribute__ ((constructor(),)) static void _init_declarationSpecifier(void){
    533     ((void)___constructor__F_P13s__anonymous0_autogen___1(((struct __anonymous0 *)(&__x10__CV13s__anonymous0_1))));
    534     ((void)___constructor__F_P13s__anonymous1_autogen___1(((struct __anonymous1 *)(&__x11__CV13s__anonymous1_1))));
    535     ((void)___constructor__F_P13s__anonymous2_autogen___1(((struct __anonymous2 *)(&__x12__CV13s__anonymous2_1))));
    536     ((void)___constructor__F_P13s__anonymous3_autogen___1(((struct __anonymous3 *)(&__x13__CV13s__anonymous3_1))));
    537     ((void)___constructor__F_P13s__anonymous4_autogen___1(((struct __anonymous4 *)(&__x14__CV13s__anonymous4_1))));
    538     ((void)___constructor__F_P13s__anonymous5_autogen___1(((struct __anonymous5 *)(&__x15__CV13s__anonymous5_1))));
    539     ((void)___constructor__F_P13s__anonymous6_autogen___1(((struct __anonymous6 *)(&__x16__CV13s__anonymous6_1))));
    540     ((void)___constructor__F_P13s__anonymous7_autogen___1(((struct __anonymous7 *)(&__x17__CV13s__anonymous7_1))));
    541     ((void)___constructor__F_P13s__anonymous8_autogen___1(((struct __anonymous8 *)(&__x29__CV13s__anonymous8_1))));
    542     ((void)___constructor__F_P13s__anonymous9_autogen___1(((struct __anonymous9 *)(&__x30__CV13s__anonymous9_1))));
    543     ((void)___constructor__F_P14s__anonymous10_autogen___1(((struct __anonymous10 *)(&__x31__CV14s__anonymous10_1))));
    544     ((void)___constructor__F_P14s__anonymous11_autogen___1(((struct __anonymous11 *)(&__x32__CV14s__anonymous11_1))));
    545     ((void)___constructor__F_P14s__anonymous12_autogen___1(((struct __anonymous12 *)(&__x33__CV14s__anonymous12_1))));
    546     ((void)___constructor__F_P14s__anonymous13_autogen___1(((struct __anonymous13 *)(&__x34__CV14s__anonymous13_1))));
    547     ((void)___constructor__F_P14s__anonymous14_autogen___1(((struct __anonymous14 *)(&__x35__CV14s__anonymous14_1))));
    548     ((void)___constructor__F_P14s__anonymous15_autogen___1(((struct __anonymous15 *)(&__x36__CV14s__anonymous15_1))));
    549 }
    550 __attribute__ ((destructor(),)) static void _destroy_declarationSpecifier(void){
    551     ((void)___destructor__F_P14s__anonymous15_autogen___1(((struct __anonymous15 *)(&__x36__CV14s__anonymous15_1))));
    552     ((void)___destructor__F_P14s__anonymous14_autogen___1(((struct __anonymous14 *)(&__x35__CV14s__anonymous14_1))));
    553     ((void)___destructor__F_P14s__anonymous13_autogen___1(((struct __anonymous13 *)(&__x34__CV14s__anonymous13_1))));
    554     ((void)___destructor__F_P14s__anonymous12_autogen___1(((struct __anonymous12 *)(&__x33__CV14s__anonymous12_1))));
    555     ((void)___destructor__F_P14s__anonymous11_autogen___1(((struct __anonymous11 *)(&__x32__CV14s__anonymous11_1))));
    556     ((void)___destructor__F_P14s__anonymous10_autogen___1(((struct __anonymous10 *)(&__x31__CV14s__anonymous10_1))));
    557     ((void)___destructor__F_P13s__anonymous9_autogen___1(((struct __anonymous9 *)(&__x30__CV13s__anonymous9_1))));
    558     ((void)___destructor__F_P13s__anonymous8_autogen___1(((struct __anonymous8 *)(&__x29__CV13s__anonymous8_1))));
    559     ((void)___destructor__F_P13s__anonymous7_autogen___1(((struct __anonymous7 *)(&__x17__CV13s__anonymous7_1))));
    560     ((void)___destructor__F_P13s__anonymous6_autogen___1(((struct __anonymous6 *)(&__x16__CV13s__anonymous6_1))));
    561     ((void)___destructor__F_P13s__anonymous5_autogen___1(((struct __anonymous5 *)(&__x15__CV13s__anonymous5_1))));
    562     ((void)___destructor__F_P13s__anonymous4_autogen___1(((struct __anonymous4 *)(&__x14__CV13s__anonymous4_1))));
    563     ((void)___destructor__F_P13s__anonymous3_autogen___1(((struct __anonymous3 *)(&__x13__CV13s__anonymous3_1))));
    564     ((void)___destructor__F_P13s__anonymous2_autogen___1(((struct __anonymous2 *)(&__x12__CV13s__anonymous2_1))));
    565     ((void)___destructor__F_P13s__anonymous1_autogen___1(((struct __anonymous1 *)(&__x11__CV13s__anonymous1_1))));
    566     ((void)___destructor__F_P13s__anonymous0_autogen___1(((struct __anonymous0 *)(&__x10__CV13s__anonymous0_1))));
    567 }
  • src/tests/.expect/64/extension.txt

    r85517ddb r1ba88a0  
    8686        __extension__ int __c__i_2;
    8787    };
    88     int __i__i_2;
    89     ((void)((*((int *)(&__i__i_2)))=(__extension__ __a__i_1+__extension__ 3)) /* ?{} */);
     88    int __i__i_2 = ((int )(__extension__ __a__i_1+__extension__ 3));
    9089    ((void)__extension__ 3);
    9190    ((void)__extension__ __a__i_1);
  • src/tests/.expect/64/gccExtensions.txt

    r85517ddb r1ba88a0  
    7676        ((void)((*((int *)(&(*___dst__P2sS_2).__c__i_2)))=__c__i_2) /* ?{} */);
    7777    }
    78     int __i__i_2;
    79     ((void)((*((int *)(&__i__i_2)))=__extension__ 3) /* ?{} */);
     78    int __i__i_2 = ((int )__extension__ 3);
    8079    __extension__ int __a__i_2;
    8180    __extension__ int __b__i_2;
     
    133132    }
    134133    struct s3 __x1__3ss3_2;
    135     ((void)___constructor__F_P3ss3_autogen___2(((struct s3 *)(&__x1__3ss3_2))));
    136134    struct s3 __y1__3ss3_2;
    137     ((void)___constructor__F_P3ss3_autogen___2(((struct s3 *)(&__y1__3ss3_2))));
    138135    struct s4 {
    139136        int __i__i_2;
     
    141138    inline struct s4 ___operator_assign__F3ss4_P3ss43ss4_autogen___2(struct s4 *___dst__P3ss4_2, struct s4 ___src__3ss4_2){
    142139        ((void)((*___dst__P3ss4_2).__i__i_2=___src__3ss4_2.__i__i_2));
    143         ((void)___destructor__F_P3ss3_autogen___2(((struct s3 *)(&__y1__3ss3_2))));
    144         ((void)___destructor__F_P3ss3_autogen___2(((struct s3 *)(&__x1__3ss3_2))));
    145140        return ((struct s4 )___src__3ss4_2);
    146141    }
     
    158153    }
    159154    struct s4 __x2__3ss4_2;
    160     ((void)___constructor__F_P3ss4_autogen___2(((struct s4 *)(&__x2__3ss4_2))));
    161155    struct s4 __y2__3ss4_2;
    162     ((void)___constructor__F_P3ss4_autogen___2(((struct s4 *)(&__y2__3ss4_2))));
    163156    int __m1__A0i_2[((long unsigned int )10)];
    164157    int __m2__A0A0i_2[((long unsigned int )10)][((long unsigned int )10)];
     
    166159    int _retVal0 = { 0 };
    167160    ((void)(_retVal0=0) /* ?{} */);
    168     ((void)___destructor__F_P3ss4_autogen___2(((struct s4 *)(&__y2__3ss4_2))));
    169     ((void)___destructor__F_P3ss4_autogen___2(((struct s4 *)(&__x2__3ss4_2))));
    170     ((void)___destructor__F_P3ss3_autogen___2(((struct s3 *)(&__y1__3ss3_2))));
    171     ((void)___destructor__F_P3ss3_autogen___2(((struct s3 *)(&__x1__3ss3_2))));
    172161    return ((int )_retVal0);
    173     ((void)___destructor__F_P3ss4_autogen___2(((struct s4 *)(&__y2__3ss4_2))));
    174     ((void)___destructor__F_P3ss4_autogen___2(((struct s4 *)(&__x2__3ss4_2))));
    175     ((void)___destructor__F_P3ss3_autogen___2(((struct s3 *)(&__y1__3ss3_2))));
    176     ((void)___destructor__F_P3ss3_autogen___2(((struct s3 *)(&__x1__3ss3_2))));
    177162}
Note: See TracChangeset for help on using the changeset viewer.