Changes in / [3403534:28307be]


Ignore:
Location:
src
Files:
35 added
3 deleted
37 edited

Legend:

Unmodified
Added
Removed
  • src/Common/SemanticError.cc

    r3403534 r28307be  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // SemanticError.cc --
     7// SemanticError.cc -- 
    88//
    99// Author           : Richard C. Bilson
     
    2626
    2727SemanticError::SemanticError( std::string error ) {
    28   append( error );
     28        errors.push_back( std::string( "Error: " ) + error );
    2929}
    3030
    3131void SemanticError::append( SemanticError &other ) {
    32   errors.splice( errors.end(), other.errors );
    33 }
    34 
    35 void SemanticError::append( const std::string & msg ) {
    36   errors.push_back( std::string( "Error: ") + msg );
     32        errors.splice( errors.end(), other.errors );
    3733}
    3834
  • src/Common/SemanticError.h

    r3403534 r28307be  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // SemanticError.h --
     7// SemanticError.h -- 
    88//
    99// Author           : Richard C. Bilson
     
    3131
    3232        void append( SemanticError &other );
    33         void append( const std::string & );
    3433        bool isEmpty() const;
    3534        void print( std::ostream &os );
     
    4342template< typename T >
    4443SemanticError::SemanticError( const std::string &error, const T *obj ) {
    45         append( toString( error, obj ) );
     44        std::ostringstream os;
     45        os << "Error: " << error;
     46        obj->print( os );
     47        errors.push_back( os.str() );
    4648}
    47 
    4849
    4950#endif // SEMANTICERROR_H
  • src/Common/utility.h

    r3403534 r28307be  
    246246}
    247247
    248 // RAII object to regulate "save and restore" behaviour, e.g.
    249 // void Foo::bar() {
    250 //   ValueGuard<int> guard(var); // var is a member of type Foo
    251 //   var = ...;
    252 // } // var's original value is restored
    253 template< typename T >
    254 struct ValueGuard {
    255         T old;
    256         T& ref;
    257 
    258         ValueGuard(T& inRef) : old(inRef), ref(inRef) {}
    259         ~ValueGuard() { ref = old; }
    260 };
    261 
    262 template< typename T >
    263 struct reverseIterate_t {
    264         T& ref;
    265 
    266         reverseIterate_t( T & ref ) : ref(ref) {}
    267 
    268         typedef typename T::reverse_iterator iterator;
    269         iterator begin() { return ref.rbegin(); }
    270         iterator end() { return ref.rend(); }
    271 };
    272 
    273 template< typename T >
    274 reverseIterate_t< T > reverseIterate( T & ref ) {
    275         return reverseIterate_t< T >( ref );
    276 }
    277 
    278248#endif // _UTILITY_H
    279249
  • src/GenPoly/Box.cc

    r3403534 r28307be  
    158158                class PolyGenericCalculator : public PolyMutator {
    159159                public:
    160                         typedef PolyMutator Parent;
    161                         using Parent::mutate;
    162 
    163160                        template< typename DeclClass >
    164161                        DeclClass *handleDecl( DeclClass *decl, Type *type );
     
    16781675                DeclClass * PolyGenericCalculator::handleDecl( DeclClass *decl, Type *type ) {
    16791676                        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();
     1677                        knownLayouts.beginScope();
     1678                        knownOffsets.beginScope();
     1679
     1680                        DeclClass *ret = static_cast< DeclClass *>( Mutator::mutate( decl ) );
     1681
     1682                        knownOffsets.endScope();
     1683                        knownLayouts.endScope();
    16871684                        endTypeScope();
    16881685                        return ret;
     
    16941691
    16951692                DeclarationWithType * PolyGenericCalculator::mutate( FunctionDecl *functionDecl ) {
    1696                         knownLayouts.beginScope();
    1697                         knownOffsets.beginScope();
    1698 
    1699                         DeclarationWithType * decl = handleDecl( functionDecl, functionDecl->get_functionType() );
    1700                         knownOffsets.endScope();
    1701                         knownLayouts.endScope();
    1702                         return decl;
     1693                        return handleDecl( functionDecl, functionDecl->get_functionType() );
    17031694                }
    17041695
     
    17091700                TypeDecl * PolyGenericCalculator::mutate( TypeDecl *typeDecl ) {
    17101701                        scopeTyVars[ typeDecl->get_name() ] = typeDecl->get_kind();
    1711                         return Parent::mutate( typeDecl );
     1702                        return Mutator::mutate( typeDecl );
    17121703                }
    17131704
     
    17151706                        beginTypeScope( pointerType );
    17161707
    1717                         Type *ret = Parent::mutate( pointerType );
     1708                        Type *ret = Mutator::mutate( pointerType );
    17181709
    17191710                        endTypeScope();
     
    17331724                        }
    17341725
    1735                         Type *ret = Parent::mutate( funcType );
     1726                        Type *ret = Mutator::mutate( funcType );
    17361727
    17371728                        endTypeScope();
     
    17541745                                }
    17551746                        }
    1756                         return Parent::mutate( declStmt );
     1747                        return Mutator::mutate( declStmt );
    17571748                }
    17581749
     
    17961787                Expression *PolyGenericCalculator::mutate( MemberExpr *memberExpr ) {
    17971788                        // mutate, exiting early if no longer MemberExpr
    1798                         Expression *expr = Parent::mutate( memberExpr );
     1789                        Expression *expr = Mutator::mutate( memberExpr );
    17991790                        memberExpr = dynamic_cast< MemberExpr* >( expr );
    18001791                        if ( ! memberExpr ) return expr;
     
    19811972                Expression *PolyGenericCalculator::mutate( OffsetofExpr *offsetofExpr ) {
    19821973                        // mutate, exiting early if no longer OffsetofExpr
    1983                         Expression *expr = Parent::mutate( offsetofExpr );
     1974                        Expression *expr = Mutator::mutate( offsetofExpr );
    19841975                        offsetofExpr = dynamic_cast< OffsetofExpr* >( expr );
    19851976                        if ( ! offsetofExpr ) return expr;
  • src/GenPoly/PolyMutator.h

    r3403534 r28307be  
    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 
    3532                PolyMutator();
    3633
     
    4542                virtual Statement* mutate(ExprStmt *catchStmt);
    4643                virtual Statement* mutate(ReturnStmt *catchStmt);
    47 
     44 
    4845                virtual Expression* mutate(UntypedExpr *untypedExpr);
    4946
     
    5754                Statement* mutateStatement( Statement *stmt );
    5855                Expression* mutateExpression( Expression *expr );
    59 
     56 
    6057                TyVarMap scopeTyVars;
    6158                TypeSubstitution *env;
     
    6360                std::list< Statement* > stmtsToAddAfter;
    6461        };
    65 } // namespace
     62} // namespace 
    6663
    6764#endif // _POLYMUTATOR_H
  • src/InitTweak/FixInit.cc

    r3403534 r28307be  
    3131#include "SynTree/Mutator.h"
    3232#include "SymTab/Indexer.h"
    33 #include "SymTab/Autogen.h"
    3433#include "GenPoly/PolyMutator.h"
    3534#include "SynTree/AddStmtVisitor.h"
     
    177176                };
    178177
    179                 class GenStructMemberCalls : public SymTab::Indexer {
     178                class WarnStructMembers : public Visitor {
    180179                  public:
    181                         typedef Indexer Parent;
    182                         /// generate default/copy ctor and dtor calls for user-defined struct ctor/dtors
    183                         /// for any member that is missing a corresponding ctor/dtor call.
    184                         /// error if a member is used before constructed
    185                         static void generate( std::list< Declaration * > & translationUnit );
     180                        typedef Visitor Parent;
     181                        /// warn if a user-defined constructor or destructor is missing calls for
     182                        /// a struct member or if a member is used before constructed
     183                        static void warnings( std::list< Declaration * > & translationUnit );
    186184
    187185                        virtual void visit( FunctionDecl * funcDecl );
     
    190188                        virtual void visit( ApplicationExpr * appExpr );
    191189
    192                         SemanticError errors;
    193190                  private:
    194191                        void handleFirstParam( Expression * firstParam );
    195                         template< typename... Params >
    196                         void emit( const Params &... params );
    197192
    198193                        FunctionDecl * function = 0;
    199                         std::set< DeclarationWithType * > unhandled, usedUninit;
     194                        std::set< DeclarationWithType * > unhandled;
    200195                        ObjectDecl * thisParam = 0;
    201                         bool isCtor = false; // true if current function is a constructor
    202                         StructDecl * structDecl = 0;
    203                 };
    204 
    205                 // very simple resolver-like mutator class - used to
    206                 // resolve UntypedExprs that are found within newly
    207                 // generated constructor/destructor calls
    208                 class MutatingResolver : public Mutator {
    209                   public:
    210                         MutatingResolver( SymTab::Indexer & indexer ) : indexer( indexer ) {}
    211 
    212                         virtual DeclarationWithType* mutate( ObjectDecl *objectDecl );
    213 
    214                         virtual Expression* mutate( UntypedExpr *untypedExpr );
    215                         private:
    216                         SymTab::Indexer & indexer;
    217196                };
    218197        } // namespace
     
    230209                FixCopyCtors::fixCopyCtors( translationUnit );
    231210
    232                 GenStructMemberCalls::generate( translationUnit );
     211                WarnStructMembers::warnings( translationUnit );
    233212        }
    234213
     
    275254                }
    276255
    277                 void GenStructMemberCalls::generate( std::list< Declaration * > & translationUnit ) {
    278                         GenStructMemberCalls warner;
    279                         acceptAll( translationUnit, warner );
    280 
    281                         // visitor doesn't throw so that it can collect all errors
    282                         if ( ! warner.errors.isEmpty() ) {
    283                                 throw warner.errors;
     256                void WarnStructMembers::warnings( std::list< Declaration * > & translationUnit ) {
     257                        if ( true ) { // fix this condition to skip this pass if warnings aren't enabled
     258                                WarnStructMembers warner;
     259                                acceptAll( translationUnit, warner );
    284260                        }
    285261                }
     
    552528                                                        FunctionDecl * dtorCaller = new FunctionDecl( objDecl->get_mangleName() + dtorCallerNamer.newName(), DeclarationNode::Static, LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ), false, false );
    553529                                                        dtorCaller->fixUniqueId();
    554                                                         dtorCaller->get_statements()->push_back( dtorStmt );
     530                                                        dtorCaller->get_statements()->get_kids().push_back( dtorStmt );
    555531
    556532                                                        // atexit(dtor_atexit);
     
    567543                                                        // at global scope and there could be multiple function-scoped
    568544                                                        // static variables with the same name in different functions.
    569                                                         // Note: it isn't sufficient to modify only the mangleName, because
    570                                                         // then subsequent Indexer passes can choke on seeing the object's name
    571                                                         // if another object has the same name and type. An unfortunate side-effect
    572                                                         // of renaming the object is that subsequent NameExprs may fail to resolve,
    573                                                         // but there shouldn't be any remaining past this point.
    574545                                                        static UniqueName staticNamer( "_static_var" );
    575                                                         objDecl->set_name( objDecl->get_name() + staticNamer.newName() );
    576                                                         objDecl->set_mangleName( SymTab::Mangler::mangle( objDecl ) );
     546                                                        objDecl->set_mangleName( objDecl->get_mangleName() + staticNamer.newName() );
    577547
    578548                                                        objDecl->set_init( NULL );
     
    739709                }
    740710
    741                 void GenStructMemberCalls::visit( FunctionDecl * funcDecl ) {
    742                         ValueGuard< FunctionDecl * > oldFunction( funcDecl );
    743                         ValueGuard< std::set< DeclarationWithType * > > oldUnhandled( unhandled );
    744                         ValueGuard< std::set< DeclarationWithType * > > oldUsedUninit( usedUninit );
    745                         ValueGuard< ObjectDecl * > oldThisParam( thisParam );
    746                         ValueGuard< bool > oldIsCtor( isCtor );
    747                         ValueGuard< StructDecl * > oldStructDecl( structDecl );
    748 
    749                         // need to start with fresh sets
    750                         unhandled.clear();
    751                         usedUninit.clear();
     711                void WarnStructMembers::visit( FunctionDecl * funcDecl ) {
     712                        WarnStructMembers old = *this;
     713                        *this = WarnStructMembers();
    752714
    753715                        function = funcDecl;
    754                         isCtor = isConstructor( function->get_name() );
    755                         if ( checkWarnings( function ) ) {
    756                                 FunctionType * type = function->get_functionType();
     716                        if ( checkWarnings( funcDecl ) ) {
     717                                FunctionType * type = funcDecl->get_functionType();
    757718                                assert( ! type->get_parameters().empty() );
    758719                                thisParam = safe_dynamic_cast< ObjectDecl * >( type->get_parameters().front() );
     
    760721                                StructInstType * structType = dynamic_cast< StructInstType * >( ptrType->get_base() );
    761722                                if ( structType ) {
    762                                         structDecl = structType->get_baseStruct();
     723                                        StructDecl * structDecl = structType->get_baseStruct();
    763724                                        for ( Declaration * member : structDecl->get_members() ) {
    764725                                                if ( ObjectDecl * field = dynamic_cast< ObjectDecl * >( member ) ) {
     
    770731                                }
    771732                        }
    772                         Parent::visit( function );
    773 
    774                         // remove the unhandled objects from usedUninit, because a call is inserted
    775                         // to handle them - only objects that are later constructed are used uninitialized.
    776                         std::set< DeclarationWithType * > diff;
    777                         std::set_difference( usedUninit.begin(), usedUninit.end(), unhandled.begin(), unhandled.end(), std::inserter( diff, diff.begin() ) );
    778                         for ( DeclarationWithType * member : diff ) {
    779                                 emit( "in ", CodeGen::genType( function->get_functionType(), function->get_name(), false ), ", field ", member->get_name(), " used before being constructed" );
     733                        Parent::visit( funcDecl );
     734
     735                        for ( DeclarationWithType * member : unhandled ) {
     736                                // emit a warning for each unhandled member
     737                                warn( "in ", CodeGen::genType( function->get_functionType(), function->get_name(), false ), ", member ", member->get_name(), " may not have been ", isConstructor( funcDecl->get_name() ) ? "constructed" : "destructed" );
    780738                        }
    781739
    782                         if ( ! unhandled.empty() ) {
    783                                 // need to explicitly re-add function parameters in order to resolve copy constructors
    784                                 enterScope();
    785                                 maybeAccept( function->get_functionType(), *this );
    786 
    787                                 // need to iterate through members in reverse in order for
    788                                 // ctor/dtor statements to come out in the right order
    789                                 for ( Declaration * member : reverseIterate( structDecl->get_members() ) ) {
    790                                         DeclarationWithType * field = dynamic_cast< DeclarationWithType * >( member );
    791                                         // skip non-DWT members
    792                                         if ( ! field ) continue;
    793                                         // skip handled members
    794                                         if ( ! unhandled.count( field ) ) continue;
    795 
    796                                         // insert and resolve default/copy constructor call for each field that's unhandled
    797                                         std::list< Statement * > stmt;
    798                                         UntypedExpr * deref = new UntypedExpr( new NameExpr( "*?" ) );
    799                                         deref->get_args().push_back( new VariableExpr( thisParam ) );
    800 
    801                                         Expression * arg2 = 0;
    802                                         if ( isCopyConstructor( function ) ) {
    803                                                 // if copy ctor, need to pass second-param-of-this-function.field
    804                                                 std::list< DeclarationWithType * > & params = function->get_functionType()->get_parameters();
    805                                                 assert( params.size() == 2 );
    806                                                 arg2 = new MemberExpr( field, new VariableExpr( params.back() ) );
    807                                         }
    808                                         InitExpander srcParam( arg2 );
    809                                         SymTab::genImplicitCall( srcParam, new MemberExpr( field, deref ), function->get_name(), back_inserter( stmt ), field, isCtor );
    810 
    811                                         assert( stmt.size() <= 1 );
    812                                         if ( stmt.size() == 1 ) {
    813                                                 Statement * callStmt = stmt.front();
    814 
    815                                                 MutatingResolver resolver( *this );
    816                                                 try {
    817                                                         callStmt->acceptMutator( resolver );
    818                                                         if ( isCtor ) {
    819                                                                 function->get_statements()->push_front( callStmt );
    820                                                         } else {
    821                                                                 // destructor statements should be added at the end
    822                                                                 function->get_statements()->push_back( callStmt );
    823                                                         }
    824                                                 } catch ( SemanticError & error ) {
    825                                                         emit( "in ", CodeGen::genType( function->get_functionType(), function->get_name(), false ), ", field ", field->get_name(), " not explicitly ", isCtor ? "constructed" : "destructed",  " and no ", isCtor ? "default constructor" : "destructor", " found" );
    826                                                 }
    827                                         }
    828                                 }
    829                                 leaveScope();
    830                         }
    831                 }
    832 
    833                 void GenStructMemberCalls::visit( ApplicationExpr * appExpr ) {
     740                        *this = old;
     741                }
     742
     743                void WarnStructMembers::visit( ApplicationExpr * appExpr ) {
    834744                        if ( ! checkWarnings( function ) ) return;
    835745
     
    850760                                        handleFirstParam( firstParam );
    851761                                }
     762                        } else if ( fname == "?=?" && isIntrinsicCallExpr( appExpr ) ) {
     763                                // forgive use of intrinsic assignment to construct, since instrinsic constructors
     764                                // codegen as assignment anyway.
     765                                assert( appExpr->get_args().size() == 2 );
     766                                handleFirstParam( appExpr->get_args().front() );
    852767                        }
    853768
     
    855770                }
    856771
    857                 void GenStructMemberCalls::handleFirstParam( Expression * firstParam ) {
     772                void WarnStructMembers::handleFirstParam( Expression * firstParam ) {
    858773                        using namespace std;
    859774                        if ( AddressExpr * addrExpr = dynamic_cast< AddressExpr * >( firstParam ) ) {
     
    872787                }
    873788
    874                 void GenStructMemberCalls::visit( MemberExpr * memberExpr ) {
     789                void WarnStructMembers::visit( MemberExpr * memberExpr ) {
    875790                        if ( ! checkWarnings( function ) ) return;
    876                         if ( ! isCtor ) return;
     791                        if ( ! isConstructor( function->get_name() ) ) return;
    877792
    878793                        if ( ApplicationExpr * deref = dynamic_cast< ApplicationExpr * >( memberExpr->get_aggregate() ) ) {
     
    882797                                                        if ( unhandled.count( memberExpr->get_member() ) ) {
    883798                                                                // emit a warning because a member was used before it was constructed
    884                                                                 usedUninit.insert( memberExpr->get_member() );
     799                                                                warn( "in ", CodeGen::genType( function->get_functionType(), function->get_name(), false ), ", member ", memberExpr->get_member()->get_name(), " used before being constructed" );
    885800                                                        }
    886801                                                }
     
    890805                        Parent::visit( memberExpr );
    891806                }
    892 
    893                 template< typename Visitor, typename... Params >
    894                 void error( Visitor & v, const Params &... params ) {
    895                         v.errors.append( toString( params... ) );
    896                 }
    897 
    898                 template< typename... Params >
    899                 void GenStructMemberCalls::emit( const Params &... params ) {
    900                         // toggle warnings vs. errors here.
    901                         // warn( params... );
    902                         error( *this, params... );
    903                 }
    904 
    905                 DeclarationWithType * MutatingResolver::mutate( ObjectDecl *objectDecl ) {
    906                         // add object to the indexer assumes that there will be no name collisions
    907                         // in generated code. If this changes, add mutate methods for entities with
    908                         // scope and call {enter,leave}Scope explicitly.
    909                         objectDecl->accept( indexer );
    910                         return objectDecl;
    911                 }
    912 
    913                 Expression* MutatingResolver::mutate( UntypedExpr *untypedExpr ) {
    914                         return safe_dynamic_cast< ApplicationExpr * >( ResolvExpr::findVoidExpression( untypedExpr, indexer ) );
    915                 }
    916807        } // namespace
    917808} // namespace InitTweak
  • src/InitTweak/GenInit.cc

    r3403534 r28307be  
    2525#include "SynTree/Mutator.h"
    2626#include "SymTab/Autogen.h"
    27 #include "SymTab/Mangler.h"
    2827#include "GenPoly/PolyMutator.h"
    2928#include "GenPoly/DeclMutator.h"
    30 #include "GenPoly/ScopedSet.h"
    3129
    3230namespace InitTweak {
     
    5755        class CtorDtor : public GenPoly::PolyMutator {
    5856          public:
    59                 typedef GenPoly::PolyMutator Parent;
    60                 using Parent::mutate;
    6157                /// create constructor and destructor statements for object declarations.
    6258                /// the actual call statements will be added in after the resolver has run
     
    6965                // should not traverse into any of these declarations to find objects
    7066                // that need to be constructed or destructed
    71                 virtual Declaration* mutate( StructDecl *aggregateDecl );
     67                virtual Declaration* mutate( StructDecl *aggregateDecl ) { return aggregateDecl; }
    7268                virtual Declaration* mutate( UnionDecl *aggregateDecl ) { return aggregateDecl; }
    7369                virtual Declaration* mutate( EnumDecl *aggregateDecl ) { return aggregateDecl; }
     
    7874                virtual Type * mutate( FunctionType *funcType ) { return funcType; }
    7975
    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;
     76          protected:
    9177        };
    9278
     
    156142
    157143        DeclarationWithType* ReturnFixer::mutate( FunctionDecl *functionDecl ) {
    158                 ValueGuard< std::list<DeclarationWithType*> > oldReturnVals( returnVals );
    159                 ValueGuard< std::string > oldFuncName( funcName );
     144                std::list<DeclarationWithType*> oldReturnVals = returnVals;
     145                std::string oldFuncName = funcName;
    160146
    161147                FunctionType * type = functionDecl->get_functionType();
     
    163149                funcName = functionDecl->get_name();
    164150                DeclarationWithType * decl = Mutator::mutate( functionDecl );
     151                returnVals = oldReturnVals;
     152                funcName = oldFuncName;
    165153                return decl;
    166154        }
     
    209197
    210198        DeclarationWithType * HoistArrayDimension::mutate( FunctionDecl *functionDecl ) {
    211                 ValueGuard< bool > oldInFunc( inFunction );
     199                bool oldInFunc = inFunction;
    212200                inFunction = true;
    213201                DeclarationWithType * decl = Parent::mutate( functionDecl );
     202                inFunction = oldInFunc;
    214203                return decl;
    215204        }
     
    220209        }
    221210
    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 
    240211        DeclarationWithType * CtorDtor::mutate( ObjectDecl * 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 
     212                // hands off if designated, if @=, or if extern
     213                if ( tryConstruct( objDecl ) ) {
    249214                        // call into genImplicitCall from Autogen.h to generate calls to ctor/dtor
    250215                        // for each constructable object
     
    276241                        }
    277242                }
    278                 return Parent::mutate( objDecl );
     243                return Mutator::mutate( objDecl );
    279244        }
    280245
    281246        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                 }
    294247                // parameters should not be constructed and destructed, so don't mutate FunctionType
    295248                mutateAll( functionDecl->get_oldDecls(), *this );
    296249                functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) );
    297 
    298                 managedTypes.endScope();
    299250                return functionDecl;
    300251        }
    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 
    323252} // namespace InitTweak
    324253
  • src/InitTweak/InitTweak.cc

    r3403534 r28307be  
    77#include "SynTree/Attribute.h"
    88#include "GenPoly/GenPoly.h"
    9 #include "ResolvExpr/typeops.h"
    109
    1110namespace InitTweak {
     
    8079        public:
    8180                ExprImpl( Expression * expr ) : arg( expr ) {}
    82 
    83                 ~ExprImpl() { delete arg; }
    8481
    8582                virtual std::list< Expression * > next( std::list< Expression * > & indices ) {
     
    125122
    126123        void InitExpander::clearArrayIndices() {
    127                 deleteAll( indices );
    128124                indices.clear();
    129125        }
     
    232228                return ! LinkageSpec::isBuiltin( objDecl->get_linkage() ) &&
    233229                        (objDecl->get_init() == NULL ||
    234                                 ( objDecl->get_init() != NULL && objDecl->get_init()->get_maybeConstructed() ))
     230                                ( objDecl->get_init() != NULL && objDecl->get_init()->get_maybeConstructed() )) &&
     231                        ! isDesignated( objDecl->get_init() )
    235232                        && objDecl->get_storageClass() != DeclarationNode::Extern;
    236233        }
     
    390387                virtual void visit( ApplicationExpr *applicationExpr ) { isConstExpr = false; }
    391388                virtual void visit( UntypedExpr *untypedExpr ) { 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                 }
     389                virtual void visit( NameExpr *nameExpr ) { isConstExpr = false; }
     390                virtual void visit( CastExpr *castExpr ) { isConstExpr = false; }
    402391                virtual void visit( LabelAddressExpr *labAddressExpr ) { isConstExpr = false; }
    403392                virtual void visit( UntypedMemberExpr *memberExpr ) { isConstExpr = false; }
    404393                virtual void visit( MemberExpr *memberExpr ) { isConstExpr = false; }
    405394                virtual void visit( VariableExpr *variableExpr ) { isConstExpr = false; }
     395                virtual void visit( ConstantExpr *constantExpr ) { /* bottom out */ }
    406396                // these might be okay?
    407397                // virtual void visit( SizeofExpr *sizeofExpr );
     
    446436        bool isDestructor( const std::string & str ) { return str == "^?{}"; }
    447437        bool isCtorDtor( const std::string & str ) { return isConstructor( str ) || isDestructor( str ); }
    448 
    449         FunctionDecl * isCopyConstructor( Declaration * decl ) {
    450                 FunctionDecl * function = dynamic_cast< FunctionDecl * >( decl );
    451                 if ( ! function ) return 0;
    452                 if ( ! isConstructor( function->get_name() ) ) return 0;
    453                 FunctionType * ftype = function->get_functionType();
    454                 if ( ftype->get_parameters().size() != 2 ) return 0;
    455 
    456                 Type * t1 = ftype->get_parameters().front()->get_type();
    457                 Type * t2 = ftype->get_parameters().back()->get_type();
    458                 PointerType * ptrType = dynamic_cast< PointerType * > ( t1 );
    459                 assert( ptrType );
    460 
    461                 if ( ResolvExpr::typesCompatible( ptrType->get_base(), t2, SymTab::Indexer() ) ) {
    462                         return function;
    463                 } else {
    464                         return 0;
    465                 }
    466         }
    467438}
  • src/InitTweak/InitTweak.h

    r3403534 r28307be  
    2929        bool isDestructor( const std::string & );
    3030        bool isCtorDtor( const std::string & );
    31 
    32         FunctionDecl * isCopyConstructor( Declaration * decl );
    3331
    3432        /// transform Initializer into an argument list that can be passed to a call expression
  • src/Makefile.am

    r3403534 r28307be  
    2525# Is there a way to use a variable for the directory names?
    2626
     27include ArgTweak/module.mk
    2728include CodeGen/module.mk
    2829include Common/module.mk
    2930include ControlStruct/module.mk
     31include Designators/module.mk
    3032include GenPoly/module.mk
    3133include InitTweak/module.mk
  • src/Makefile.in

    r3403534 r28307be  
    2222###############################################################################
    2323
     24######################### -*- Mode: Makefile-Gmake -*- ########################
     25###############################################################################
     26
    2427#SRC +=  ArgTweak/Rewriter.cc \
    2528#       ArgTweak/Mutate.cc
     29
     30######################### -*- Mode: Makefile-Gmake -*- ########################
     31###############################################################################
    2632
    2733######################### -*- Mode: Makefile-Gmake -*- ########################
     
    6975PRE_UNINSTALL = :
    7076POST_UNINSTALL = :
    71 DIST_COMMON = $(srcdir)/CodeGen/module.mk $(srcdir)/Common/module.mk \
    72         $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk \
     77DIST_COMMON = $(srcdir)/ArgTweak/module.mk $(srcdir)/CodeGen/module.mk \
     78        $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk \
     79        $(srcdir)/Designators/module.mk $(srcdir)/GenPoly/module.mk \
    7380        $(srcdir)/InitTweak/module.mk $(srcdir)/Makefile.am \
    7481        $(srcdir)/Makefile.in $(srcdir)/Parser/module.mk \
     
    105112        ControlStruct/driver_cfa_cpp-ForExprMutator.$(OBJEXT) \
    106113        ControlStruct/driver_cfa_cpp-LabelTypeChecker.$(OBJEXT) \
     114        Designators/driver_cfa_cpp-Processor.$(OBJEXT) \
    107115        GenPoly/driver_cfa_cpp-Box.$(OBJEXT) \
    108116        GenPoly/driver_cfa_cpp-GenPoly.$(OBJEXT) \
     
    188196        SynTree/driver_cfa_cpp-TypeSubstitution.$(OBJEXT) \
    189197        SynTree/driver_cfa_cpp-Attribute.$(OBJEXT) \
     198        Tuples/driver_cfa_cpp-Mutate.$(OBJEXT) \
     199        Tuples/driver_cfa_cpp-AssignExpand.$(OBJEXT) \
     200        Tuples/driver_cfa_cpp-FunctionFixer.$(OBJEXT) \
    190201        Tuples/driver_cfa_cpp-TupleAssignment.$(OBJEXT) \
     202        Tuples/driver_cfa_cpp-FunctionChecker.$(OBJEXT) \
    191203        Tuples/driver_cfa_cpp-NameMatcher.$(OBJEXT)
    192204am_driver_cfa_cpp_OBJECTS = $(am__objects_1)
     
    362374        ControlStruct/MLEMutator.cc ControlStruct/Mutate.cc \
    363375        ControlStruct/ForExprMutator.cc \
    364         ControlStruct/LabelTypeChecker.cc GenPoly/Box.cc \
    365         GenPoly/GenPoly.cc GenPoly/PolyMutator.cc \
     376        ControlStruct/LabelTypeChecker.cc Designators/Processor.cc \
     377        GenPoly/Box.cc GenPoly/GenPoly.cc GenPoly/PolyMutator.cc \
    366378        GenPoly/ScrubTyVars.cc GenPoly/Lvalue.cc GenPoly/Specialize.cc \
    367379        GenPoly/CopyParams.cc GenPoly/FindFunction.cc \
     
    401413        SynTree/Initializer.cc SynTree/Visitor.cc SynTree/Mutator.cc \
    402414        SynTree/AddStmtVisitor.cc SynTree/TypeSubstitution.cc \
    403         SynTree/Attribute.cc Tuples/TupleAssignment.cc \
    404         Tuples/NameMatcher.cc
     415        SynTree/Attribute.cc Tuples/Mutate.cc Tuples/AssignExpand.cc \
     416        Tuples/FunctionFixer.cc Tuples/TupleAssignment.cc \
     417        Tuples/FunctionChecker.cc Tuples/NameMatcher.cc
    405418MAINTAINERCLEANFILES = Parser/parser.output ${libdir}/${notdir \
    406419        ${cfa_cpplib_PROGRAMS}}
     
    420433.SUFFIXES:
    421434.SUFFIXES: .cc .ll .o .obj .yy
    422 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/CodeGen/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(am__configure_deps)
     435$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/ArgTweak/module.mk $(srcdir)/CodeGen/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/Designators/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(am__configure_deps)
    423436        @for dep in $?; do \
    424437          case '$(am__configure_deps)' in \
     
    441454            cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
    442455        esac;
    443 $(srcdir)/CodeGen/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk:
     456$(srcdir)/ArgTweak/module.mk $(srcdir)/CodeGen/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/Designators/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk:
    444457
    445458$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
     
    540553        ControlStruct/$(am__dirstamp) \
    541554        ControlStruct/$(DEPDIR)/$(am__dirstamp)
     555Designators/$(am__dirstamp):
     556        @$(MKDIR_P) Designators
     557        @: > Designators/$(am__dirstamp)
     558Designators/$(DEPDIR)/$(am__dirstamp):
     559        @$(MKDIR_P) Designators/$(DEPDIR)
     560        @: > Designators/$(DEPDIR)/$(am__dirstamp)
     561Designators/driver_cfa_cpp-Processor.$(OBJEXT):  \
     562        Designators/$(am__dirstamp) \
     563        Designators/$(DEPDIR)/$(am__dirstamp)
    542564GenPoly/$(am__dirstamp):
    543565        @$(MKDIR_P) GenPoly
     
    767789        @$(MKDIR_P) Tuples/$(DEPDIR)
    768790        @: > Tuples/$(DEPDIR)/$(am__dirstamp)
     791Tuples/driver_cfa_cpp-Mutate.$(OBJEXT): Tuples/$(am__dirstamp) \
     792        Tuples/$(DEPDIR)/$(am__dirstamp)
     793Tuples/driver_cfa_cpp-AssignExpand.$(OBJEXT): Tuples/$(am__dirstamp) \
     794        Tuples/$(DEPDIR)/$(am__dirstamp)
     795Tuples/driver_cfa_cpp-FunctionFixer.$(OBJEXT): Tuples/$(am__dirstamp) \
     796        Tuples/$(DEPDIR)/$(am__dirstamp)
    769797Tuples/driver_cfa_cpp-TupleAssignment.$(OBJEXT):  \
     798        Tuples/$(am__dirstamp) Tuples/$(DEPDIR)/$(am__dirstamp)
     799Tuples/driver_cfa_cpp-FunctionChecker.$(OBJEXT):  \
    770800        Tuples/$(am__dirstamp) Tuples/$(DEPDIR)/$(am__dirstamp)
    771801Tuples/driver_cfa_cpp-NameMatcher.$(OBJEXT): Tuples/$(am__dirstamp) \
     
    794824        -rm -f ControlStruct/driver_cfa_cpp-MLEMutator.$(OBJEXT)
    795825        -rm -f ControlStruct/driver_cfa_cpp-Mutate.$(OBJEXT)
     826        -rm -f Designators/driver_cfa_cpp-Processor.$(OBJEXT)
    796827        -rm -f GenPoly/driver_cfa_cpp-Box.$(OBJEXT)
    797828        -rm -f GenPoly/driver_cfa_cpp-CopyParams.$(OBJEXT)
     
    877908        -rm -f SynTree/driver_cfa_cpp-Visitor.$(OBJEXT)
    878909        -rm -f SynTree/driver_cfa_cpp-VoidType.$(OBJEXT)
     910        -rm -f Tuples/driver_cfa_cpp-AssignExpand.$(OBJEXT)
     911        -rm -f Tuples/driver_cfa_cpp-FunctionChecker.$(OBJEXT)
     912        -rm -f Tuples/driver_cfa_cpp-FunctionFixer.$(OBJEXT)
     913        -rm -f Tuples/driver_cfa_cpp-Mutate.$(OBJEXT)
    879914        -rm -f Tuples/driver_cfa_cpp-NameMatcher.$(OBJEXT)
    880915        -rm -f Tuples/driver_cfa_cpp-TupleAssignment.$(OBJEXT)
     
    899934@AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-MLEMutator.Po@am__quote@
    900935@AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-Mutate.Po@am__quote@
     936@AMDEP_TRUE@@am__include@ @am__quote@Designators/$(DEPDIR)/driver_cfa_cpp-Processor.Po@am__quote@
    901937@AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-Box.Po@am__quote@
    902938@AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-CopyParams.Po@am__quote@
     
    9821018@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Visitor.Po@am__quote@
    9831019@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-VoidType.Po@am__quote@
     1020@AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-AssignExpand.Po@am__quote@
     1021@AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-FunctionChecker.Po@am__quote@
     1022@AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-FunctionFixer.Po@am__quote@
     1023@AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-Mutate.Po@am__quote@
    9841024@AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-NameMatcher.Po@am__quote@
    9851025@AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-TupleAssignment.Po@am__quote@
     
    12251265@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ControlStruct/driver_cfa_cpp-LabelTypeChecker.obj `if test -f 'ControlStruct/LabelTypeChecker.cc'; then $(CYGPATH_W) 'ControlStruct/LabelTypeChecker.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/LabelTypeChecker.cc'; fi`
    12261266
     1267Designators/driver_cfa_cpp-Processor.o: Designators/Processor.cc
     1268@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Designators/driver_cfa_cpp-Processor.o -MD -MP -MF Designators/$(DEPDIR)/driver_cfa_cpp-Processor.Tpo -c -o Designators/driver_cfa_cpp-Processor.o `test -f 'Designators/Processor.cc' || echo '$(srcdir)/'`Designators/Processor.cc
     1269@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) Designators/$(DEPDIR)/driver_cfa_cpp-Processor.Tpo Designators/$(DEPDIR)/driver_cfa_cpp-Processor.Po
     1270@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='Designators/Processor.cc' object='Designators/driver_cfa_cpp-Processor.o' libtool=no @AMDEPBACKSLASH@
     1271@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1272@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Designators/driver_cfa_cpp-Processor.o `test -f 'Designators/Processor.cc' || echo '$(srcdir)/'`Designators/Processor.cc
     1273
     1274Designators/driver_cfa_cpp-Processor.obj: Designators/Processor.cc
     1275@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Designators/driver_cfa_cpp-Processor.obj -MD -MP -MF Designators/$(DEPDIR)/driver_cfa_cpp-Processor.Tpo -c -o Designators/driver_cfa_cpp-Processor.obj `if test -f 'Designators/Processor.cc'; then $(CYGPATH_W) 'Designators/Processor.cc'; else $(CYGPATH_W) '$(srcdir)/Designators/Processor.cc'; fi`
     1276@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) Designators/$(DEPDIR)/driver_cfa_cpp-Processor.Tpo Designators/$(DEPDIR)/driver_cfa_cpp-Processor.Po
     1277@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='Designators/Processor.cc' object='Designators/driver_cfa_cpp-Processor.obj' libtool=no @AMDEPBACKSLASH@
     1278@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1279@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Designators/driver_cfa_cpp-Processor.obj `if test -f 'Designators/Processor.cc'; then $(CYGPATH_W) 'Designators/Processor.cc'; else $(CYGPATH_W) '$(srcdir)/Designators/Processor.cc'; fi`
     1280
    12271281GenPoly/driver_cfa_cpp-Box.o: GenPoly/Box.cc
    12281282@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-Box.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-Box.Tpo -c -o GenPoly/driver_cfa_cpp-Box.o `test -f 'GenPoly/Box.cc' || echo '$(srcdir)/'`GenPoly/Box.cc
     
    23872441@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-Attribute.obj `if test -f 'SynTree/Attribute.cc'; then $(CYGPATH_W) 'SynTree/Attribute.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Attribute.cc'; fi`
    23882442
     2443Tuples/driver_cfa_cpp-Mutate.o: Tuples/Mutate.cc
     2444@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Tuples/driver_cfa_cpp-Mutate.o -MD -MP -MF Tuples/$(DEPDIR)/driver_cfa_cpp-Mutate.Tpo -c -o Tuples/driver_cfa_cpp-Mutate.o `test -f 'Tuples/Mutate.cc' || echo '$(srcdir)/'`Tuples/Mutate.cc
     2445@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) Tuples/$(DEPDIR)/driver_cfa_cpp-Mutate.Tpo Tuples/$(DEPDIR)/driver_cfa_cpp-Mutate.Po
     2446@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='Tuples/Mutate.cc' object='Tuples/driver_cfa_cpp-Mutate.o' libtool=no @AMDEPBACKSLASH@
     2447@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     2448@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Tuples/driver_cfa_cpp-Mutate.o `test -f 'Tuples/Mutate.cc' || echo '$(srcdir)/'`Tuples/Mutate.cc
     2449
     2450Tuples/driver_cfa_cpp-Mutate.obj: Tuples/Mutate.cc
     2451@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Tuples/driver_cfa_cpp-Mutate.obj -MD -MP -MF Tuples/$(DEPDIR)/driver_cfa_cpp-Mutate.Tpo -c -o Tuples/driver_cfa_cpp-Mutate.obj `if test -f 'Tuples/Mutate.cc'; then $(CYGPATH_W) 'Tuples/Mutate.cc'; else $(CYGPATH_W) '$(srcdir)/Tuples/Mutate.cc'; fi`
     2452@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) Tuples/$(DEPDIR)/driver_cfa_cpp-Mutate.Tpo Tuples/$(DEPDIR)/driver_cfa_cpp-Mutate.Po
     2453@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='Tuples/Mutate.cc' object='Tuples/driver_cfa_cpp-Mutate.obj' libtool=no @AMDEPBACKSLASH@
     2454@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     2455@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Tuples/driver_cfa_cpp-Mutate.obj `if test -f 'Tuples/Mutate.cc'; then $(CYGPATH_W) 'Tuples/Mutate.cc'; else $(CYGPATH_W) '$(srcdir)/Tuples/Mutate.cc'; fi`
     2456
     2457Tuples/driver_cfa_cpp-AssignExpand.o: Tuples/AssignExpand.cc
     2458@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Tuples/driver_cfa_cpp-AssignExpand.o -MD -MP -MF Tuples/$(DEPDIR)/driver_cfa_cpp-AssignExpand.Tpo -c -o Tuples/driver_cfa_cpp-AssignExpand.o `test -f 'Tuples/AssignExpand.cc' || echo '$(srcdir)/'`Tuples/AssignExpand.cc
     2459@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) Tuples/$(DEPDIR)/driver_cfa_cpp-AssignExpand.Tpo Tuples/$(DEPDIR)/driver_cfa_cpp-AssignExpand.Po
     2460@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='Tuples/AssignExpand.cc' object='Tuples/driver_cfa_cpp-AssignExpand.o' libtool=no @AMDEPBACKSLASH@
     2461@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     2462@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Tuples/driver_cfa_cpp-AssignExpand.o `test -f 'Tuples/AssignExpand.cc' || echo '$(srcdir)/'`Tuples/AssignExpand.cc
     2463
     2464Tuples/driver_cfa_cpp-AssignExpand.obj: Tuples/AssignExpand.cc
     2465@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Tuples/driver_cfa_cpp-AssignExpand.obj -MD -MP -MF Tuples/$(DEPDIR)/driver_cfa_cpp-AssignExpand.Tpo -c -o Tuples/driver_cfa_cpp-AssignExpand.obj `if test -f 'Tuples/AssignExpand.cc'; then $(CYGPATH_W) 'Tuples/AssignExpand.cc'; else $(CYGPATH_W) '$(srcdir)/Tuples/AssignExpand.cc'; fi`
     2466@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) Tuples/$(DEPDIR)/driver_cfa_cpp-AssignExpand.Tpo Tuples/$(DEPDIR)/driver_cfa_cpp-AssignExpand.Po
     2467@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='Tuples/AssignExpand.cc' object='Tuples/driver_cfa_cpp-AssignExpand.obj' libtool=no @AMDEPBACKSLASH@
     2468@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     2469@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Tuples/driver_cfa_cpp-AssignExpand.obj `if test -f 'Tuples/AssignExpand.cc'; then $(CYGPATH_W) 'Tuples/AssignExpand.cc'; else $(CYGPATH_W) '$(srcdir)/Tuples/AssignExpand.cc'; fi`
     2470
     2471Tuples/driver_cfa_cpp-FunctionFixer.o: Tuples/FunctionFixer.cc
     2472@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Tuples/driver_cfa_cpp-FunctionFixer.o -MD -MP -MF Tuples/$(DEPDIR)/driver_cfa_cpp-FunctionFixer.Tpo -c -o Tuples/driver_cfa_cpp-FunctionFixer.o `test -f 'Tuples/FunctionFixer.cc' || echo '$(srcdir)/'`Tuples/FunctionFixer.cc
     2473@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) Tuples/$(DEPDIR)/driver_cfa_cpp-FunctionFixer.Tpo Tuples/$(DEPDIR)/driver_cfa_cpp-FunctionFixer.Po
     2474@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='Tuples/FunctionFixer.cc' object='Tuples/driver_cfa_cpp-FunctionFixer.o' libtool=no @AMDEPBACKSLASH@
     2475@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     2476@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Tuples/driver_cfa_cpp-FunctionFixer.o `test -f 'Tuples/FunctionFixer.cc' || echo '$(srcdir)/'`Tuples/FunctionFixer.cc
     2477
     2478Tuples/driver_cfa_cpp-FunctionFixer.obj: Tuples/FunctionFixer.cc
     2479@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Tuples/driver_cfa_cpp-FunctionFixer.obj -MD -MP -MF Tuples/$(DEPDIR)/driver_cfa_cpp-FunctionFixer.Tpo -c -o Tuples/driver_cfa_cpp-FunctionFixer.obj `if test -f 'Tuples/FunctionFixer.cc'; then $(CYGPATH_W) 'Tuples/FunctionFixer.cc'; else $(CYGPATH_W) '$(srcdir)/Tuples/FunctionFixer.cc'; fi`
     2480@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) Tuples/$(DEPDIR)/driver_cfa_cpp-FunctionFixer.Tpo Tuples/$(DEPDIR)/driver_cfa_cpp-FunctionFixer.Po
     2481@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='Tuples/FunctionFixer.cc' object='Tuples/driver_cfa_cpp-FunctionFixer.obj' libtool=no @AMDEPBACKSLASH@
     2482@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     2483@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Tuples/driver_cfa_cpp-FunctionFixer.obj `if test -f 'Tuples/FunctionFixer.cc'; then $(CYGPATH_W) 'Tuples/FunctionFixer.cc'; else $(CYGPATH_W) '$(srcdir)/Tuples/FunctionFixer.cc'; fi`
     2484
    23892485Tuples/driver_cfa_cpp-TupleAssignment.o: Tuples/TupleAssignment.cc
    23902486@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Tuples/driver_cfa_cpp-TupleAssignment.o -MD -MP -MF Tuples/$(DEPDIR)/driver_cfa_cpp-TupleAssignment.Tpo -c -o Tuples/driver_cfa_cpp-TupleAssignment.o `test -f 'Tuples/TupleAssignment.cc' || echo '$(srcdir)/'`Tuples/TupleAssignment.cc
     
    24002496@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    24012497@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Tuples/driver_cfa_cpp-TupleAssignment.obj `if test -f 'Tuples/TupleAssignment.cc'; then $(CYGPATH_W) 'Tuples/TupleAssignment.cc'; else $(CYGPATH_W) '$(srcdir)/Tuples/TupleAssignment.cc'; fi`
     2498
     2499Tuples/driver_cfa_cpp-FunctionChecker.o: Tuples/FunctionChecker.cc
     2500@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Tuples/driver_cfa_cpp-FunctionChecker.o -MD -MP -MF Tuples/$(DEPDIR)/driver_cfa_cpp-FunctionChecker.Tpo -c -o Tuples/driver_cfa_cpp-FunctionChecker.o `test -f 'Tuples/FunctionChecker.cc' || echo '$(srcdir)/'`Tuples/FunctionChecker.cc
     2501@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) Tuples/$(DEPDIR)/driver_cfa_cpp-FunctionChecker.Tpo Tuples/$(DEPDIR)/driver_cfa_cpp-FunctionChecker.Po
     2502@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='Tuples/FunctionChecker.cc' object='Tuples/driver_cfa_cpp-FunctionChecker.o' libtool=no @AMDEPBACKSLASH@
     2503@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     2504@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Tuples/driver_cfa_cpp-FunctionChecker.o `test -f 'Tuples/FunctionChecker.cc' || echo '$(srcdir)/'`Tuples/FunctionChecker.cc
     2505
     2506Tuples/driver_cfa_cpp-FunctionChecker.obj: Tuples/FunctionChecker.cc
     2507@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Tuples/driver_cfa_cpp-FunctionChecker.obj -MD -MP -MF Tuples/$(DEPDIR)/driver_cfa_cpp-FunctionChecker.Tpo -c -o Tuples/driver_cfa_cpp-FunctionChecker.obj `if test -f 'Tuples/FunctionChecker.cc'; then $(CYGPATH_W) 'Tuples/FunctionChecker.cc'; else $(CYGPATH_W) '$(srcdir)/Tuples/FunctionChecker.cc'; fi`
     2508@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) Tuples/$(DEPDIR)/driver_cfa_cpp-FunctionChecker.Tpo Tuples/$(DEPDIR)/driver_cfa_cpp-FunctionChecker.Po
     2509@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='Tuples/FunctionChecker.cc' object='Tuples/driver_cfa_cpp-FunctionChecker.obj' libtool=no @AMDEPBACKSLASH@
     2510@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     2511@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Tuples/driver_cfa_cpp-FunctionChecker.obj `if test -f 'Tuples/FunctionChecker.cc'; then $(CYGPATH_W) 'Tuples/FunctionChecker.cc'; else $(CYGPATH_W) '$(srcdir)/Tuples/FunctionChecker.cc'; fi`
    24022512
    24032513Tuples/driver_cfa_cpp-NameMatcher.o: Tuples/NameMatcher.cc
     
    25442654        -rm -f ControlStruct/$(DEPDIR)/$(am__dirstamp)
    25452655        -rm -f ControlStruct/$(am__dirstamp)
     2656        -rm -f Designators/$(DEPDIR)/$(am__dirstamp)
     2657        -rm -f Designators/$(am__dirstamp)
    25462658        -rm -f GenPoly/$(DEPDIR)/$(am__dirstamp)
    25472659        -rm -f GenPoly/$(am__dirstamp)
     
    25732685
    25742686distclean: distclean-am
    2575         -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) Common/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR)
     2687        -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) Common/$(DEPDIR) ControlStruct/$(DEPDIR) Designators/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR)
    25762688        -rm -f Makefile
    25772689distclean-am: clean-am distclean-compile distclean-generic \
     
    26192731
    26202732maintainer-clean: maintainer-clean-am
    2621         -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) Common/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR)
     2733        -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) Common/$(DEPDIR) ControlStruct/$(DEPDIR) Designators/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR)
    26222734        -rm -f Makefile
    26232735maintainer-clean-am: distclean-am maintainer-clean-generic
     
    26542766
    26552767
     2768#SRC +=  ArgTweak/Rewriter.cc \
     2769#       ArgTweak/Mutate.cc
     2770
     2771#       Tuples/MultipleAssign.cc \
     2772#       Tuples/FlattenTuple.cc \
     2773#       Tuples/MultRet.cc \
     2774#       Tuples/FixReturn.cc \
     2775#       Tuples/MassAssignment.cc \
     2776#       Tuples/TupleFixer.cc
     2777
    26562778# Tell versions [3.59,3.63) of GNU make to not export all variables.
    26572779# Otherwise a system limit (for SysV at least) may be exceeded.
  • src/Parser/ParseNode.cc

    r3403534 r28307be  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // ParseNode.cc --
     7// ParseNode.cc -- 
    88//
    99// Author           : Rodolfo G. Esteves
     
    1212// Last Modified On : Wed Aug 17 23:14:16 2016
    1313// Update Count     : 126
    14 //
     14// 
    1515
    1616#include "ParseNode.h"
     
    1919int ParseNode::indent_by = 4;
    2020
    21 std::ostream & operator<<( std::ostream & out, const ParseNode * node ) {
    22   node->print( out );
    23   return out;
    24 }
    25 
    2621// Local Variables: //
    2722// tab-width: 4 //
  • src/Parser/ParseNode.h

    r3403534 r28307be  
    431431}
    432432
    433 // in ParseNode.cc
    434 std::ostream & operator<<( std::ostream & out, const ParseNode * node );
    435433
    436434#endif // PARSENODE_H
  • src/ResolvExpr/AlternativeFinder.cc

    r3403534 r28307be  
    3838#include "SynTree/TypeSubstitution.h"
    3939#include "SymTab/Validate.h"
     40#include "Designators/Processor.h"
    4041#include "Tuples/TupleAssignment.h"
    4142#include "Tuples/NameMatcher.h"
    4243#include "Common/utility.h"
    4344#include "InitTweak/InitTweak.h"
    44 #include "ResolveTypeof.h"
    4545
    4646extern bool resolvep;
     
    708708        void AlternativeFinder::visit( CastExpr *castExpr ) {
    709709                for ( std::list< Type* >::iterator i = castExpr->get_results().begin(); i != castExpr->get_results().end(); ++i ) {
    710                         *i = resolveTypeof( *i, indexer );
    711710                        SymTab::validateType( *i, &indexer );
    712711                        adjustExprType( *i, env, indexer );
     
    797796
    798797        void AlternativeFinder::visit( VariableExpr *variableExpr ) {
    799                 // not sufficient to clone here, because variable's type may have changed
    800                 // since the VariableExpr was originally created.
    801                 alternatives.push_back( Alternative( new VariableExpr( variableExpr->get_var() ), env, Cost::zero ) );
     798                alternatives.push_back( Alternative( variableExpr->clone(), env, Cost::zero ) );
    802799        }
    803800
     
    808805        void AlternativeFinder::visit( SizeofExpr *sizeofExpr ) {
    809806                if ( sizeofExpr->get_isType() ) {
    810                         // xxx - resolveTypeof?
    811807                        alternatives.push_back( Alternative( sizeofExpr->clone(), env, Cost::zero ) );
    812808                } else {
     
    828824        void AlternativeFinder::visit( AlignofExpr *alignofExpr ) {
    829825                if ( alignofExpr->get_isType() ) {
    830                         // xxx - resolveTypeof?
    831826                        alternatives.push_back( Alternative( alignofExpr->clone(), env, Cost::zero ) );
    832827                } else {
     
    862857        void AlternativeFinder::visit( UntypedOffsetofExpr *offsetofExpr ) {
    863858                AlternativeFinder funcFinder( indexer, env );
    864                 // xxx - resolveTypeof?
    865859                if ( StructInstType *structInst = dynamic_cast< StructInstType* >( offsetofExpr->get_type() ) ) {
    866860                        addOffsetof( structInst, offsetofExpr->get_member() );
  • src/ResolvExpr/Resolver.cc

    r3403534 r28307be  
    528528
    529529        void Resolver::visit( ConstructorInit *ctorInit ) {
    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 );
     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                }
    533539
    534540                // found a constructor - can get rid of C-style initializer
  • src/SymTab/Autogen.cc

    r3403534 r28307be  
    6464
    6565        template< typename OutputIterator >
    66         void makeUnionFieldsAssignment( ObjectDecl *srcParam, ObjectDecl *dstParam, OutputIterator out ) {
     66        void makeUnionFieldsAssignment( ObjectDecl *srcParam, ObjectDecl *dstParam, UnionInstType *unionType, OutputIterator out ) {
    6767                UntypedExpr *copy = new UntypedExpr( new NameExpr( "__builtin_memcpy" ) );
    6868                copy->get_args().push_back( new VariableExpr( dstParam ) );
     
    413413                dtorDecl->fixUniqueId();
    414414
    415                 makeUnionFieldsAssignment( srcParam, dstParam, back_inserter( assignDecl->get_statements()->get_kids() ) );
    416                 if ( isDynamicLayout ) makeUnionFieldsAssignment( srcParam, returnVal, back_inserter( assignDecl->get_statements()->get_kids() ) );
     415                makeUnionFieldsAssignment( srcParam, dstParam, cloneWithParams( refType, unionParams ), back_inserter( assignDecl->get_statements()->get_kids() ) );
     416                if ( isDynamicLayout ) makeUnionFieldsAssignment( srcParam, returnVal, cloneWithParams( refType, unionParams ), back_inserter( assignDecl->get_statements()->get_kids() ) );
    417417                else assignDecl->get_statements()->get_kids().push_back( new ReturnStmt( noLabels, new VariableExpr( srcParam ) ) );
    418418
     
    434434                                ctor->fixUniqueId();
    435435
    436                                 makeUnionFieldsAssignment( srcParam, dstParam, back_inserter( ctor->get_statements()->get_kids() ) );
     436                                makeUnionFieldsAssignment( srcParam, dstParam, cloneWithParams( refType, unionParams ), back_inserter( ctor->get_statements()->get_kids() ) );
    437437                                memCtors.push_back( ctor );
    438438                                // only generate a ctor for the first field
  • src/SymTab/Autogen.h

    r3403534 r28307be  
    102102                }
    103103
    104                 ObjectDecl *index = new ObjectDecl( indexName.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), new SingleInit( begin, std::list<Expression*>() ) );
     104                ObjectDecl *index = new ObjectDecl( indexName.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), NULL );
     105
     106                UntypedExpr *init = new UntypedExpr( new NameExpr( "?=?" ) );
     107                init->get_args().push_back( new AddressExpr( new VariableExpr( index ) ) );
     108                init->get_args().push_back( begin );
     109                index->set_init( new SingleInit( init, std::list<Expression*>() ) );
    105110
    106111                UntypedExpr *cond = new UntypedExpr( cmp );
  • src/SymTab/Indexer.cc

    r3403534 r28307be  
    2121#include <unordered_set>
    2222#include <utility>
    23 #include <algorithm>
    2423
    2524#include "Mangler.h"
     
    3433#include "SynTree/Initializer.h"
    3534#include "SynTree/Statement.h"
    36 
    37 #include "InitTweak/InitTweak.h"
    3835
    3936#define debugPrint(x) if ( doDebug ) { std::cout << x; }
     
    104101        }
    105102
    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                 }
    166         }
    167 
    168103        void Indexer::makeWritable() {
    169104                if ( ! tables ) {
     
    526461                        searchTables = searchTables->base.tables;
    527462                }
    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 );
    533463        }
    534464
  • src/SymTab/Indexer.h

    r3403534 r28307be  
    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 
    135130                /// Ensures that tables variable is writable (i.e. allocated, uniquely owned by this Indexer, and at the current scope)
    136131                void makeWritable();
  • src/SymTab/Validate.cc

    r3403534 r28307be  
    8686
    8787        /// Replaces enum types by int, and function or array types in function parameter and return lists by appropriate pointers.
    88         class EnumAndPointerDecayPass : public Visitor {
     88        class Pass1 : public Visitor {
    8989                typedef Visitor Parent;
    9090                virtual void visit( EnumDecl *aggregateDecl );
     
    189189
    190190        void validate( std::list< Declaration * > &translationUnit, bool doDebug ) {
    191                 EnumAndPointerDecayPass epc;
     191                Pass1 pass1;
    192192                Pass2 pass2( doDebug, 0 );
    193193                Pass3 pass3( 0 );
     
    196196                EliminateTypedef::eliminateTypedef( translationUnit );
    197197                HoistStruct::hoistStruct( translationUnit );
    198                 autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecayPass
    199                 acceptAll( translationUnit, epc );
     198                autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs Pass1
     199                acceptAll( translationUnit, pass1 );
    200200                acceptAll( translationUnit, pass2 );
    201201                ReturnChecker::checkFunctionReturns( translationUnit );
     
    206206
    207207        void validateType( Type *type, const Indexer *indexer ) {
    208                 EnumAndPointerDecayPass epc;
     208                Pass1 pass1;
    209209                Pass2 pass2( false, indexer );
    210210                Pass3 pass3( indexer );
    211                 type->accept( epc );
     211                type->accept( pass1 );
    212212                type->accept( pass2 );
    213213                type->accept( pass3 );
     
    272272        }
    273273
    274         void EnumAndPointerDecayPass::visit( EnumDecl *enumDecl ) {
     274        void Pass1::visit( EnumDecl *enumDecl ) {
    275275                // Set the type of each member of the enumeration to be EnumConstant
    276276                for ( std::list< Declaration * >::iterator i = enumDecl->get_members().begin(); i != enumDecl->get_members().end(); ++i ) {
     
    296296                                DWTIterator j = i;
    297297                                ++i;
    298                                 delete *j;
    299298                                dwts.erase( j );
    300299                                if ( i != end ) {
     
    314313        }
    315314
    316         void EnumAndPointerDecayPass::visit( FunctionType *func ) {
     315        void Pass1::visit( FunctionType *func ) {
    317316                // Fix up parameters and return types
    318317                fixFunctionList( func->get_parameters(), func );
  • src/SynTree/Declaration.cc

    r3403534 r28307be  
    5656}
    5757
    58 std::ostream & operator<<( std::ostream & out, const Declaration * decl ) {
     58std::ostream & operator<<( std::ostream & out, Declaration * decl ) {
    5959        decl->print( out );
    6060        return out;
  • src/SynTree/Declaration.h

    r3403534 r28307be  
    279279};
    280280
    281 std::ostream & operator<<( std::ostream & out, const Declaration * decl );
     281std::ostream & operator<<( std::ostream & out, Declaration * decl );
    282282
    283283#endif // DECLARATION_H
  • src/SynTree/Expression.cc

    r3403534 r28307be  
    358358        assert( member );
    359359        os << std::string( indent + 2, ' ' );
     360        os << (void*)member << " ";
    360361        member->print( os, indent + 2 );
    361362        os << std::endl;
     
    540541}
    541542
    542 std::ostream & operator<<( std::ostream & out, const Expression * expr ) {
     543std::ostream & operator<<( std::ostream & out, Expression * expr ) {
    543544        expr->print( out );
    544545        return out;
  • src/SynTree/Expression.h

    r3403534 r28307be  
    653653};
    654654
    655 std::ostream & operator<<( std::ostream & out, const Expression * expr );
     655std::ostream & operator<<( std::ostream & out, Expression * expr );
    656656
    657657#endif // EXPRESSION_H
  • src/SynTree/FunctionDecl.cc

    r3403534 r28307be  
    2121#include "Attribute.h"
    2222#include "Common/utility.h"
    23 #include "InitTweak/InitTweak.h"
    2423
    2524FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, std::list< Attribute * > attributes )
  • src/SynTree/Statement.cc

    r3403534 r28307be  
    387387}
    388388
    389 std::ostream & operator<<( std::ostream & out, const Statement * statement ) {
     389std::ostream & operator<<( std::ostream & out, Statement * statement ) {
    390390        statement->print( out );
    391391        return out;
  • src/SynTree/Statement.h

    r3403534 r28307be  
    4747
    4848        std::list<Statement*>& get_kids() { return kids; }
    49         void push_back( Statement * stmt ) { kids.push_back( stmt ); }
    50         void push_front( Statement * stmt ) { kids.push_front( stmt ); }
    5149
    5250        virtual CompoundStmt *clone() const { return new CompoundStmt( *this ); }
     
    397395
    398396
    399 std::ostream & operator<<( std::ostream & out, const Statement * statement );
     397std::ostream & operator<<( std::ostream & out, Statement * statement );
    400398
    401399#endif // STATEMENT_H
  • src/SynTree/Type.cc

    r3403534 r28307be  
    8484}
    8585
    86 std::ostream & operator<<( std::ostream & out, const Type * type ) {
     86std::ostream & operator<<( std::ostream & out, Type * type ) {
    8787        type->print( out );
    8888        return out;
  • src/SynTree/Type.h

    r3403534 r28307be  
    481481}
    482482
    483 std::ostream & operator<<( std::ostream & out, const Type * type );
     483std::ostream & operator<<( std::ostream & out, Type * type );
    484484
    485485#endif // TYPE_H
  • src/Tuples/module.mk

    r3403534 r28307be  
    1515###############################################################################
    1616
    17 SRC +=  Tuples/TupleAssignment.cc \
     17SRC +=  Tuples/Mutate.cc \
     18        Tuples/AssignExpand.cc \
     19        Tuples/FunctionFixer.cc \
     20        Tuples/TupleAssignment.cc \
     21        Tuples/FunctionChecker.cc \
    1822        Tuples/NameMatcher.cc
     23
     24#       Tuples/MultipleAssign.cc \
     25#       Tuples/FlattenTuple.cc \
     26#       Tuples/MultRet.cc \
     27#       Tuples/FixReturn.cc \
     28#       Tuples/MassAssignment.cc \
     29#       Tuples/TupleFixer.cc
  • src/tests/.expect/64/declarationSpecifier.txt

    r3403534 r28307be  
    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

    r3403534 r28307be  
    8686        __extension__ int __c__i_2;
    8787    };
    88     int __i__i_2 = ((int )(__extension__ __a__i_1+__extension__ 3));
     88    int __i__i_2;
     89    ((void)((*((int *)(&__i__i_2)))=(__extension__ __a__i_1+__extension__ 3)) /* ?{} */);
    8990    ((void)__extension__ 3);
    9091    ((void)__extension__ __a__i_1);
  • src/tests/.expect/64/gccExtensions.txt

    r3403534 r28307be  
    7676        ((void)((*((int *)(&(*___dst__P2sS_2).__c__i_2)))=__c__i_2) /* ?{} */);
    7777    }
    78     int __i__i_2 = ((int )__extension__ 3);
     78    int __i__i_2;
     79    ((void)((*((int *)(&__i__i_2)))=__extension__ 3) /* ?{} */);
    7980    __extension__ int __a__i_2;
    8081    __extension__ int __b__i_2;
     
    132133    }
    133134    struct s3 __x1__3ss3_2;
     135    ((void)___constructor__F_P3ss3_autogen___2(((struct s3 *)(&__x1__3ss3_2))));
    134136    struct s3 __y1__3ss3_2;
     137    ((void)___constructor__F_P3ss3_autogen___2(((struct s3 *)(&__y1__3ss3_2))));
    135138    struct s4 {
    136139        int __i__i_2;
     
    138141    inline struct s4 ___operator_assign__F3ss4_P3ss43ss4_autogen___2(struct s4 *___dst__P3ss4_2, struct s4 ___src__3ss4_2){
    139142        ((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))));
    140145        return ((struct s4 )___src__3ss4_2);
    141146    }
     
    153158    }
    154159    struct s4 __x2__3ss4_2;
     160    ((void)___constructor__F_P3ss4_autogen___2(((struct s4 *)(&__x2__3ss4_2))));
    155161    struct s4 __y2__3ss4_2;
     162    ((void)___constructor__F_P3ss4_autogen___2(((struct s4 *)(&__y2__3ss4_2))));
    156163    int __m1__A0i_2[((long unsigned int )10)];
    157164    int __m2__A0A0i_2[((long unsigned int )10)][((long unsigned int )10)];
     
    159166    int _retVal0 = { 0 };
    160167    ((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))));
    161172    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))));
    162177}
  • src/tests/Makefile.am

    r3403534 r28307be  
    6262        ${CC} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
    6363
    64 memberCtors-ERR1: memberCtors.c
    65         ${CC} ${CFALGS} -DERR1 ${<} -o ${@}
     64ctorWarnings: ctorWarnings.c
     65        ${CC} ${CFALGS} -CFA -XCFA -p ${<} -o /dev/null 2> ${@}
    6666
  • src/tests/Makefile.in

    r3403534 r28307be  
    670670        ${CC} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@}
    671671
    672 memberCtors-ERR1: memberCtors.c
    673         ${CC} ${CFALGS} -DERR1 ${<} -o ${@}
     672ctorWarnings: ctorWarnings.c
     673        ${CC} ${CFALGS} -CFA -XCFA -p ${<} -o /dev/null 2> ${@}
    674674
    675675# Tell versions [3.59,3.63) of GNU make to not export all variables.
  • src/tests/test.py

    r3403534 r28307be  
    22from __future__ import print_function
    33
    4 from functools import partial
    5 from multiprocessing import Pool
    64from os import listdir, environ
    75from os.path import isfile, join, splitext
     
    104102#               running test functions
    105103################################################################################
    106 def run_single_test(test, generate, dry_run):
     104def run_test_instance(test, generate, dry_run):
    107105
    108106        # find the output file based on the test name and options flag
     
    165163        return retcode, error
    166164
    167 def run_test_instance(t, generate, dry_run) :
    168         # print formated name
    169         name_txt = "%20s  " % t.name
    170 
    171         #run the test instance and collect the result
    172         test_failed, error = run_single_test(t, generate, dry_run)
    173 
    174         # update output based on current action
    175         if generate :
    176                 failed_txt = "ERROR"
    177                 success_txt = "Done"
    178         else :
    179                 failed_txt = "FAILED"
    180                 success_txt = "PASSED"
    181 
    182         #print result with error if needed
    183         text = name_txt + (failed_txt if test_failed else success_txt)
    184         out = sys.stdout
    185         if error :
    186                 text = text + "\n" + error
    187                 out = sys.stderr
    188 
    189         print(text, file = out);
    190         sys.stdout.flush()
    191         sys.stderr.flush()
    192 
    193         return test_failed
    194 
    195165# run the given list of tests with the given parameters
    196166def run_tests(tests, generate, dry_run, jobs) :
     
    204174                print( "Regenerate tests for: " )
    205175
    206         # for each test to run
    207         pool = Pool(jobs)
    208         try :
    209                 results = pool.map_async(partial(run_test_instance, generate=generate, dry_run=dry_run), tests ).get(99999999)
    210         except KeyboardInterrupt:
    211                 pool.terminate()
    212                 print("Tests interrupted by user")
    213                 sys.exit(1)
     176        failed = False;
     177        # for eeach test to run
     178        for t in tests:
     179                # print formated name
     180                name_txt = "%20s  " % t.name
     181
     182                #run the test instance and collect the result
     183                test_failed, error = run_test_instance(t, generate, dry_run)
     184
     185                # aggregate test suite result
     186                failed = test_failed or failed
     187
     188                # update output based on current action
     189                if generate :
     190                        failed_txt = "ERROR"
     191                        success_txt = "Done"
     192                else :
     193                        failed_txt = "FAILED"
     194                        success_txt = "PASSED"
     195
     196                #print result with error if needed
     197                text = name_txt + (failed_txt if test_failed else success_txt)
     198                out = sys.stdout
     199                if error :
     200                        text = text + "\n" + error
     201                        out = sys.stderr
     202
     203                print(text, file = out);
     204                sys.stdout.flush()
     205                sys.stderr.flush()
     206
    214207
    215208        #clean the workspace
    216209        sh("%s clean > /dev/null 2>&1" % make_cmd, dry_run)
    217210
    218         for failed in results:
    219                 if failed :
    220                         return 1
    221 
    222         return 0
     211        return 1 if failed else 0
    223212
    224213################################################################################
     
    290279
    291280# make sure we have a valid number of jobs that corresponds to user input
    292 options.jobs = int(make_max_jobs) if make_max_jobs else (options.jobs if options.jobs else 1)
     281options.jobs = int(make_max_jobs) if make_max_jobs else options.jobs
    293282if options.jobs <= 0 :
    294283        print('ERROR: Invalid number of jobs', file=sys.stderr)
    295284        sys.exit(1)
    296285
    297 print('Running on %i cores' % options.jobs)
    298 
    299286# users may want to simply list the tests
    300287if options.list :
  • src/tests/typeof.c

    r3403534 r28307be  
    88    typeof( int ( int, int p ) ) *v7;
    99    typeof( [int] ( int, int p ) ) *v8;
    10     (typeof(v1)) v2; // cast with typeof
    1110}
Note: See TracChangeset for help on using the changeset viewer.