Changes in / [3403534:28307be]
- Location:
- src
- Files:
-
- 35 added
- 3 deleted
- 37 edited
-
ArgTweak/FunctionFixer.cc (added)
-
ArgTweak/FunctionFixer.h (added)
-
ArgTweak/Mutate.cc (added)
-
ArgTweak/Mutate.h (added)
-
ArgTweak/module.mk (added)
-
Common/SemanticError.cc (modified) (2 diffs)
-
Common/SemanticError.h (modified) (3 diffs)
-
Common/utility.h (modified) (1 diff)
-
Designators/Processor.cc (added)
-
Designators/Processor.h (added)
-
Designators/module.mk (added)
-
GenPoly/Box.cc (modified) (9 diffs)
-
GenPoly/PolyMutator.h (modified) (5 diffs)
-
InitTweak/Association.cc (added)
-
InitTweak/Association.h (added)
-
InitTweak/BasicInit.cc (added)
-
InitTweak/BasicInit.h (added)
-
InitTweak/DeclarationHoister.cc (added)
-
InitTweak/DeclarationHoister.h (added)
-
InitTweak/FixInit.cc (modified) (15 diffs)
-
InitTweak/GenInit.cc (modified) (9 diffs)
-
InitTweak/InitExpander.cc (added)
-
InitTweak/InitExpander.h (added)
-
InitTweak/InitModel.cc (added)
-
InitTweak/InitModel.h (added)
-
InitTweak/InitTweak.cc (modified) (6 diffs)
-
InitTweak/InitTweak.h (modified) (1 diff)
-
InitTweak/Mutate.cc (added)
-
InitTweak/Mutate.h (added)
-
InitTweak/diet_map.h (added)
-
Makefile.am (modified) (1 diff)
-
Makefile.in (modified) (21 diffs)
-
Parser/ParseNode.cc (modified) (3 diffs)
-
Parser/ParseNode.h (modified) (1 diff)
-
ResolvExpr/AlternativeFinder.cc (modified) (6 diffs)
-
ResolvExpr/Resolver.cc (modified) (1 diff)
-
SymTab/Autogen.cc (modified) (3 diffs)
-
SymTab/Autogen.h (modified) (1 diff)
-
SymTab/Indexer.cc (modified) (4 diffs)
-
SymTab/Indexer.h (modified) (1 diff)
-
SymTab/Validate.cc (modified) (7 diffs)
-
SynTree/Declaration.cc (modified) (1 diff)
-
SynTree/Declaration.h (modified) (1 diff)
-
SynTree/Expression.cc (modified) (2 diffs)
-
SynTree/Expression.h (modified) (1 diff)
-
SynTree/FunctionDecl.cc (modified) (1 diff)
-
SynTree/Statement.cc (modified) (1 diff)
-
SynTree/Statement.h (modified) (2 diffs)
-
SynTree/Type.cc (modified) (1 diff)
-
SynTree/Type.h (modified) (1 diff)
-
Tuples/AssignExpand.cc (added)
-
Tuples/AssignExpand.h (added)
-
Tuples/FlattenTuple.cc (added)
-
Tuples/FlattenTuple.h (added)
-
Tuples/FunctionChecker.cc (added)
-
Tuples/FunctionChecker.h (added)
-
Tuples/FunctionFixer.cc (added)
-
Tuples/FunctionFixer.h (added)
-
Tuples/MultRet.cc (added)
-
Tuples/MultRet.h (added)
-
Tuples/Mutate.cc (added)
-
Tuples/Mutate.h (added)
-
Tuples/module.mk (modified) (1 diff)
-
tests/.expect/64/declarationSpecifier.txt (modified) (1 diff)
-
tests/.expect/64/extension.txt (modified) (1 diff)
-
tests/.expect/64/gccExtensions.txt (modified) (5 diffs)
-
tests/.expect/ctorWarnings.txt (added)
-
tests/.expect/memberCtors-ERR1.txt (deleted)
-
tests/.expect/memberCtors.txt (deleted)
-
tests/Makefile.am (modified) (1 diff)
-
tests/Makefile.in (modified) (1 diff)
-
tests/ctorWarnings.c (added)
-
tests/memberCtors.c (deleted)
-
tests/test.py (modified) (5 diffs)
-
tests/typeof.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/Common/SemanticError.cc
r3403534 r28307be 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // SemanticError.cc -- 7 // SemanticError.cc -- 8 8 // 9 9 // Author : Richard C. Bilson … … 26 26 27 27 SemanticError::SemanticError( std::string error ) { 28 append(error );28 errors.push_back( std::string( "Error: " ) + error ); 29 29 } 30 30 31 31 void 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 ); 37 33 } 38 34 -
src/Common/SemanticError.h
r3403534 r28307be 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // SemanticError.h -- 7 // SemanticError.h -- 8 8 // 9 9 // Author : Richard C. Bilson … … 31 31 32 32 void append( SemanticError &other ); 33 void append( const std::string & );34 33 bool isEmpty() const; 35 34 void print( std::ostream &os ); … … 43 42 template< typename T > 44 43 SemanticError::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() ); 46 48 } 47 48 49 49 50 #endif // SEMANTICERROR_H -
src/Common/utility.h
r3403534 r28307be 246 246 } 247 247 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 Foo251 // var = ...;252 // } // var's original value is restored253 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 278 248 #endif // _UTILITY_H 279 249 -
src/GenPoly/Box.cc
r3403534 r28307be 158 158 class PolyGenericCalculator : public PolyMutator { 159 159 public: 160 typedef PolyMutator Parent;161 using Parent::mutate;162 163 160 template< typename DeclClass > 164 161 DeclClass *handleDecl( DeclClass *decl, Type *type ); … … 1678 1675 DeclClass * PolyGenericCalculator::handleDecl( DeclClass *decl, Type *type ) { 1679 1676 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(); 1687 1684 endTypeScope(); 1688 1685 return ret; … … 1694 1691 1695 1692 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() ); 1703 1694 } 1704 1695 … … 1709 1700 TypeDecl * PolyGenericCalculator::mutate( TypeDecl *typeDecl ) { 1710 1701 scopeTyVars[ typeDecl->get_name() ] = typeDecl->get_kind(); 1711 return Parent::mutate( typeDecl );1702 return Mutator::mutate( typeDecl ); 1712 1703 } 1713 1704 … … 1715 1706 beginTypeScope( pointerType ); 1716 1707 1717 Type *ret = Parent::mutate( pointerType );1708 Type *ret = Mutator::mutate( pointerType ); 1718 1709 1719 1710 endTypeScope(); … … 1733 1724 } 1734 1725 1735 Type *ret = Parent::mutate( funcType );1726 Type *ret = Mutator::mutate( funcType ); 1736 1727 1737 1728 endTypeScope(); … … 1754 1745 } 1755 1746 } 1756 return Parent::mutate( declStmt );1747 return Mutator::mutate( declStmt ); 1757 1748 } 1758 1749 … … 1796 1787 Expression *PolyGenericCalculator::mutate( MemberExpr *memberExpr ) { 1797 1788 // mutate, exiting early if no longer MemberExpr 1798 Expression *expr = Parent::mutate( memberExpr );1789 Expression *expr = Mutator::mutate( memberExpr ); 1799 1790 memberExpr = dynamic_cast< MemberExpr* >( expr ); 1800 1791 if ( ! memberExpr ) return expr; … … 1981 1972 Expression *PolyGenericCalculator::mutate( OffsetofExpr *offsetofExpr ) { 1982 1973 // mutate, exiting early if no longer OffsetofExpr 1983 Expression *expr = Parent::mutate( offsetofExpr );1974 Expression *expr = Mutator::mutate( offsetofExpr ); 1984 1975 offsetofExpr = dynamic_cast< OffsetofExpr* >( expr ); 1985 1976 if ( ! offsetofExpr ) return expr; -
src/GenPoly/PolyMutator.h
r3403534 r28307be 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // PolyMutator.h -- 7 // PolyMutator.h -- 8 8 // 9 9 // Author : Richard C. Bilson … … 30 30 class PolyMutator : public Mutator { 31 31 public: 32 typedef Mutator Parent;33 using Parent::mutate;34 35 32 PolyMutator(); 36 33 … … 45 42 virtual Statement* mutate(ExprStmt *catchStmt); 46 43 virtual Statement* mutate(ReturnStmt *catchStmt); 47 44 48 45 virtual Expression* mutate(UntypedExpr *untypedExpr); 49 46 … … 57 54 Statement* mutateStatement( Statement *stmt ); 58 55 Expression* mutateExpression( Expression *expr ); 59 56 60 57 TyVarMap scopeTyVars; 61 58 TypeSubstitution *env; … … 63 60 std::list< Statement* > stmtsToAddAfter; 64 61 }; 65 } // namespace 62 } // namespace 66 63 67 64 #endif // _POLYMUTATOR_H -
src/InitTweak/FixInit.cc
r3403534 r28307be 31 31 #include "SynTree/Mutator.h" 32 32 #include "SymTab/Indexer.h" 33 #include "SymTab/Autogen.h"34 33 #include "GenPoly/PolyMutator.h" 35 34 #include "SynTree/AddStmtVisitor.h" … … 177 176 }; 178 177 179 class GenStructMemberCalls : public SymTab::Indexer {178 class WarnStructMembers : public Visitor { 180 179 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 ); 186 184 187 185 virtual void visit( FunctionDecl * funcDecl ); … … 190 188 virtual void visit( ApplicationExpr * appExpr ); 191 189 192 SemanticError errors;193 190 private: 194 191 void handleFirstParam( Expression * firstParam ); 195 template< typename... Params >196 void emit( const Params &... params );197 192 198 193 FunctionDecl * function = 0; 199 std::set< DeclarationWithType * > unhandled , usedUninit;194 std::set< DeclarationWithType * > unhandled; 200 195 ObjectDecl * thisParam = 0; 201 bool isCtor = false; // true if current function is a constructor202 StructDecl * structDecl = 0;203 };204 205 // very simple resolver-like mutator class - used to206 // resolve UntypedExprs that are found within newly207 // generated constructor/destructor calls208 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;217 196 }; 218 197 } // namespace … … 230 209 FixCopyCtors::fixCopyCtors( translationUnit ); 231 210 232 GenStructMemberCalls::generate( translationUnit );211 WarnStructMembers::warnings( translationUnit ); 233 212 } 234 213 … … 275 254 } 276 255 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 ); 284 260 } 285 261 } … … 552 528 FunctionDecl * dtorCaller = new FunctionDecl( objDecl->get_mangleName() + dtorCallerNamer.newName(), DeclarationNode::Static, LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ), false, false ); 553 529 dtorCaller->fixUniqueId(); 554 dtorCaller->get_statements()-> push_back( dtorStmt );530 dtorCaller->get_statements()->get_kids().push_back( dtorStmt ); 555 531 556 532 // atexit(dtor_atexit); … … 567 543 // at global scope and there could be multiple function-scoped 568 544 // static variables with the same name in different functions. 569 // Note: it isn't sufficient to modify only the mangleName, because570 // then subsequent Indexer passes can choke on seeing the object's name571 // if another object has the same name and type. An unfortunate side-effect572 // of renaming the object is that subsequent NameExprs may fail to resolve,573 // but there shouldn't be any remaining past this point.574 545 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() ); 577 547 578 548 objDecl->set_init( NULL ); … … 739 709 } 740 710 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(); 752 714 753 715 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(); 757 718 assert( ! type->get_parameters().empty() ); 758 719 thisParam = safe_dynamic_cast< ObjectDecl * >( type->get_parameters().front() ); … … 760 721 StructInstType * structType = dynamic_cast< StructInstType * >( ptrType->get_base() ); 761 722 if ( structType ) { 762 structDecl = structType->get_baseStruct();723 StructDecl * structDecl = structType->get_baseStruct(); 763 724 for ( Declaration * member : structDecl->get_members() ) { 764 725 if ( ObjectDecl * field = dynamic_cast< ObjectDecl * >( member ) ) { … … 770 731 } 771 732 } 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" ); 780 738 } 781 739 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 ) { 834 744 if ( ! checkWarnings( function ) ) return; 835 745 … … 850 760 handleFirstParam( firstParam ); 851 761 } 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() ); 852 767 } 853 768 … … 855 770 } 856 771 857 void GenStructMemberCalls::handleFirstParam( Expression * firstParam ) {772 void WarnStructMembers::handleFirstParam( Expression * firstParam ) { 858 773 using namespace std; 859 774 if ( AddressExpr * addrExpr = dynamic_cast< AddressExpr * >( firstParam ) ) { … … 872 787 } 873 788 874 void GenStructMemberCalls::visit( MemberExpr * memberExpr ) {789 void WarnStructMembers::visit( MemberExpr * memberExpr ) { 875 790 if ( ! checkWarnings( function ) ) return; 876 if ( ! isC tor) return;791 if ( ! isConstructor( function->get_name() ) ) return; 877 792 878 793 if ( ApplicationExpr * deref = dynamic_cast< ApplicationExpr * >( memberExpr->get_aggregate() ) ) { … … 882 797 if ( unhandled.count( memberExpr->get_member() ) ) { 883 798 // 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" ); 885 800 } 886 801 } … … 890 805 Parent::visit( memberExpr ); 891 806 } 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 collisions907 // in generated code. If this changes, add mutate methods for entities with908 // 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 }916 807 } // namespace 917 808 } // namespace InitTweak -
src/InitTweak/GenInit.cc
r3403534 r28307be 25 25 #include "SynTree/Mutator.h" 26 26 #include "SymTab/Autogen.h" 27 #include "SymTab/Mangler.h"28 27 #include "GenPoly/PolyMutator.h" 29 28 #include "GenPoly/DeclMutator.h" 30 #include "GenPoly/ScopedSet.h"31 29 32 30 namespace InitTweak { … … 57 55 class CtorDtor : public GenPoly::PolyMutator { 58 56 public: 59 typedef GenPoly::PolyMutator Parent;60 using Parent::mutate;61 57 /// create constructor and destructor statements for object declarations. 62 58 /// the actual call statements will be added in after the resolver has run … … 69 65 // should not traverse into any of these declarations to find objects 70 66 // that need to be constructed or destructed 71 virtual Declaration* mutate( StructDecl *aggregateDecl ) ;67 virtual Declaration* mutate( StructDecl *aggregateDecl ) { return aggregateDecl; } 72 68 virtual Declaration* mutate( UnionDecl *aggregateDecl ) { return aggregateDecl; } 73 69 virtual Declaration* mutate( EnumDecl *aggregateDecl ) { return aggregateDecl; } … … 78 74 virtual Type * mutate( FunctionType *funcType ) { return funcType; } 79 75 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: 91 77 }; 92 78 … … 156 142 157 143 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; 160 146 161 147 FunctionType * type = functionDecl->get_functionType(); … … 163 149 funcName = functionDecl->get_name(); 164 150 DeclarationWithType * decl = Mutator::mutate( functionDecl ); 151 returnVals = oldReturnVals; 152 funcName = oldFuncName; 165 153 return decl; 166 154 } … … 209 197 210 198 DeclarationWithType * HoistArrayDimension::mutate( FunctionDecl *functionDecl ) { 211 ValueGuard< bool > oldInFunc( inFunction );199 bool oldInFunc = inFunction; 212 200 inFunction = true; 213 201 DeclarationWithType * decl = Parent::mutate( functionDecl ); 202 inFunction = oldInFunc; 214 203 return decl; 215 204 } … … 220 209 } 221 210 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 240 211 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 ) ) { 249 214 // call into genImplicitCall from Autogen.h to generate calls to ctor/dtor 250 215 // for each constructable object … … 276 241 } 277 242 } 278 return Parent::mutate( objDecl );243 return Mutator::mutate( objDecl ); 279 244 } 280 245 281 246 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/dtors289 for ( TypeDecl * tyDecl : functionDecl->get_functionType()->get_forall() ) {290 for ( DeclarationWithType *& assertion : tyDecl->get_assertions() ) {291 assertion = assertion->acceptMutator( *this );292 }293 }294 247 // parameters should not be constructed and destructed, so don't mutate FunctionType 295 248 mutateAll( functionDecl->get_oldDecls(), *this ); 296 249 functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) ); 297 298 managedTypes.endScope();299 250 return functionDecl; 300 251 } 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 managed305 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 323 252 } // namespace InitTweak 324 253 -
src/InitTweak/InitTweak.cc
r3403534 r28307be 7 7 #include "SynTree/Attribute.h" 8 8 #include "GenPoly/GenPoly.h" 9 #include "ResolvExpr/typeops.h"10 9 11 10 namespace InitTweak { … … 80 79 public: 81 80 ExprImpl( Expression * expr ) : arg( expr ) {} 82 83 ~ExprImpl() { delete arg; }84 81 85 82 virtual std::list< Expression * > next( std::list< Expression * > & indices ) { … … 125 122 126 123 void InitExpander::clearArrayIndices() { 127 deleteAll( indices );128 124 indices.clear(); 129 125 } … … 232 228 return ! LinkageSpec::isBuiltin( objDecl->get_linkage() ) && 233 229 (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() ) 235 232 && objDecl->get_storageClass() != DeclarationNode::Extern; 236 233 } … … 390 387 virtual void visit( ApplicationExpr *applicationExpr ) { isConstExpr = false; } 391 388 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; } 402 391 virtual void visit( LabelAddressExpr *labAddressExpr ) { isConstExpr = false; } 403 392 virtual void visit( UntypedMemberExpr *memberExpr ) { isConstExpr = false; } 404 393 virtual void visit( MemberExpr *memberExpr ) { isConstExpr = false; } 405 394 virtual void visit( VariableExpr *variableExpr ) { isConstExpr = false; } 395 virtual void visit( ConstantExpr *constantExpr ) { /* bottom out */ } 406 396 // these might be okay? 407 397 // virtual void visit( SizeofExpr *sizeofExpr ); … … 446 436 bool isDestructor( const std::string & str ) { return str == "^?{}"; } 447 437 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 }467 438 } -
src/InitTweak/InitTweak.h
r3403534 r28307be 29 29 bool isDestructor( const std::string & ); 30 30 bool isCtorDtor( const std::string & ); 31 32 FunctionDecl * isCopyConstructor( Declaration * decl );33 31 34 32 /// transform Initializer into an argument list that can be passed to a call expression -
src/Makefile.am
r3403534 r28307be 25 25 # Is there a way to use a variable for the directory names? 26 26 27 include ArgTweak/module.mk 27 28 include CodeGen/module.mk 28 29 include Common/module.mk 29 30 include ControlStruct/module.mk 31 include Designators/module.mk 30 32 include GenPoly/module.mk 31 33 include InitTweak/module.mk -
src/Makefile.in
r3403534 r28307be 22 22 ############################################################################### 23 23 24 ######################### -*- Mode: Makefile-Gmake -*- ######################## 25 ############################################################################### 26 24 27 #SRC += ArgTweak/Rewriter.cc \ 25 28 # ArgTweak/Mutate.cc 29 30 ######################### -*- Mode: Makefile-Gmake -*- ######################## 31 ############################################################################### 26 32 27 33 ######################### -*- Mode: Makefile-Gmake -*- ######################## … … 69 75 PRE_UNINSTALL = : 70 76 POST_UNINSTALL = : 71 DIST_COMMON = $(srcdir)/CodeGen/module.mk $(srcdir)/Common/module.mk \ 72 $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk \ 77 DIST_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 \ 73 80 $(srcdir)/InitTweak/module.mk $(srcdir)/Makefile.am \ 74 81 $(srcdir)/Makefile.in $(srcdir)/Parser/module.mk \ … … 105 112 ControlStruct/driver_cfa_cpp-ForExprMutator.$(OBJEXT) \ 106 113 ControlStruct/driver_cfa_cpp-LabelTypeChecker.$(OBJEXT) \ 114 Designators/driver_cfa_cpp-Processor.$(OBJEXT) \ 107 115 GenPoly/driver_cfa_cpp-Box.$(OBJEXT) \ 108 116 GenPoly/driver_cfa_cpp-GenPoly.$(OBJEXT) \ … … 188 196 SynTree/driver_cfa_cpp-TypeSubstitution.$(OBJEXT) \ 189 197 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) \ 190 201 Tuples/driver_cfa_cpp-TupleAssignment.$(OBJEXT) \ 202 Tuples/driver_cfa_cpp-FunctionChecker.$(OBJEXT) \ 191 203 Tuples/driver_cfa_cpp-NameMatcher.$(OBJEXT) 192 204 am_driver_cfa_cpp_OBJECTS = $(am__objects_1) … … 362 374 ControlStruct/MLEMutator.cc ControlStruct/Mutate.cc \ 363 375 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 \ 366 378 GenPoly/ScrubTyVars.cc GenPoly/Lvalue.cc GenPoly/Specialize.cc \ 367 379 GenPoly/CopyParams.cc GenPoly/FindFunction.cc \ … … 401 413 SynTree/Initializer.cc SynTree/Visitor.cc SynTree/Mutator.cc \ 402 414 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 405 418 MAINTAINERCLEANFILES = Parser/parser.output ${libdir}/${notdir \ 406 419 ${cfa_cpplib_PROGRAMS}} … … 420 433 .SUFFIXES: 421 434 .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) 423 436 @for dep in $?; do \ 424 437 case '$(am__configure_deps)' in \ … … 441 454 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 442 455 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: 444 457 445 458 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) … … 540 553 ControlStruct/$(am__dirstamp) \ 541 554 ControlStruct/$(DEPDIR)/$(am__dirstamp) 555 Designators/$(am__dirstamp): 556 @$(MKDIR_P) Designators 557 @: > Designators/$(am__dirstamp) 558 Designators/$(DEPDIR)/$(am__dirstamp): 559 @$(MKDIR_P) Designators/$(DEPDIR) 560 @: > Designators/$(DEPDIR)/$(am__dirstamp) 561 Designators/driver_cfa_cpp-Processor.$(OBJEXT): \ 562 Designators/$(am__dirstamp) \ 563 Designators/$(DEPDIR)/$(am__dirstamp) 542 564 GenPoly/$(am__dirstamp): 543 565 @$(MKDIR_P) GenPoly … … 767 789 @$(MKDIR_P) Tuples/$(DEPDIR) 768 790 @: > Tuples/$(DEPDIR)/$(am__dirstamp) 791 Tuples/driver_cfa_cpp-Mutate.$(OBJEXT): Tuples/$(am__dirstamp) \ 792 Tuples/$(DEPDIR)/$(am__dirstamp) 793 Tuples/driver_cfa_cpp-AssignExpand.$(OBJEXT): Tuples/$(am__dirstamp) \ 794 Tuples/$(DEPDIR)/$(am__dirstamp) 795 Tuples/driver_cfa_cpp-FunctionFixer.$(OBJEXT): Tuples/$(am__dirstamp) \ 796 Tuples/$(DEPDIR)/$(am__dirstamp) 769 797 Tuples/driver_cfa_cpp-TupleAssignment.$(OBJEXT): \ 798 Tuples/$(am__dirstamp) Tuples/$(DEPDIR)/$(am__dirstamp) 799 Tuples/driver_cfa_cpp-FunctionChecker.$(OBJEXT): \ 770 800 Tuples/$(am__dirstamp) Tuples/$(DEPDIR)/$(am__dirstamp) 771 801 Tuples/driver_cfa_cpp-NameMatcher.$(OBJEXT): Tuples/$(am__dirstamp) \ … … 794 824 -rm -f ControlStruct/driver_cfa_cpp-MLEMutator.$(OBJEXT) 795 825 -rm -f ControlStruct/driver_cfa_cpp-Mutate.$(OBJEXT) 826 -rm -f Designators/driver_cfa_cpp-Processor.$(OBJEXT) 796 827 -rm -f GenPoly/driver_cfa_cpp-Box.$(OBJEXT) 797 828 -rm -f GenPoly/driver_cfa_cpp-CopyParams.$(OBJEXT) … … 877 908 -rm -f SynTree/driver_cfa_cpp-Visitor.$(OBJEXT) 878 909 -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) 879 914 -rm -f Tuples/driver_cfa_cpp-NameMatcher.$(OBJEXT) 880 915 -rm -f Tuples/driver_cfa_cpp-TupleAssignment.$(OBJEXT) … … 899 934 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-MLEMutator.Po@am__quote@ 900 935 @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@ 901 937 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-Box.Po@am__quote@ 902 938 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-CopyParams.Po@am__quote@ … … 982 1018 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Visitor.Po@am__quote@ 983 1019 @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@ 984 1024 @AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-NameMatcher.Po@am__quote@ 985 1025 @AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-TupleAssignment.Po@am__quote@ … … 1225 1265 @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` 1226 1266 1267 Designators/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 1274 Designators/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 1227 1281 GenPoly/driver_cfa_cpp-Box.o: GenPoly/Box.cc 1228 1282 @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 … … 2387 2441 @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` 2388 2442 2443 Tuples/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 2450 Tuples/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 2457 Tuples/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 2464 Tuples/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 2471 Tuples/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 2478 Tuples/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 2389 2485 Tuples/driver_cfa_cpp-TupleAssignment.o: Tuples/TupleAssignment.cc 2390 2486 @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 … … 2400 2496 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2401 2497 @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 2499 Tuples/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 2506 Tuples/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` 2402 2512 2403 2513 Tuples/driver_cfa_cpp-NameMatcher.o: Tuples/NameMatcher.cc … … 2544 2654 -rm -f ControlStruct/$(DEPDIR)/$(am__dirstamp) 2545 2655 -rm -f ControlStruct/$(am__dirstamp) 2656 -rm -f Designators/$(DEPDIR)/$(am__dirstamp) 2657 -rm -f Designators/$(am__dirstamp) 2546 2658 -rm -f GenPoly/$(DEPDIR)/$(am__dirstamp) 2547 2659 -rm -f GenPoly/$(am__dirstamp) … … 2573 2685 2574 2686 distclean: 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) 2576 2688 -rm -f Makefile 2577 2689 distclean-am: clean-am distclean-compile distclean-generic \ … … 2619 2731 2620 2732 maintainer-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) 2622 2734 -rm -f Makefile 2623 2735 maintainer-clean-am: distclean-am maintainer-clean-generic … … 2654 2766 2655 2767 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 2656 2778 # Tell versions [3.59,3.63) of GNU make to not export all variables. 2657 2779 # Otherwise a system limit (for SysV at least) may be exceeded. -
src/Parser/ParseNode.cc
r3403534 r28307be 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // ParseNode.cc -- 7 // ParseNode.cc -- 8 8 // 9 9 // Author : Rodolfo G. Esteves … … 12 12 // Last Modified On : Wed Aug 17 23:14:16 2016 13 13 // Update Count : 126 14 // 14 // 15 15 16 16 #include "ParseNode.h" … … 19 19 int ParseNode::indent_by = 4; 20 20 21 std::ostream & operator<<( std::ostream & out, const ParseNode * node ) {22 node->print( out );23 return out;24 }25 26 21 // Local Variables: // 27 22 // tab-width: 4 // -
src/Parser/ParseNode.h
r3403534 r28307be 431 431 } 432 432 433 // in ParseNode.cc434 std::ostream & operator<<( std::ostream & out, const ParseNode * node );435 433 436 434 #endif // PARSENODE_H -
src/ResolvExpr/AlternativeFinder.cc
r3403534 r28307be 38 38 #include "SynTree/TypeSubstitution.h" 39 39 #include "SymTab/Validate.h" 40 #include "Designators/Processor.h" 40 41 #include "Tuples/TupleAssignment.h" 41 42 #include "Tuples/NameMatcher.h" 42 43 #include "Common/utility.h" 43 44 #include "InitTweak/InitTweak.h" 44 #include "ResolveTypeof.h"45 45 46 46 extern bool resolvep; … … 708 708 void AlternativeFinder::visit( CastExpr *castExpr ) { 709 709 for ( std::list< Type* >::iterator i = castExpr->get_results().begin(); i != castExpr->get_results().end(); ++i ) { 710 *i = resolveTypeof( *i, indexer );711 710 SymTab::validateType( *i, &indexer ); 712 711 adjustExprType( *i, env, indexer ); … … 797 796 798 797 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 ) ); 802 799 } 803 800 … … 808 805 void AlternativeFinder::visit( SizeofExpr *sizeofExpr ) { 809 806 if ( sizeofExpr->get_isType() ) { 810 // xxx - resolveTypeof?811 807 alternatives.push_back( Alternative( sizeofExpr->clone(), env, Cost::zero ) ); 812 808 } else { … … 828 824 void AlternativeFinder::visit( AlignofExpr *alignofExpr ) { 829 825 if ( alignofExpr->get_isType() ) { 830 // xxx - resolveTypeof?831 826 alternatives.push_back( Alternative( alignofExpr->clone(), env, Cost::zero ) ); 832 827 } else { … … 862 857 void AlternativeFinder::visit( UntypedOffsetofExpr *offsetofExpr ) { 863 858 AlternativeFinder funcFinder( indexer, env ); 864 // xxx - resolveTypeof?865 859 if ( StructInstType *structInst = dynamic_cast< StructInstType* >( offsetofExpr->get_type() ) ) { 866 860 addOffsetof( structInst, offsetofExpr->get_member() ); -
src/ResolvExpr/Resolver.cc
r3403534 r28307be 528 528 529 529 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 } 533 539 534 540 // found a constructor - can get rid of C-style initializer -
src/SymTab/Autogen.cc
r3403534 r28307be 64 64 65 65 template< typename OutputIterator > 66 void makeUnionFieldsAssignment( ObjectDecl *srcParam, ObjectDecl *dstParam, OutputIterator out ) {66 void makeUnionFieldsAssignment( ObjectDecl *srcParam, ObjectDecl *dstParam, UnionInstType *unionType, OutputIterator out ) { 67 67 UntypedExpr *copy = new UntypedExpr( new NameExpr( "__builtin_memcpy" ) ); 68 68 copy->get_args().push_back( new VariableExpr( dstParam ) ); … … 413 413 dtorDecl->fixUniqueId(); 414 414 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() ) ); 417 417 else assignDecl->get_statements()->get_kids().push_back( new ReturnStmt( noLabels, new VariableExpr( srcParam ) ) ); 418 418 … … 434 434 ctor->fixUniqueId(); 435 435 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() ) ); 437 437 memCtors.push_back( ctor ); 438 438 // only generate a ctor for the first field -
src/SymTab/Autogen.h
r3403534 r28307be 102 102 } 103 103 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*>() ) ); 105 110 106 111 UntypedExpr *cond = new UntypedExpr( cmp ); -
src/SymTab/Indexer.cc
r3403534 r28307be 21 21 #include <unordered_set> 22 22 #include <utility> 23 #include <algorithm>24 23 25 24 #include "Mangler.h" … … 34 33 #include "SynTree/Initializer.h" 35 34 #include "SynTree/Statement.h" 36 37 #include "InitTweak/InitTweak.h"38 35 39 36 #define debugPrint(x) if ( doDebug ) { std::cout << x; } … … 104 101 } 105 102 106 void Indexer::removeSpecialOverrides( const std::string &id, std::list< DeclarationWithType * > & out ) const {107 // only need to perform this step for constructors and destructors108 if ( ! InitTweak::isCtorDtor( id ) ) return;109 110 // helpful data structure111 struct ValueType {112 struct DeclBall {113 FunctionDecl * decl;114 bool isUserDefinedFunc; // properties for this particular decl115 bool isDefaultFunc;116 bool isCopyFunc;117 };118 // properties for this type119 bool userDefinedFunc = false; // any user defined function found120 bool userDefinedDefaultFunc = false; // user defined default ctor found121 bool userDefinedCopyFunc = false; // user defined copy ctor found122 std::list< DeclBall > decls;123 124 // another FunctionDecl for the current type was found - determine125 // if it has special properties and update data structure accordingly126 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 }; // ValueType137 138 std::list< DeclarationWithType * > copy;139 copy.splice( copy.end(), out );140 141 // organize discovered declarations by type142 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 determine154 // the set of ctor/dtors that are seen by the requester. In particular, if the user defines155 // a default ctor, then the generated default ctor should never be seen, likewise for copy ctor156 // 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 requester162 out.push_back( ball.decl );163 }164 }165 }166 }167 168 103 void Indexer::makeWritable() { 169 104 if ( ! tables ) { … … 526 461 searchTables = searchTables->base.tables; 527 462 } 528 529 // some special functions, e.g. constructors and destructors530 // remove autogenerated functions when they are defined so that531 // they can never be matched532 removeSpecialOverrides( id, out );533 463 } 534 464 -
src/SymTab/Indexer.h
r3403534 r28307be 128 128 static void deleteRef( Impl *toFree ); 129 129 130 // Removes matching autogenerated constructors and destructors131 // so that they will not be selected132 // void removeSpecialOverrides( FunctionDecl *decl );133 void removeSpecialOverrides( const std::string &id, std::list< DeclarationWithType * > & out ) const;134 135 130 /// Ensures that tables variable is writable (i.e. allocated, uniquely owned by this Indexer, and at the current scope) 136 131 void makeWritable(); -
src/SymTab/Validate.cc
r3403534 r28307be 86 86 87 87 /// 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 { 89 89 typedef Visitor Parent; 90 90 virtual void visit( EnumDecl *aggregateDecl ); … … 189 189 190 190 void validate( std::list< Declaration * > &translationUnit, bool doDebug ) { 191 EnumAndPointerDecayPass epc;191 Pass1 pass1; 192 192 Pass2 pass2( doDebug, 0 ); 193 193 Pass3 pass3( 0 ); … … 196 196 EliminateTypedef::eliminateTypedef( translationUnit ); 197 197 HoistStruct::hoistStruct( translationUnit ); 198 autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecayPass199 acceptAll( translationUnit, epc);198 autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs Pass1 199 acceptAll( translationUnit, pass1 ); 200 200 acceptAll( translationUnit, pass2 ); 201 201 ReturnChecker::checkFunctionReturns( translationUnit ); … … 206 206 207 207 void validateType( Type *type, const Indexer *indexer ) { 208 EnumAndPointerDecayPass epc;208 Pass1 pass1; 209 209 Pass2 pass2( false, indexer ); 210 210 Pass3 pass3( indexer ); 211 type->accept( epc);211 type->accept( pass1 ); 212 212 type->accept( pass2 ); 213 213 type->accept( pass3 ); … … 272 272 } 273 273 274 void EnumAndPointerDecayPass::visit( EnumDecl *enumDecl ) {274 void Pass1::visit( EnumDecl *enumDecl ) { 275 275 // Set the type of each member of the enumeration to be EnumConstant 276 276 for ( std::list< Declaration * >::iterator i = enumDecl->get_members().begin(); i != enumDecl->get_members().end(); ++i ) { … … 296 296 DWTIterator j = i; 297 297 ++i; 298 delete *j;299 298 dwts.erase( j ); 300 299 if ( i != end ) { … … 314 313 } 315 314 316 void EnumAndPointerDecayPass::visit( FunctionType *func ) {315 void Pass1::visit( FunctionType *func ) { 317 316 // Fix up parameters and return types 318 317 fixFunctionList( func->get_parameters(), func ); -
src/SynTree/Declaration.cc
r3403534 r28307be 56 56 } 57 57 58 std::ostream & operator<<( std::ostream & out, constDeclaration * decl ) {58 std::ostream & operator<<( std::ostream & out, Declaration * decl ) { 59 59 decl->print( out ); 60 60 return out; -
src/SynTree/Declaration.h
r3403534 r28307be 279 279 }; 280 280 281 std::ostream & operator<<( std::ostream & out, constDeclaration * decl );281 std::ostream & operator<<( std::ostream & out, Declaration * decl ); 282 282 283 283 #endif // DECLARATION_H -
src/SynTree/Expression.cc
r3403534 r28307be 358 358 assert( member ); 359 359 os << std::string( indent + 2, ' ' ); 360 os << (void*)member << " "; 360 361 member->print( os, indent + 2 ); 361 362 os << std::endl; … … 540 541 } 541 542 542 std::ostream & operator<<( std::ostream & out, constExpression * expr ) {543 std::ostream & operator<<( std::ostream & out, Expression * expr ) { 543 544 expr->print( out ); 544 545 return out; -
src/SynTree/Expression.h
r3403534 r28307be 653 653 }; 654 654 655 std::ostream & operator<<( std::ostream & out, constExpression * expr );655 std::ostream & operator<<( std::ostream & out, Expression * expr ); 656 656 657 657 #endif // EXPRESSION_H -
src/SynTree/FunctionDecl.cc
r3403534 r28307be 21 21 #include "Attribute.h" 22 22 #include "Common/utility.h" 23 #include "InitTweak/InitTweak.h"24 23 25 24 FunctionDecl::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 387 387 } 388 388 389 std::ostream & operator<<( std::ostream & out, constStatement * statement ) {389 std::ostream & operator<<( std::ostream & out, Statement * statement ) { 390 390 statement->print( out ); 391 391 return out; -
src/SynTree/Statement.h
r3403534 r28307be 47 47 48 48 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 ); }51 49 52 50 virtual CompoundStmt *clone() const { return new CompoundStmt( *this ); } … … 397 395 398 396 399 std::ostream & operator<<( std::ostream & out, constStatement * statement );397 std::ostream & operator<<( std::ostream & out, Statement * statement ); 400 398 401 399 #endif // STATEMENT_H -
src/SynTree/Type.cc
r3403534 r28307be 84 84 } 85 85 86 std::ostream & operator<<( std::ostream & out, constType * type ) {86 std::ostream & operator<<( std::ostream & out, Type * type ) { 87 87 type->print( out ); 88 88 return out; -
src/SynTree/Type.h
r3403534 r28307be 481 481 } 482 482 483 std::ostream & operator<<( std::ostream & out, constType * type );483 std::ostream & operator<<( std::ostream & out, Type * type ); 484 484 485 485 #endif // TYPE_H -
src/Tuples/module.mk
r3403534 r28307be 15 15 ############################################################################### 16 16 17 SRC += Tuples/TupleAssignment.cc \ 17 SRC += Tuples/Mutate.cc \ 18 Tuples/AssignExpand.cc \ 19 Tuples/FunctionFixer.cc \ 20 Tuples/TupleAssignment.cc \ 21 Tuples/FunctionChecker.cc \ 18 22 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 530 530 return ((int )_retVal0); 531 531 } 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 86 86 __extension__ int __c__i_2; 87 87 }; 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)) /* ?{} */); 89 90 ((void)__extension__ 3); 90 91 ((void)__extension__ __a__i_1); -
src/tests/.expect/64/gccExtensions.txt
r3403534 r28307be 76 76 ((void)((*((int *)(&(*___dst__P2sS_2).__c__i_2)))=__c__i_2) /* ?{} */); 77 77 } 78 int __i__i_2 = ((int )__extension__ 3); 78 int __i__i_2; 79 ((void)((*((int *)(&__i__i_2)))=__extension__ 3) /* ?{} */); 79 80 __extension__ int __a__i_2; 80 81 __extension__ int __b__i_2; … … 132 133 } 133 134 struct s3 __x1__3ss3_2; 135 ((void)___constructor__F_P3ss3_autogen___2(((struct s3 *)(&__x1__3ss3_2)))); 134 136 struct s3 __y1__3ss3_2; 137 ((void)___constructor__F_P3ss3_autogen___2(((struct s3 *)(&__y1__3ss3_2)))); 135 138 struct s4 { 136 139 int __i__i_2; … … 138 141 inline struct s4 ___operator_assign__F3ss4_P3ss43ss4_autogen___2(struct s4 *___dst__P3ss4_2, struct s4 ___src__3ss4_2){ 139 142 ((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)))); 140 145 return ((struct s4 )___src__3ss4_2); 141 146 } … … 153 158 } 154 159 struct s4 __x2__3ss4_2; 160 ((void)___constructor__F_P3ss4_autogen___2(((struct s4 *)(&__x2__3ss4_2)))); 155 161 struct s4 __y2__3ss4_2; 162 ((void)___constructor__F_P3ss4_autogen___2(((struct s4 *)(&__y2__3ss4_2)))); 156 163 int __m1__A0i_2[((long unsigned int )10)]; 157 164 int __m2__A0A0i_2[((long unsigned int )10)][((long unsigned int )10)]; … … 159 166 int _retVal0 = { 0 }; 160 167 ((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)))); 161 172 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)))); 162 177 } -
src/tests/Makefile.am
r3403534 r28307be 62 62 ${CC} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} 63 63 64 memberCtors-ERR1: memberCtors.c65 ${CC} ${CFALGS} - DERR1 ${<} -o${@}64 ctorWarnings: ctorWarnings.c 65 ${CC} ${CFALGS} -CFA -XCFA -p ${<} -o /dev/null 2> ${@} 66 66 -
src/tests/Makefile.in
r3403534 r28307be 670 670 ${CC} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} 671 671 672 memberCtors-ERR1: memberCtors.c673 ${CC} ${CFALGS} - DERR1 ${<} -o${@}672 ctorWarnings: ctorWarnings.c 673 ${CC} ${CFALGS} -CFA -XCFA -p ${<} -o /dev/null 2> ${@} 674 674 675 675 # Tell versions [3.59,3.63) of GNU make to not export all variables. -
src/tests/test.py
r3403534 r28307be 2 2 from __future__ import print_function 3 3 4 from functools import partial5 from multiprocessing import Pool6 4 from os import listdir, environ 7 5 from os.path import isfile, join, splitext … … 104 102 # running test functions 105 103 ################################################################################ 106 def run_ single_test(test, generate, dry_run):104 def run_test_instance(test, generate, dry_run): 107 105 108 106 # find the output file based on the test name and options flag … … 165 163 return retcode, error 166 164 167 def run_test_instance(t, generate, dry_run) :168 # print formated name169 name_txt = "%20s " % t.name170 171 #run the test instance and collect the result172 test_failed, error = run_single_test(t, generate, dry_run)173 174 # update output based on current action175 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 needed183 text = name_txt + (failed_txt if test_failed else success_txt)184 out = sys.stdout185 if error :186 text = text + "\n" + error187 out = sys.stderr188 189 print(text, file = out);190 sys.stdout.flush()191 sys.stderr.flush()192 193 return test_failed194 195 165 # run the given list of tests with the given parameters 196 166 def run_tests(tests, generate, dry_run, jobs) : … … 204 174 print( "Regenerate tests for: " ) 205 175 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 214 207 215 208 #clean the workspace 216 209 sh("%s clean > /dev/null 2>&1" % make_cmd, dry_run) 217 210 218 for failed in results: 219 if failed : 220 return 1 221 222 return 0 211 return 1 if failed else 0 223 212 224 213 ################################################################################ … … 290 279 291 280 # 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)281 options.jobs = int(make_max_jobs) if make_max_jobs else options.jobs 293 282 if options.jobs <= 0 : 294 283 print('ERROR: Invalid number of jobs', file=sys.stderr) 295 284 sys.exit(1) 296 285 297 print('Running on %i cores' % options.jobs)298 299 286 # users may want to simply list the tests 300 287 if options.list : -
src/tests/typeof.c
r3403534 r28307be 8 8 typeof( int ( int, int p ) ) *v7; 9 9 typeof( [int] ( int, int p ) ) *v8; 10 (typeof(v1)) v2; // cast with typeof11 10 }
Note:
See TracChangeset
for help on using the changeset viewer.