- Timestamp:
- Aug 27, 2018, 4:40:34 PM (7 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- b7c89aa
- Parents:
- f9feab8 (diff), 305581d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src
- Files:
-
- 16 added
- 97 deleted
- 123 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
rf9feab8 r90152a4 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S un Sep 3 20:42:52 201713 // Update Count : 49 012 // Last Modified On : Sat May 5 09:08:32 2018 13 // Update Count : 494 14 14 // 15 15 #include "CodeGenerator.h" … … 18 18 #include <list> // for _List_iterator, list, list<>::it... 19 19 20 #include "Common/SemanticError.h" // for SemanticError21 20 #include "Common/UniqueName.h" // for UniqueName 22 21 #include "Common/utility.h" // for CodeLocation, toString … … 117 116 } 118 117 119 CodeGenerator::CodeGenerator( std::ostream & os, bool pretty, bool genC, bool lineMarks ) : indent( CodeGenerator::tabsize ), output( os ), printLabels( *this ), pretty( pretty ), genC( genC ), lineMarks( lineMarks ), endl( *this ) {}118 CodeGenerator::CodeGenerator( std::ostream & os, bool pretty, bool genC, bool lineMarks, bool printExprTypes ) : indent( CodeGenerator::tabsize ), output( os ), printLabels( *this ), pretty( pretty ), genC( genC ), lineMarks( lineMarks ), printExprTypes( printExprTypes ), endl( *this ) {} 120 119 121 120 string CodeGenerator::mangleName( DeclarationWithType * decl ) { 122 if ( pretty ) return decl->get_name(); 123 if ( decl->get_mangleName() != "" ) { 121 // GCC builtins should always be printed unmangled 122 if ( pretty || decl->linkage.is_gcc_builtin ) return decl->name; 123 if ( decl->mangleName != "" ) { 124 124 // need to incorporate scope level in order to differentiate names for destructors 125 125 return decl->get_scopedMangleName(); 126 126 } else { 127 return decl-> get_name();127 return decl->name; 128 128 } // if 129 129 } … … 133 133 output << "__attribute__ (("; 134 134 for ( list< Attribute * >::iterator attr( attributes.begin() );; ) { 135 output << (*attr)-> get_name();136 if ( ! (*attr)-> get_parameters().empty() ) {135 output << (*attr)->name; 136 if ( ! (*attr)->parameters.empty() ) { 137 137 output << "("; 138 genCommaList( (*attr)-> get_parameters().begin(), (*attr)->get_parameters().end() );138 genCommaList( (*attr)->parameters.begin(), (*attr)->parameters.end() ); 139 139 output << ")"; 140 140 } // if … … 160 160 } 161 161 162 // *** Expression 163 void CodeGenerator::previsit( Expression * node ) { 164 previsit( (BaseSyntaxNode *)node ); 165 GuardAction( [this, node](){ 166 if ( printExprTypes && node->result ) { 167 output << " /* " << genType( node->result, "", pretty, genC ) << " */ "; 168 } 169 } ); 170 } 171 162 172 // *** Declarations 163 173 void CodeGenerator::postvisit( FunctionDecl * functionDecl ) { 174 // deleted decls should never be used, so don't print them 175 if ( functionDecl->isDeleted && genC ) return; 164 176 extension( functionDecl ); 165 177 genAttributes( functionDecl->get_attributes() ); … … 175 187 functionDecl->get_statements()->accept( *visitor ); 176 188 } // if 189 if ( functionDecl->isDeleted ) { 190 output << " = void"; 191 } 177 192 } 178 193 179 194 void CodeGenerator::postvisit( ObjectDecl * objectDecl ) { 195 // deleted decls should never be used, so don't print them 196 if ( objectDecl->isDeleted && genC ) return; 180 197 if (objectDecl->get_name().empty() && genC ) { 181 198 // only generate an anonymous name when generating C code, otherwise it clutters the output too much … … 196 213 objectDecl->get_init()->accept( *visitor ); 197 214 } // if 215 if ( objectDecl->isDeleted ) { 216 output << " = void"; 217 } 198 218 199 219 if ( objectDecl->get_bitfieldWidth() ) { … … 204 224 205 225 void CodeGenerator::handleAggregate( AggregateDecl * aggDecl, const std::string & kind ) { 206 genAttributes( aggDecl->get_attributes() ); 207 208 if( ! aggDecl->get_parameters().empty() && ! genC ) { 226 if( ! aggDecl->parameters.empty() && ! genC ) { 209 227 // assertf( ! genC, "Aggregate type parameters should not reach code generation." ); 210 228 output << "forall("; 211 genCommaList( aggDecl-> get_parameters().begin(), aggDecl->get_parameters().end() );229 genCommaList( aggDecl->parameters.begin(), aggDecl->parameters.end() ); 212 230 output << ")" << endl; 213 231 output << indent; 214 232 } 215 233 216 output << kind << aggDecl->get_name(); 234 output << kind; 235 genAttributes( aggDecl->attributes ); 236 output << aggDecl->name; 217 237 218 238 if ( aggDecl->has_body() ) { 219 std::list< Declaration * > & memb = aggDecl-> get_members();239 std::list< Declaration * > & memb = aggDecl->members; 220 240 output << " {" << endl; 221 241 … … 299 319 output << " }"; 300 320 } 321 } 322 323 void CodeGenerator::postvisit( StaticAssertDecl * assertDecl ) { 324 output << "_Static_assert("; 325 assertDecl->condition->accept( *visitor ); 326 output << ", "; 327 assertDecl->message->accept( *visitor ); 328 output << ")"; 301 329 } 302 330 … … 353 381 354 382 void CodeGenerator::postvisit( Constant * constant ) { 355 output << constant->get_value() 383 output << constant->get_value(); 356 384 } 357 385 … … 570 598 output << "("; 571 599 if ( castExpr->get_result()->isVoid() ) { 572 output << "(void)" 600 output << "(void)"; 573 601 } else { 574 602 // at least one result type of cast. … … 579 607 output << ")"; 580 608 } // if 581 castExpr->get_arg()->accept( *visitor ); 609 castExpr->arg->accept( *visitor ); 610 output << ")"; 611 } 612 613 void CodeGenerator::postvisit( KeywordCastExpr * castExpr ) { 614 assertf( ! genC, "KeywordCast should not reach code generation." ); 615 extension( castExpr ); 616 output << "((" << castExpr->targetString() << " &)"; 617 castExpr->arg->accept( *visitor ); 582 618 output << ")"; 583 619 } … … 764 800 765 801 void CodeGenerator::postvisit( StmtExpr * stmtExpr ) { 766 std::list< Statement * > & stmts = stmtExpr-> get_statements()->get_kids();802 std::list< Statement * > & stmts = stmtExpr->statements->kids; 767 803 output << "({" << endl; 768 804 ++indent; … … 775 811 // cannot cast to void, otherwise the expression statement has no value 776 812 if ( ExprStmt * exprStmt = dynamic_cast< ExprStmt * >( stmt ) ) { 777 exprStmt-> get_expr()->accept( *visitor );813 exprStmt->expr->accept( *visitor ); 778 814 output << ";" << endl; 779 815 ++i; … … 796 832 expr->callExpr->accept( *visitor ); 797 833 } 834 835 void CodeGenerator::postvisit( DeletedExpr * expr ) { 836 assertf( ! genC, "Deleted expressions should not reach code generation." ); 837 expr->expr->accept( *visitor ); 838 } 839 840 void CodeGenerator::postvisit( DefaultArgExpr * arg ) { 841 assertf( ! genC, "Default argument expressions should not reach code generation." ); 842 arg->expr->accept( *visitor ); 843 } 844 845 void CodeGenerator::postvisit( GenericExpr * expr ) { 846 assertf( ! genC, "C11 _Generic expressions should not reach code generation." ); 847 output << "_Generic("; 848 expr->control->accept( *visitor ); 849 output << ", "; 850 unsigned int numAssocs = expr->associations.size(); 851 unsigned int i = 0; 852 for ( GenericExpr::Association & assoc : expr->associations ) { 853 if (assoc.isDefault) { 854 output << "default: "; 855 } else { 856 output << genType( assoc.type, "", pretty, genC ) << ": "; 857 } 858 assoc.expr->accept( *visitor ); 859 if ( i+1 != numAssocs ) { 860 output << ", "; 861 } 862 i++; 863 } 864 output << ")"; 865 } 866 798 867 799 868 // *** Statements … … 848 917 } // for 849 918 } // if 850 output << " );" 919 output << " );"; 851 920 } 852 921 … … 856 925 output << "( "; 857 926 if ( asmStmt->get_instruction() ) asmStmt->get_instruction()->accept( *visitor ); 858 output << " )" ; 927 output << " )"; 928 } 929 930 void CodeGenerator::postvisit( DirectiveStmt * dirStmt ) { 931 output << endl << dirStmt->directive; // endl prevents spaces before directive 859 932 } 860 933 … … 873 946 874 947 void CodeGenerator::postvisit( SwitchStmt * switchStmt ) { 875 output << "switch ( " 948 output << "switch ( "; 876 949 switchStmt->get_condition()->accept( *visitor ); 877 950 output << " ) "; … … 899 972 ++indent; 900 973 for ( std::list<Statement *>::iterator i = sts.begin(); i != sts.end(); i++) { 901 output << indent << printLabels( (*i)->get_labels() ) 974 output << indent << printLabels( (*i)->get_labels() ) ; 902 975 (*i)->accept( *visitor ); 903 976 output << endl; … … 924 997 output << "continue"; 925 998 break; 999 case BranchStmt::FallThrough: 1000 case BranchStmt::FallThroughDefault: 1001 assertf( ! genC, "fallthru should not reach code generation." ); 1002 output << "fallthru"; 1003 break; 926 1004 } // switch 1005 // print branch target for labelled break/continue/fallthru in debug mode 1006 if ( ! genC && branchStmt->get_type() != BranchStmt::Goto ) { 1007 if ( ! branchStmt->get_target().empty() ) { 1008 output << " " << branchStmt->get_target(); 1009 } else if ( branchStmt->get_type() == BranchStmt::FallThrough ) { 1010 output << " default"; 1011 } 1012 } 927 1013 output << ";"; 928 1014 } … … 1023 1109 void CodeGenerator::postvisit( WhileStmt * whileStmt ) { 1024 1110 if ( whileStmt->get_isDoWhile() ) { 1025 output << "do" 1111 output << "do"; 1026 1112 } else { 1027 output << "while (" 1113 output << "while ("; 1028 1114 whileStmt->get_condition()->accept( *visitor ); 1029 1115 output << ")"; … … 1037 1123 1038 1124 if ( whileStmt->get_isDoWhile() ) { 1039 output << " while (" 1125 output << " while ("; 1040 1126 whileStmt->get_condition()->accept( *visitor ); 1041 1127 output << ");"; -
src/CodeGen/CodeGenerator.h
rf9feab8 r90152a4 27 27 28 28 namespace CodeGen { 29 struct CodeGenerator : public WithShortCircuiting, public With VisitorRef<CodeGenerator> {29 struct CodeGenerator : public WithShortCircuiting, public WithGuards, public WithVisitorRef<CodeGenerator> { 30 30 static int tabsize; 31 31 32 CodeGenerator( std::ostream &os, bool pretty = false, bool genC = false, bool lineMarks = false );32 CodeGenerator( std::ostream &os, bool pretty = false, bool genC = false, bool lineMarks = false, bool printExprTypes = false ); 33 33 34 34 //*** Turn off visit_children for all nodes … … 38 38 void postvisit( BaseSyntaxNode * ); 39 39 40 //*** print type for all expressions 41 void previsit( Expression * node ); 42 40 43 //*** Declaration 41 44 void postvisit( StructDecl * ); 42 45 void postvisit( FunctionDecl * ); 43 46 void postvisit( ObjectDecl * ); 44 void postvisit( UnionDecl *aggregateDecl ); 45 void postvisit( EnumDecl *aggregateDecl ); 46 void postvisit( TraitDecl *aggregateDecl ); 47 void postvisit( TypedefDecl *typeDecl ); 48 void postvisit( TypeDecl *typeDecl ); 47 void postvisit( UnionDecl * aggregateDecl ); 48 void postvisit( EnumDecl * aggregateDecl ); 49 void postvisit( TraitDecl * aggregateDecl ); 50 void postvisit( TypedefDecl * typeDecl ); 51 void postvisit( TypeDecl * typeDecl ); 52 void postvisit( StaticAssertDecl * assertDecl ); 49 53 50 54 //*** Initializer … … 65 69 void postvisit( LabelAddressExpr *addressExpr ); 66 70 void postvisit( CastExpr *castExpr ); 71 void postvisit( KeywordCastExpr * castExpr ); 67 72 void postvisit( VirtualCastExpr *castExpr ); 68 73 void postvisit( UntypedMemberExpr *memberExpr ); … … 88 93 void postvisit( StmtExpr * ); 89 94 void postvisit( ConstructorExpr * ); 95 void postvisit( DeletedExpr * ); 96 void postvisit( DefaultArgExpr * ); 97 void postvisit( GenericExpr * ); 90 98 91 99 //*** Statements … … 93 101 void postvisit( ExprStmt * ); 94 102 void postvisit( AsmStmt * ); 103 void postvisit( DirectiveStmt * ); 95 104 void postvisit( AsmDecl * ); // special: statement in declaration context 96 105 void postvisit( IfStmt * ); … … 138 147 bool genC = false; // true if output has to be C code 139 148 bool lineMarks = false; 149 bool printExprTypes = false; 140 150 public: 141 151 LineEnder endl; -
src/CodeGen/FixMain.cc
rf9feab8 r90152a4 23 23 24 24 #include "Common/SemanticError.h" // for SemanticError 25 #include "CodeGen/GenType.h" // for GenType 25 26 #include "SynTree/Declaration.h" // for FunctionDecl, operator<< 26 27 #include "SynTree/Type.h" // for FunctionType … … 30 31 std::unique_ptr<FunctionDecl> FixMain::main_signature = nullptr; 31 32 33 template<typename container> 34 std::string genTypeAt(const container& p, size_t idx) { 35 return genType((*std::next(p.begin(), idx))->get_type(), ""); 36 } 37 32 38 void FixMain::registerMain(FunctionDecl* functionDecl) 33 39 { 34 40 if(main_signature) { 35 throw SemanticError("Multiple definition of main routine\n", functionDecl);41 SemanticError(functionDecl, "Multiple definition of main routine\n"); 36 42 } 37 43 main_signature.reset( functionDecl->clone() ); … … 43 49 44 50 os << main_signature->get_scopedMangleName() << "("; 45 switch(main_signature->get_functionType()->get_parameters().size()) { 46 case 3: os << "argc, argv, envp"; break; 47 case 2: os << "argc, argv"; break; 51 const auto& params = main_signature->get_functionType()->get_parameters(); 52 switch(params.size()) { 53 case 3: os << "(" << genTypeAt(params, 0) << ")argc, (" << genTypeAt(params, 1) << ")argv, (" << genTypeAt(params, 2) << ")envp"; break; 54 case 2: os << "(" << genTypeAt(params, 0) << ")argc, (" << genTypeAt(params, 1) << ")argv"; break; 48 55 case 0: break; 49 56 default : assert(false); -
src/CodeGen/FixNames.cc
rf9feab8 r90152a4 56 56 auto && name = SymTab::Mangler::mangle( mainDecl.get() ); 57 57 // std::cerr << name << std::endl; 58 return name;58 return std::move(name); 59 59 } 60 60 std::string mangle_main_args() { … … 79 79 auto&& name = SymTab::Mangler::mangle( mainDecl.get() ); 80 80 // std::cerr << name << std::endl; 81 return name;81 return std::move(name); 82 82 } 83 83 … … 118 118 int nargs = functionDecl->get_functionType()->get_parameters().size(); 119 119 if( !(nargs == 0 || nargs == 2 || nargs == 3) ) { 120 throw SemanticError("Main expected to have 0, 2 or 3 arguments\n", functionDecl);120 SemanticError(functionDecl, "Main expected to have 0, 2 or 3 arguments\n"); 121 121 } 122 122 functionDecl->get_statements()->get_kids().push_back( new ReturnStmt( new ConstantExpr( Constant::from_int( 0 ) ) ) ); -
src/CodeGen/GenType.cc
rf9feab8 r90152a4 26 26 27 27 namespace CodeGen { 28 class GenType : public Visitor { 29 public: 30 GenType( const std::string &typeString, bool pretty = false, bool genC = false, bool lineMarks = false ); 31 std::string get_typeString() const { return typeString; } 32 void set_typeString( const std::string &newValue ) { typeString = newValue; } 33 34 virtual void visit( FunctionType *funcType ); 35 virtual void visit( VoidType *voidType ); 36 virtual void visit( BasicType *basicType ); 37 virtual void visit( PointerType *pointerType ); 38 virtual void visit( ArrayType *arrayType ); 39 virtual void visit( ReferenceType *refType ); 40 virtual void visit( StructInstType *structInst ); 41 virtual void visit( UnionInstType *unionInst ); 42 virtual void visit( EnumInstType *enumInst ); 43 virtual void visit( TypeInstType *typeInst ); 44 virtual void visit( TupleType * tupleType ); 45 virtual void visit( VarArgsType *varArgsType ); 46 virtual void visit( ZeroType *zeroType ); 47 virtual void visit( OneType *oneType ); 28 struct GenType : public WithVisitorRef<GenType>, public WithShortCircuiting { 29 std::string typeString; 30 GenType( const std::string &typeString, bool pretty, bool genC, bool lineMarks ); 31 32 void previsit( BaseSyntaxNode * ); 33 void postvisit( BaseSyntaxNode * ); 34 35 void postvisit( FunctionType * funcType ); 36 void postvisit( VoidType * voidType ); 37 void postvisit( BasicType * basicType ); 38 void postvisit( PointerType * pointerType ); 39 void postvisit( ArrayType * arrayType ); 40 void postvisit( ReferenceType * refType ); 41 void postvisit( StructInstType * structInst ); 42 void postvisit( UnionInstType * unionInst ); 43 void postvisit( EnumInstType * enumInst ); 44 void postvisit( TypeInstType * typeInst ); 45 void postvisit( TupleType * tupleType ); 46 void postvisit( VarArgsType * varArgsType ); 47 void postvisit( ZeroType * zeroType ); 48 void postvisit( OneType * oneType ); 49 void postvisit( GlobalScopeType * globalType ); 50 void postvisit( TraitInstType * inst ); 51 void postvisit( TypeofType * typeof ); 52 void postvisit( QualifiedType * qualType ); 48 53 49 54 private: … … 52 57 void genArray( const Type::Qualifiers &qualifiers, Type *base, Expression *dimension, bool isVarLen, bool isStatic ); 53 58 54 std::string typeString; 55 bool pretty = false; // pretty print 56 bool genC = false; // generating C code? 57 bool lineMarks = false; 59 bool pretty = false; // pretty print 60 bool genC = false; // generating C code? 61 bool lineMarks = false; // lineMarks on for CodeGenerator? 58 62 }; 59 63 60 64 std::string genType( Type *type, const std::string &baseString, bool pretty, bool genC , bool lineMarks ) { 61 GenTypegt( baseString, pretty, genC, lineMarks );65 PassVisitor<GenType> gt( baseString, pretty, genC, lineMarks ); 62 66 std::ostringstream os; 63 67 … … 68 72 69 73 type->accept( gt ); 70 return os.str() + gt. get_typeString();74 return os.str() + gt.pass.typeString; 71 75 } 72 76 … … 77 81 GenType::GenType( const std::string &typeString, bool pretty, bool genC, bool lineMarks ) : typeString( typeString ), pretty( pretty ), genC( genC ), lineMarks( lineMarks ) {} 78 82 79 void GenType::visit( VoidType *voidType ) { 83 // *** BaseSyntaxNode 84 void GenType::previsit( BaseSyntaxNode * ) { 85 // turn off automatic recursion for all nodes, to allow each visitor to 86 // precisely control the order in which its children are visited. 87 visit_children = false; 88 } 89 90 void GenType::postvisit( BaseSyntaxNode * node ) { 91 std::stringstream ss; 92 node->print( ss ); 93 assertf( false, "Unhandled node reached in GenType: %s", ss.str().c_str() ); 94 } 95 96 void GenType::postvisit( VoidType * voidType ) { 80 97 typeString = "void " + typeString; 81 98 handleQualifiers( voidType ); 82 99 } 83 100 84 void GenType:: visit( BasicType *basicType ) {85 BasicType::Kind kind = basicType-> get_kind();101 void GenType::postvisit( BasicType * basicType ) { 102 BasicType::Kind kind = basicType->kind; 86 103 assert( 0 <= kind && kind < BasicType::NUMBER_OF_BASIC_TYPES ); 87 104 typeString = std::string( BasicType::typeNames[kind] ) + " " + typeString; … … 89 106 } 90 107 91 void GenType::genArray( const Type::Qualifiers & qualifiers, Type *base, Expression *dimension, bool isVarLen, bool isStatic ) {108 void GenType::genArray( const Type::Qualifiers & qualifiers, Type * base, Expression *dimension, bool isVarLen, bool isStatic ) { 92 109 std::ostringstream os; 93 110 if ( typeString != "" ) { … … 126 143 typeString = os.str(); 127 144 128 base->accept( * this);129 } 130 131 void GenType:: visit( PointerType *pointerType ) {132 assert( pointerType-> get_base()!= 0);133 if ( pointerType->get_isStatic() || pointerType->get_isVarLen() || pointerType-> get_dimension()) {134 genArray( pointerType->get_qualifiers(), pointerType-> get_base(), pointerType->get_dimension(), pointerType->get_isVarLen(), pointerType->get_isStatic() );145 base->accept( *visitor ); 146 } 147 148 void GenType::postvisit( PointerType * pointerType ) { 149 assert( pointerType->base != 0); 150 if ( pointerType->get_isStatic() || pointerType->get_isVarLen() || pointerType->dimension ) { 151 genArray( pointerType->get_qualifiers(), pointerType->base, pointerType->dimension, pointerType->get_isVarLen(), pointerType->get_isStatic() ); 135 152 } else { 136 153 handleQualifiers( pointerType ); … … 140 157 typeString = "*" + typeString; 141 158 } // if 142 pointerType-> get_base()->accept( *this);143 } // if 144 } 145 146 void GenType:: visit( ArrayType *arrayType ) {147 genArray( arrayType->get_qualifiers(), arrayType-> get_base(), arrayType->get_dimension(), arrayType->get_isVarLen(), arrayType->get_isStatic() );148 } 149 150 void GenType:: visit( ReferenceType *refType ) {151 assert( refType-> get_base()!= 0);159 pointerType->base->accept( *visitor ); 160 } // if 161 } 162 163 void GenType::postvisit( ArrayType * arrayType ) { 164 genArray( arrayType->get_qualifiers(), arrayType->base, arrayType->dimension, arrayType->get_isVarLen(), arrayType->get_isStatic() ); 165 } 166 167 void GenType::postvisit( ReferenceType * refType ) { 168 assert( refType->base != 0); 152 169 assertf( ! genC, "Reference types should not reach code generation." ); 153 170 handleQualifiers( refType ); 154 171 typeString = "&" + typeString; 155 refType-> get_base()->accept( *this);156 } 157 158 void GenType:: visit( FunctionType *funcType ) {172 refType->base->accept( *visitor ); 173 } 174 175 void GenType::postvisit( FunctionType * funcType ) { 159 176 std::ostringstream os; 160 177 … … 169 186 /************* parameters ***************/ 170 187 171 const std::list<DeclarationWithType *> &pars = funcType-> get_parameters();188 const std::list<DeclarationWithType *> &pars = funcType->parameters; 172 189 173 190 if ( pars.empty() ) { … … 191 208 typeString = os.str(); 192 209 193 if ( funcType-> get_returnVals().size() == 0 ) {210 if ( funcType->returnVals.size() == 0 ) { 194 211 typeString = "void " + typeString; 195 212 } else { 196 funcType-> get_returnVals().front()->get_type()->accept( *this);213 funcType->returnVals.front()->get_type()->accept( *visitor ); 197 214 } // if 198 215 199 216 // add forall 200 if( ! funcType-> get_forall().empty() && ! genC ) {217 if( ! funcType->forall.empty() && ! genC ) { 201 218 // assertf( ! genC, "Aggregate type parameters should not reach code generation." ); 202 219 std::ostringstream os; 203 220 PassVisitor<CodeGenerator> cg( os, pretty, genC, lineMarks ); 204 221 os << "forall("; 205 cg.pass.genCommaList( funcType-> get_forall().begin(), funcType->get_forall().end() );222 cg.pass.genCommaList( funcType->forall.begin(), funcType->forall.end() ); 206 223 os << ")" << std::endl; 207 224 typeString = os.str() + typeString; … … 221 238 } 222 239 223 void GenType:: visit( StructInstType *structInst ) {224 typeString = structInst-> get_name()+ handleGeneric( structInst ) + " " + typeString;240 void GenType::postvisit( StructInstType * structInst ) { 241 typeString = structInst->name + handleGeneric( structInst ) + " " + typeString; 225 242 if ( genC ) typeString = "struct " + typeString; 226 243 handleQualifiers( structInst ); 227 244 } 228 245 229 void GenType:: visit( UnionInstType *unionInst ) {230 typeString = unionInst-> get_name()+ handleGeneric( unionInst ) + " " + typeString;246 void GenType::postvisit( UnionInstType * unionInst ) { 247 typeString = unionInst->name + handleGeneric( unionInst ) + " " + typeString; 231 248 if ( genC ) typeString = "union " + typeString; 232 249 handleQualifiers( unionInst ); 233 250 } 234 251 235 void GenType:: visit( EnumInstType *enumInst ) {236 typeString = enumInst-> get_name()+ " " + typeString;252 void GenType::postvisit( EnumInstType * enumInst ) { 253 typeString = enumInst->name + " " + typeString; 237 254 if ( genC ) typeString = "enum " + typeString; 238 255 handleQualifiers( enumInst ); 239 256 } 240 257 241 void GenType:: visit( TypeInstType *typeInst ) {242 typeString = typeInst-> get_name()+ " " + typeString;258 void GenType::postvisit( TypeInstType * typeInst ) { 259 typeString = typeInst->name + " " + typeString; 243 260 handleQualifiers( typeInst ); 244 261 } 245 262 246 void GenType:: visit( TupleType * tupleType ) {263 void GenType::postvisit( TupleType * tupleType ) { 247 264 assertf( ! genC, "Tuple types should not reach code generation." ); 248 265 unsigned int i = 0; … … 257 274 } 258 275 259 void GenType:: visit( VarArgsType *varArgsType ) {276 void GenType::postvisit( VarArgsType * varArgsType ) { 260 277 typeString = "__builtin_va_list " + typeString; 261 278 handleQualifiers( varArgsType ); 262 279 } 263 280 264 void GenType:: visit( ZeroType *zeroType ) {281 void GenType::postvisit( ZeroType * zeroType ) { 265 282 // ideally these wouldn't hit codegen at all, but should be safe to make them ints 266 283 typeString = (pretty ? "zero_t " : "long int ") + typeString; … … 268 285 } 269 286 270 void GenType:: visit( OneType *oneType ) {287 void GenType::postvisit( OneType * oneType ) { 271 288 // ideally these wouldn't hit codegen at all, but should be safe to make them ints 272 289 typeString = (pretty ? "one_t " : "long int ") + typeString; … … 274 291 } 275 292 276 void GenType::handleQualifiers( Type *type ) { 293 void GenType::postvisit( GlobalScopeType * globalType ) { 294 assertf( ! genC, "Global scope type should not reach code generation." ); 295 handleQualifiers( globalType ); 296 } 297 298 void GenType::postvisit( TraitInstType * inst ) { 299 assertf( ! genC, "Trait types should not reach code generation." ); 300 typeString = inst->name + " " + typeString; 301 handleQualifiers( inst ); 302 } 303 304 void GenType::postvisit( TypeofType * typeof ) { 305 std::ostringstream os; 306 PassVisitor<CodeGenerator> cg( os, pretty, genC, lineMarks ); 307 os << "typeof("; 308 typeof->expr->accept( cg ); 309 os << ") " << typeString; 310 typeString = os.str(); 311 handleQualifiers( typeof ); 312 } 313 314 void GenType::postvisit( QualifiedType * qualType ) { 315 assertf( ! genC, "Qualified types should not reach code generation." ); 316 std::ostringstream os; 317 os << genType( qualType->parent, "", pretty, genC, lineMarks ) << "." << genType( qualType->child, "", pretty, genC, lineMarks ) << typeString; 318 typeString = os.str(); 319 handleQualifiers( qualType ); 320 } 321 322 void GenType::handleQualifiers( Type * type ) { 277 323 if ( type->get_const() ) { 278 324 typeString = "const " + typeString; -
src/CodeGen/Generate.cc
rf9feab8 r90152a4 46 46 } // namespace 47 47 48 void generate( std::list< Declaration* > translationUnit, std::ostream &os, bool doIntrinsics, bool pretty, bool generateC, bool lineMarks ) {48 void generate( std::list< Declaration* > translationUnit, std::ostream &os, bool doIntrinsics, bool pretty, bool generateC, bool lineMarks, bool printExprTypes ) { 49 49 cleanTree( translationUnit ); 50 50 51 PassVisitor<CodeGenerator> cgv( os, pretty, generateC, lineMarks );51 PassVisitor<CodeGenerator> cgv( os, pretty, generateC, lineMarks, printExprTypes ); 52 52 for ( auto & dcl : translationUnit ) { 53 53 if ( LinkageSpec::isGeneratable( dcl->get_linkage() ) && (doIntrinsics || ! LinkageSpec::isBuiltin( dcl->get_linkage() ) ) ) { … … 66 66 os << CodeGen::genPrettyType( type, "" ); 67 67 } else { 68 PassVisitor<CodeGenerator> cgv( os, true, false, false );68 PassVisitor<CodeGenerator> cgv( os, true, false, false, false ); 69 69 node->accept( cgv ); 70 70 } -
src/CodeGen/Generate.h
rf9feab8 r90152a4 24 24 namespace CodeGen { 25 25 /// Generates code. doIntrinsics determines if intrinsic functions are printed, pretty formats output nicely (e.g., uses unmangled names, etc.), generateC is true when the output must consist only of C code (allows some assertions, etc.) 26 void generate( std::list< Declaration* > translationUnit, std::ostream &os, bool doIntrinsics, bool pretty, bool generateC = false , bool lineMarks = false );26 void generate( std::list< Declaration* > translationUnit, std::ostream &os, bool doIntrinsics, bool pretty, bool generateC = false , bool lineMarks = false, bool printTypeExpr = false ); 27 27 28 28 /// Generate code for a single node -- helpful for debugging in gdb -
src/CodeGen/OperatorTable.cc
rf9feab8 r90152a4 79 79 } // namespace 80 80 81 bool operatorLookup( std::string funcName, OperatorInfo &info ) {81 bool operatorLookup( const std::string & funcName, OperatorInfo & info ) { 82 82 static bool init = false; 83 83 if ( ! init ) { … … 100 100 return true; 101 101 } // if 102 } 103 104 bool isOperator( const std::string & funcName ) { 105 OperatorInfo info; 106 return operatorLookup( funcName, info ); 102 107 } 103 108 -
src/CodeGen/OperatorTable.h
rf9feab8 r90152a4 41 41 }; 42 42 43 bool operatorLookup( std::string funcName, OperatorInfo &info ); 43 bool isOperator( const std::string & funcName ); 44 bool operatorLookup( const std::string & funcName, OperatorInfo & info ); 44 45 45 46 bool isConstructor( const std::string & ); -
src/CodeTools/DeclStats.cc
rf9feab8 r90152a4 23 23 #include <utility> // for pair, make_pair 24 24 25 #include "Common/ SemanticError.h" // for SemanticError25 #include "Common/PassVisitor.h" 26 26 #include "Common/VectorMap.h" // for VectorMap 27 27 #include "GenPoly/GenPoly.h" // for hasPolyBase … … 35 35 namespace CodeTools { 36 36 37 class DeclStats : public Visitor{37 struct DeclStats : public WithShortCircuiting { 38 38 template<typename T> 39 39 static void sum(T& a, const T& b) { a += b; } … … 61 61 62 62 struct ArgPackStats { 63 VectorMap<unsigned> n; ///< Count of decls with each number of elements 64 VectorMap<unsigned> n_basic; ///< Count of decls with each number of basic type elements 65 VectorMap<unsigned> n_poly; ///< Count of decls with each number of polymorphic elements 66 std::map<unsigned, unsigned> p_basic; ///< Count of decls with each percentage of basic type elements 67 std::map<unsigned, unsigned> p_poly; ///< Count of decls with each percentage of polymorphic elements 68 VectorMap<unsigned> n_types; ///< Count of decls with each number of distinct types in the pack 63 VectorMap<unsigned> n; ///< Count of decls with each number of elements 64 VectorMap<unsigned> n_basic; ///< Count of decls with each number of basic type elements 65 VectorMap<unsigned> n_generic; ///< Count of decls with each number of generic type elements 66 VectorMap<unsigned> n_poly; ///< Count of decls with each number of polymorphic elements 67 VectorMap<unsigned> n_compound; ///< Count of decls with each number of non-generic compound types 68 std::map<unsigned, unsigned> p_basic; ///< Count of decls with each percentage of basic type elements 69 std::map<unsigned, unsigned> p_generic; ///< Count of decls with each percentage of generic type elements 70 std::map<unsigned, unsigned> p_poly; ///< Count of decls with each percentage of polymorphic elements 71 std::map<unsigned, unsigned> p_compound; ///< Count of decls with each percentage of non-generic compound type elements 72 VectorMap<unsigned> n_types; ///< Count of decls with each number of distinct types in the pack 69 73 /// Count of decls with each percentage of new types in lists. 70 74 /// Types used in the parameter list that recur in the return list are not considered to be new. … … 74 78 sum(n, o.n); 75 79 sum(n_basic, o.n_basic); 80 sum(n_generic, o.n_generic); 76 81 sum(n_poly, o.n_poly); 82 sum(n_compound, o.n_compound); 77 83 sum(p_basic, o.p_basic); 84 sum(p_generic, o.p_generic); 78 85 sum(p_poly, o.p_poly); 86 sum(p_compound, o.p_compound); 79 87 sum(n_types, o.n_types); 80 88 sum(p_new, o.p_new); … … 88 96 /// Count of declarations with each number of assertion parameters 89 97 VectorMap<unsigned> n_type_params; 98 /// Count of generic types with each number of type parameters 99 VectorMap<unsigned> n_generic_params; 100 /// Count of maximum nesting depth of types 101 VectorMap<unsigned> n_generic_nesting; 90 102 /// Count of declarations with each name 91 103 std::unordered_map<std::string, unsigned> by_name; 92 104 /// Count of uses of each basic type 93 105 std::unordered_map<std::string, unsigned> basic_type_names; 94 /// Count of uses of each non-basic type 106 /// Count of uses of each generic type name (includes "*", "[]", "(*)", "[,]") 107 std::unordered_map<std::string, unsigned> generic_type_names; 108 /// Count of uses of each non-generic aggregate type 95 109 std::unordered_map<std::string, unsigned> compound_type_names; 96 110 /// Count of decls using each basic type 97 111 std::unordered_map<std::string, unsigned> basic_type_decls; 112 /// Count of decls using each generic type (includes "*", "[]", "(*)", "[,]") 113 std::unordered_map<std::string, unsigned> generic_type_decls; 98 114 /// Count of decls using each compound type 99 115 std::unordered_map<std::string, unsigned> compound_type_decls; … … 110 126 ArgPackStats assn_returns; 111 127 112 Stats() : n_decls(0), n_type_params(), by_name(), basic_type_names(), compound_type_names(), basic_type_decls(), compound_type_decls(), params(), returns(), n_assns(), assn_params(), assn_returns() {} 128 Stats() : n_decls(0), n_type_params(), n_generic_params(), n_generic_nesting(), 129 by_name(), basic_type_names(), generic_type_names(), compound_type_names(), 130 basic_type_decls(), generic_type_decls(), compound_type_decls(), params(), 131 returns(), n_assns(), assn_params(), assn_returns() {} 113 132 114 133 public: … … 116 135 sum( n_decls, o.n_decls ); 117 136 sum( n_type_params, o.n_type_params ); 137 sum( n_generic_params, o.n_generic_params ); 138 sum( n_generic_nesting, o.n_generic_nesting ); 118 139 sum( by_name, o.by_name ); 119 140 sum( basic_type_names, o.basic_type_names ); 141 sum( generic_type_names, o.generic_type_names ); 120 142 sum( compound_type_names, o.compound_type_names ); 121 143 sum( basic_type_decls, o.basic_type_decls ); 144 sum( generic_type_decls, o.generic_type_decls ); 122 145 sum( compound_type_decls, o.compound_type_decls ); 123 146 sum( params, o.params ); … … 131 154 }; 132 155 133 Stats for_linkage[LinkageSpec::NoOfSpecs]; ///< Stores separate stats per linkage 156 /// number of counting bins for linkages 157 static const unsigned n_named_specs = 8; 158 /// map from total number of specs to bins 159 static const unsigned ind_for_linkage[16]; 160 161 Stats for_linkage[n_named_specs]; ///< Stores separate stats per linkage 134 162 std::unordered_set<std::string> seen_names; ///< Stores manglenames already seen to avoid double-counting 135 163 Stats total; … … 137 165 std::map<std::pair<unsigned, unsigned>, unsigned> exprs_by_fanout_at_depth; 138 166 167 void countType( const std::string& name, unsigned& n, std::unordered_map<std::string, 168 unsigned>& names, std::unordered_map<std::string, unsigned>& decls, 169 std::unordered_set<std::string>& elSeen ) { 170 ++n; 171 ++names[ name ]; 172 if ( elSeen.insert( name ).second ) { ++decls[ name ]; } 173 } 174 175 void update_max( unsigned& max, unsigned crnt ) { 176 if ( crnt > max ) max = crnt; 177 } 178 179 void analyzeSubtype( Type* ty, Stats& stats, std::unordered_set<std::string>& elSeen, 180 unsigned& n_poly, bool& seen_poly, unsigned& max_depth, unsigned depth ) { 181 unsigned x; 182 analyzeType( ty, stats, elSeen, x, x, n_poly, x, seen_poly, max_depth, depth + 1 ); 183 } 184 185 void analyzeSubtypes( std::list<DeclarationWithType*>& tys, Stats& stats, 186 std::unordered_set<std::string>& elSeen, unsigned& n_poly, bool& seen_poly, 187 unsigned& max_depth, unsigned depth, unsigned& n_subs ) { 188 for ( DeclarationWithType* dwt : tys ) { 189 Type* ty = dwt->get_type(); 190 n_subs += (unsigned)( dynamic_cast<VoidType*>(ty) != nullptr ); 191 analyzeSubtype( ty, stats, elSeen, n_poly, seen_poly, max_depth, depth ); 192 } 193 } 194 195 void analyzeSubtypes( std::list<Expression*>& tys, Stats& stats, 196 std::unordered_set<std::string>& elSeen, unsigned& n_poly, bool& seen_poly, 197 unsigned& max_depth, unsigned depth ) { 198 for ( Expression* expr : tys ) { 199 TypeExpr* texpr = dynamic_cast<TypeExpr*>(expr); 200 if ( ! texpr ) continue; 201 Type* ty = texpr->get_type(); 202 analyzeSubtype( ty, stats, elSeen, n_poly, seen_poly, max_depth, depth ); 203 } 204 } 205 206 void analyzeSubtypes( std::list<Type*>& tys, Stats& stats, 207 std::unordered_set<std::string>& elSeen, unsigned& n_poly, bool& seen_poly, 208 unsigned& max_depth, unsigned depth ) { 209 for ( Type* ty : tys ) { 210 analyzeSubtype( ty, stats, elSeen, n_poly, seen_poly, max_depth, depth ); 211 } 212 } 213 214 void analyzeType( Type* ty, Stats& stats, std::unordered_set<std::string>& elSeen, 215 unsigned& n_basic, unsigned& n_generic, unsigned& n_poly, unsigned& n_agg, 216 bool& seen_poly, unsigned& max_depth, unsigned depth = 0 ) { 217 if ( BasicType* bt = dynamic_cast<BasicType*>(ty) ) { 218 std::string name = BasicType::typeNames[ bt->get_kind() ]; 219 countType( name, n_basic, stats.basic_type_names, stats.basic_type_decls, elSeen ); 220 update_max( max_depth, depth ); 221 } else if ( PointerType* pt = dynamic_cast<PointerType*>(ty) ) { 222 std::string name = "*"; 223 countType( 224 name, n_generic, stats.generic_type_names, stats.generic_type_decls, elSeen); 225 analyzeSubtype( 226 pt->get_base(), stats, elSeen, n_poly, seen_poly, max_depth, depth ); 227 ++stats.n_generic_params.at( 1 ); 228 } else if ( ArrayType* at = dynamic_cast<ArrayType*>(ty) ) { 229 std::string name = "[]"; 230 countType( 231 name, n_generic, stats.generic_type_names, stats.generic_type_decls, elSeen); 232 analyzeSubtype( 233 at->get_base(), stats, elSeen, n_poly, seen_poly, max_depth, depth ); 234 ++stats.n_generic_params.at( 1 ); 235 } else if ( ReferenceType* rt = dynamic_cast<ReferenceType*>(ty) ) { 236 std::string name = "&"; 237 countType( 238 name, n_generic, stats.generic_type_names, stats.generic_type_decls, elSeen); 239 analyzeSubtype( 240 rt->get_base(), stats, elSeen, n_poly, seen_poly, max_depth, depth ); 241 ++stats.n_generic_params.at( 1 ); 242 } else if ( FunctionType* ft = dynamic_cast<FunctionType*>(ty) ) { 243 std::string name = "(*)"; 244 countType( 245 name, n_generic, stats.generic_type_names, stats.generic_type_decls, elSeen); 246 unsigned n_subs = 0; 247 analyzeSubtypes( 248 ft->get_returnVals(), stats, elSeen, n_poly, seen_poly, max_depth, depth, 249 n_subs ); 250 analyzeSubtypes( 251 ft->get_parameters(), stats, elSeen, n_poly, seen_poly, max_depth, depth, 252 n_subs ); 253 ++stats.n_generic_params.at( n_subs ); 254 } else if ( TypeInstType* vt = dynamic_cast<TypeInstType*>(ty) ) { 255 if ( ! seen_poly ) { 256 ++n_poly; 257 seen_poly = true; 258 } 259 countType( 260 vt->get_name(), n_agg, stats.compound_type_names, stats.compound_type_decls, 261 elSeen ); 262 update_max( max_depth, depth ); 263 } else if ( ReferenceToType* st = dynamic_cast<ReferenceToType*>(ty) ) { 264 std::list<Expression*>& params = st->get_parameters(); 265 if ( params.empty() ) { 266 countType( 267 st->get_name(), n_agg, stats.compound_type_names, 268 stats.compound_type_decls, elSeen ); 269 update_max( max_depth, depth ); 270 } else { 271 countType( 272 st->get_name(), n_generic, stats.generic_type_names, 273 stats.generic_type_decls, elSeen); 274 analyzeSubtypes( params, stats, elSeen, n_poly, seen_poly, max_depth, depth ); 275 ++stats.n_generic_params.at( params.size() ); 276 } 277 } else if ( TupleType* tt = dynamic_cast<TupleType*>(ty) ) { 278 std::string name = "[,]"; 279 countType( 280 name, n_generic, stats.generic_type_names, stats.generic_type_decls, elSeen); 281 analyzeSubtypes( 282 tt->get_types(), stats, elSeen, n_poly, seen_poly, max_depth, depth ); 283 ++stats.n_generic_params.at( tt->size() ); 284 } else if ( dynamic_cast<VarArgsType*>(ty) ) { 285 std::string name = "..."; 286 countType( 287 name, n_agg, stats.compound_type_names, stats.compound_type_decls, elSeen ); 288 update_max( max_depth, depth ); 289 } else if ( dynamic_cast<ZeroType*>(ty) ) { 290 std::string name = "0"; 291 countType( name, n_basic, stats.basic_type_names, stats.basic_type_decls, elSeen ); 292 update_max( max_depth, depth ); 293 } else if ( dynamic_cast<OneType*>(ty) ) { 294 std::string name = "1"; 295 countType( name, n_basic, stats.basic_type_names, stats.basic_type_decls, elSeen ); 296 update_max( max_depth, depth ); 297 } 298 } 299 139 300 /// Update arg pack stats based on a declaration list 140 void analyze( Stats& stats, std::unordered_set<std::string>& seen, ArgPackStats& pstats, std::list<DeclarationWithType*>& decls ) { 301 void analyze( Stats& stats, std::unordered_set<std::string>& seen, 302 std::unordered_set<std::string>& elSeen, ArgPackStats& pstats, 303 std::list<DeclarationWithType*>& decls ) { 141 304 std::unordered_set<std::string> types; 142 unsigned n = 0; ///< number of args/returns 143 unsigned n_basic = 0; ///< number of basic types 144 unsigned n_poly = 0; ///< number of polymorphic types 145 unsigned n_new = 0; ///< number of new types 305 unsigned n = 0; ///< number of args/returns 306 unsigned n_basic = 0; ///< number of basic types 307 unsigned n_generic = 0; ///< number of generic types (includes "*", "&", "[]", "(*)", "[,]") 308 unsigned n_poly = 0; ///< number of polymorphic types 309 unsigned n_agg = 0; ///< number of non-generic aggregate types 310 unsigned n_new = 0; ///< number of new types 311 146 312 for ( auto decl : decls ) { 147 313 Type* dt = decl->get_type(); … … 152 318 dt->print( ss ); 153 319 types.insert( ss.str() ); 154 bool this_new = seen.insert( ss.str() ).second; 155 if ( this_new ) { ++n_new; } 156 157 if ( dynamic_cast<BasicType*>( dt ) ) { 158 ++n_basic; 159 ++stats.basic_type_names[ ss.str() ]; 160 if ( this_new ) { 161 ++stats.basic_type_decls[ ss.str() ]; 162 } 163 } else if ( GenPoly::hasPolyBase( dt ) ) { 164 ++n_poly; 165 } else { 166 ++stats.compound_type_names[ ss.str() ]; 167 if ( this_new ) { 168 ++stats.compound_type_decls[ ss.str() ]; 169 } 170 } 171 } 320 if ( seen.insert( ss.str() ).second ) { ++n_new; } 321 322 bool seen_poly = false; 323 unsigned max_depth = 0; 324 analyzeType( 325 dt, stats, elSeen, n_basic, n_generic, n_poly, n_agg, seen_poly, max_depth ); 326 ++stats.n_generic_nesting.at( max_depth ); 327 } 328 172 329 ++pstats.n.at( n ); 173 330 ++pstats.n_basic.at( n_basic ); 331 ++pstats.n_generic.at( n_generic ); 174 332 ++pstats.n_poly.at( n_poly ); 333 ++pstats.n_compound.at( n_agg ); 175 334 if ( n > 0 ) { 176 335 ++pstats.p_basic[ n_basic*100/n ]; 336 ++pstats.p_generic[ n_generic*100/n ]; 177 337 ++pstats.p_poly[ n_poly*100/n ]; 178 ++pstats.p_new[ n_new*100/n ]; 338 ++pstats.p_compound[ n_agg*100/n ]; 339 if ( n > 1 ) ++pstats.p_new[ (n_new-1)*100/(n-1) ]; 179 340 } 180 341 ++pstats.n_types.at( types.size() ); … … 183 344 void analyzeFunc( FunctionType* fnTy, Stats& stats, ArgPackStats& params, ArgPackStats& returns ) { 184 345 std::unordered_set<std::string> seen; 185 analyze( stats, seen, params, fnTy->get_parameters() ); 186 analyze( stats, seen, returns, fnTy->get_returnVals() ); 346 std::unordered_set<std::string> elSeen; 347 analyze( stats, seen, elSeen, params, fnTy->get_parameters() ); 348 analyze( stats, seen, elSeen, returns, fnTy->get_returnVals() ); 187 349 } 188 350 … … 200 362 201 363 public: 202 using Visitor::visit; 203 204 virtual void visit( FunctionDecl *decl ) { 364 void previsit( FunctionDecl *decl ) { 205 365 // skip if already seen declaration for this function 206 const std::string& mangleName = decl->get_mangleName().empty() ? decl->get_name() : decl->get_mangleName(); 207 if ( ! seen_names.insert( mangleName ).second ) { 208 maybeAccept( decl->get_statements(), *this ); 209 return; 210 } 211 212 Stats& stats = for_linkage[ decl->get_linkage() ]; 213 214 ++stats.n_decls; 215 FunctionType* fnTy = decl->get_functionType(); 216 const Type::ForallList& forall = fnTy->get_forall(); 217 ++stats.n_type_params.at( forall.size() ); 218 unsigned n_assns = 0; 219 for ( TypeDecl* fdecl : forall ) { 220 n_assns += fdecl->get_assertions().size(); 221 for ( DeclarationWithType* assn : fdecl->get_assertions() ) { 222 FunctionType *assnTy = 0; 223 if ( ObjectDecl *assnObj = dynamic_cast<ObjectDecl*>(assn) ) { 224 if ( PointerType *ptrTy = dynamic_cast<PointerType*>(assnObj->get_type()) ) { 225 assnTy = dynamic_cast<FunctionType*>(ptrTy->get_base()); 226 } else assnTy = dynamic_cast<FunctionType*>(assnObj->get_type()); 227 } else if ( FunctionDecl *assnDecl = dynamic_cast<FunctionDecl*>(assn) ) { 228 assnTy = assnDecl->get_functionType(); 366 const std::string& mangleName = decl->get_mangleName().empty() ? decl->name : decl->get_mangleName(); 367 if ( seen_names.insert( mangleName ).second ) { 368 Stats& stats = for_linkage[ ind_for_linkage[ decl->linkage ] ]; 369 370 ++stats.n_decls; 371 FunctionType* fnTy = decl->type; 372 const Type::ForallList& forall = fnTy->forall; 373 ++stats.n_type_params.at( forall.size() ); 374 unsigned n_assns = 0; 375 for ( TypeDecl* fdecl : forall ) { 376 n_assns += fdecl->assertions.size(); 377 for ( DeclarationWithType* assn : fdecl->assertions ) { 378 FunctionType *assnTy = nullptr; 379 if ( ObjectDecl *assnObj = dynamic_cast<ObjectDecl*>(assn) ) { 380 if ( PointerType *ptrTy = dynamic_cast<PointerType*>(assnObj->get_type()) ) { 381 assnTy = dynamic_cast<FunctionType*>(ptrTy->base); 382 } else assnTy = dynamic_cast<FunctionType*>(assnObj->get_type()); 383 } else if ( FunctionDecl *assnDecl = dynamic_cast<FunctionDecl*>(assn) ) { 384 assnTy = assnDecl->type; 385 } 386 if ( assnTy ) analyzeFunc( assnTy, stats, stats.assn_params, stats.assn_returns ); 229 387 } 230 if ( assnTy ) analyzeFunc( assnTy, stats, stats.assn_params, stats.assn_returns ); 231 } 232 } 233 ++stats.n_assns[ n_assns ]; 234 235 ++stats.by_name[ decl->get_name() ]; 236 237 analyzeFunc( fnTy, stats, stats.params, stats.returns ); 238 239 // analyze expressions in decl statements 240 maybeAccept( decl->get_statements(), *this ); 241 } 242 243 virtual void visit( UntypedExpr *expr ) { 388 } 389 ++stats.n_assns[ n_assns ]; 390 ++stats.by_name[ decl->name ]; 391 analyzeFunc( fnTy, stats, stats.params, stats.returns ); 392 } 393 } 394 395 void previsit( UntypedExpr *expr ) { 396 visit_children = false; 244 397 analyzeExpr( expr, 0 ); 245 398 } … … 272 425 template<typename F> 273 426 void printAllHisto( const std::string& name, F extract ) { 274 VectorMap<unsigned> histos[ LinkageSpec::NoOfSpecs];427 VectorMap<unsigned> histos[n_named_specs]; 275 428 VectorMap<unsigned> thisto; 276 429 277 430 for ( const auto& entry : extract(total) ) { ++thisto.at( entry.second ); } 278 431 279 for ( unsigned i = 0; i < LinkageSpec::NoOfSpecs; ++i ) {432 for ( unsigned i = 0; i < n_named_specs; ++i ) { 280 433 // can't be a higher count in one of the sub-histograms than the total 281 434 histos[i].reserve( thisto.size() ); … … 295 448 template<typename F> 296 449 void printAllSparseHisto( const std::string& name, F extract ) { 297 std::map<unsigned, unsigned> histos[ LinkageSpec::NoOfSpecs];450 std::map<unsigned, unsigned> histos[n_named_specs]; 298 451 std::map<unsigned, unsigned> thisto; 299 452 300 453 for ( const auto& entry : extract(total) ) { ++thisto[ entry.second ]; } 301 454 302 for ( unsigned i = 0; i < LinkageSpec::NoOfSpecs; ++i ) {455 for ( unsigned i = 0; i < n_named_specs; ++i ) { 303 456 for ( const auto& entry : extract(for_linkage[i]) ) { ++histos[i][entry.second]; } 304 457 } … … 307 460 const auto& key = entry.first; 308 461 std::cout << "\"" << name << "\"," << key; 309 for ( unsigned i = 0; i < LinkageSpec::NoOfSpecs; ++i ) {462 for ( unsigned i = 0; i < n_named_specs; ++i ) { 310 463 auto it = histos[i].find( key ); 311 464 if ( it == histos[i].end() ) std::cout << ",0"; … … 319 472 void printAllPack( const std::string& name, F extract ) { 320 473 printAllMap("n_basic_" + name, [&extract](const Stats& stats) { return extract(stats).n_basic; }); 474 printAllMap("n_generic_" + name, [&extract](const Stats& stats) { return extract(stats).n_generic; }); 321 475 printAllMap("n_poly_" + name, [&extract](const Stats& stats) { return extract(stats).n_poly; }); 476 printAllMap("n_compound_" + name, [&extract](const Stats& stats) { return extract(stats).n_compound; }); 322 477 printAllMap("n_" + name, [&extract](const Stats& stats) { return extract(stats).n; }); 323 478 printAllMap("%_basic_" + name, [&extract](const Stats& stats) { return extract(stats).p_basic; }); 479 printAllMap("%_generic_" + name, [&extract](const Stats& stats) { return extract(stats).p_generic; }); 324 480 printAllMap("%_poly_" + name, [&extract](const Stats& stats) { return extract(stats).p_poly; }); 481 printAllMap("%_compound_" + name, [&extract](const Stats& stats) { return extract(stats).p_compound; }); 325 482 printAllMap("n_distinct_types_" + name, [&extract](const Stats& stats) { return extract(stats).n_types; }); 326 483 printAllMap("%_new_types_in_" + name, [&extract](const Stats& stats) { return extract(stats).p_new; }); … … 342 499 } 343 500 344 std::cout << ",,\"intrinsic\",\"Cforall\",\"C\",\"autogen\",\" builtin\",\"TOTAL\"" << std::endl;501 std::cout << ",,\"intrinsic\",\"Cforall\",\"C\",\"autogen\",\"compiler\",\"builtinCFA\",\"builtinC\",\"other\",\"TOTAL\"" << std::endl; 345 502 346 503 printAllMap("n_type_params", [](const Stats& stats) { return stats.n_type_params; }); 504 printAllMap("n_generic_params", [](const Stats& stats) { return stats.n_generic_params; }); 505 printAllMap("n_generic_nesting", [](const Stats& stats) { return stats.n_generic_nesting; }); 347 506 printAll("n_decls", [](const Stats& stats) { return stats.n_decls; }); 348 507 printAll("unique_names", [](const Stats& stats) { return stats.by_name.size(); }); … … 351 510 printAllSparseHisto("basic_type_uses", [](const Stats& stats) { return stats.basic_type_names; }); 352 511 printAllSparseHisto("decls_using_basic_type", [](const Stats& stats) { return stats.basic_type_decls; }); 512 printAll("generic_type_names", [](const Stats& stats) { return stats.generic_type_names.size(); }); 513 printAllSparseHisto("generic_type_uses", [](const Stats& stats) { return stats.generic_type_names; }); 514 printAllSparseHisto("decls_using_generic_type", [](const Stats& stats) { return stats.generic_type_decls; }); 353 515 printAll("compound_type_names", [](const Stats& stats) { return stats.compound_type_names.size(); }); 354 516 printAllSparseHisto("compound_type_uses", [](const Stats& stats) { return stats.compound_type_names; }); … … 365 527 }; 366 528 529 const unsigned DeclStats::ind_for_linkage[] 530 = { 7, 7, 2, 1, 7, 7, 7, 3, 4, 7, 6, 5, 7, 7, 7, 0 }; 531 367 532 void printDeclStats( std::list< Declaration * > &translationUnit ) { 368 DeclStatsstats;533 PassVisitor<DeclStats> stats; 369 534 acceptAll( translationUnit, stats ); 370 stats.p rint();535 stats.pass.print(); 371 536 } 372 537 -
src/CodeTools/TrackLoc.cc
rf9feab8 r90152a4 24 24 25 25 #include "Common/PassVisitor.h" // for PassVisitor 26 #include "Common/SemanticError.h" // for SemanticError27 26 #include "Common/utility.h" // for CodeLocation 28 27 #include "SynTree/BaseSyntaxNode.h" // for BaseSyntaxNode … … 64 63 } 65 64 else { 66 assertf( false, "Top level node has no CodeLocation %s", name.c_str() );65 assertf( false, "Top level node has no CodeLocation %s", toString( node ).c_str() ); 67 66 } 68 67 } -
src/Common/Debug.h
rf9feab8 r90152a4 28 28 namespace Debug { 29 29 /// debug codegen a translation unit 30 static inline void codeGen( __attribute__((unused)) const std::list< Declaration * > & translationUnit, __attribute__((unused)) const std::string & label ) {30 static inline void codeGen( __attribute__((unused)) const std::list< Declaration * > & translationUnit, __attribute__((unused)) const std::string & label, __attribute__((unused)) LinkageSpec::Spec linkageFilter = LinkageSpec::Builtin ) { 31 31 #ifdef DEBUG 32 32 std::list< Declaration * > decls; 33 33 34 filter( translationUnit.begin(), translationUnit.end(), back_inserter( decls ), [ ]( Declaration * decl ) {35 return ! LinkageSpec::isBuiltin( decl->get_linkage());34 filter( translationUnit.begin(), translationUnit.end(), back_inserter( decls ), [linkageFilter]( Declaration * decl ) { 35 return ! (decl->linkage & linkageFilter); 36 36 }); 37 37 38 38 std::cerr << "======" << label << "======" << std::endl; 39 CodeGen::generate( decls, std::cerr, false, true ); 39 CodeGen::generate( 40 decls, 41 std::cerr, 42 true /* doIntrinsics */, 43 true /* pretty */, 44 false /* generateC */, 45 false /* lineMarks */, 46 true /* printTypeExpr */ 47 ); 40 48 #endif 41 49 } // dump 42 50 43 static inline void treeDump( __attribute__((unused)) const std::list< Declaration * > & translationUnit, __attribute__((unused)) const std::string & label ) {51 static inline void treeDump( __attribute__((unused)) const std::list< Declaration * > & translationUnit, __attribute__((unused)) const std::string & label, __attribute__((unused)) LinkageSpec::Spec linkageFilter = LinkageSpec::Compiler ) { 44 52 #ifdef DEBUG 45 53 std::list< Declaration * > decls; 46 54 47 filter( translationUnit.begin(), translationUnit.end(), back_inserter( decls ), [ ]( Declaration * decl ) {48 return ! LinkageSpec::isBuiltin( decl->get_linkage());55 filter( translationUnit.begin(), translationUnit.end(), back_inserter( decls ), [linkageFilter]( Declaration * decl ) { 56 return ! (decl->linkage & linkageFilter); 49 57 }); 50 58 -
src/Common/PassVisitor.h
rf9feab8 r90152a4 19 19 #include "SynTree/Expression.h" 20 20 #include "SynTree/Constant.h" 21 #include "SynTree/TypeSubstitution.h" 21 22 class TypeSubstitution; 22 23 23 24 #include "PassVisitor.proto.h" … … 65 66 virtual void visit( TypedefDecl * typeDecl ) override final; 66 67 virtual void visit( AsmDecl * asmDecl ) override final; 68 virtual void visit( StaticAssertDecl * assertDecl ) override final; 67 69 68 70 virtual void visit( CompoundStmt * compoundStmt ) override final; 69 71 virtual void visit( ExprStmt * exprStmt ) override final; 70 72 virtual void visit( AsmStmt * asmStmt ) override final; 73 virtual void visit( DirectiveStmt * dirStmt ) override final; 71 74 virtual void visit( IfStmt * ifStmt ) override final; 72 75 virtual void visit( WhileStmt * whileStmt ) override final; … … 90 93 virtual void visit( NameExpr * nameExpr ) override final; 91 94 virtual void visit( CastExpr * castExpr ) override final; 95 virtual void visit( KeywordCastExpr * castExpr ) override final; 92 96 virtual void visit( VirtualCastExpr * castExpr ) override final; 93 97 virtual void visit( AddressExpr * addressExpr ) override final; … … 118 122 virtual void visit( StmtExpr * stmtExpr ) override final; 119 123 virtual void visit( UniqueExpr * uniqueExpr ) override final; 124 virtual void visit( UntypedInitExpr * initExpr ) override final; 125 virtual void visit( InitExpr * initExpr ) override final; 126 virtual void visit( DeletedExpr * delExpr ) override final; 127 virtual void visit( DefaultArgExpr * argExpr ) override final; 128 virtual void visit( GenericExpr * genExpr ) override final; 120 129 121 130 virtual void visit( VoidType * basicType ) override final; … … 124 133 virtual void visit( ArrayType * arrayType ) override final; 125 134 virtual void visit( ReferenceType * referenceType ) override final; 135 virtual void visit( QualifiedType * qualType ) override final; 126 136 virtual void visit( FunctionType * functionType ) override final; 127 137 virtual void visit( StructInstType * aggregateUseType ) override final; … … 136 146 virtual void visit( ZeroType * zeroType ) override final; 137 147 virtual void visit( OneType * oneType ) override final; 148 virtual void visit( GlobalScopeType * globalType ) override final; 138 149 139 150 virtual void visit( Designation * designation ) override final; … … 157 168 virtual Declaration * mutate( TypedefDecl * typeDecl ) override final; 158 169 virtual AsmDecl * mutate( AsmDecl * asmDecl ) override final; 170 virtual StaticAssertDecl * mutate( StaticAssertDecl * assertDecl ) override final; 159 171 160 172 virtual CompoundStmt * mutate( CompoundStmt * compoundStmt ) override final; 161 173 virtual Statement * mutate( ExprStmt * exprStmt ) override final; 162 174 virtual Statement * mutate( AsmStmt * asmStmt ) override final; 175 virtual Statement * mutate( DirectiveStmt * dirStmt ) override final; 163 176 virtual Statement * mutate( IfStmt * ifStmt ) override final; 164 177 virtual Statement * mutate( WhileStmt * whileStmt ) override final; … … 181 194 virtual Expression * mutate( UntypedExpr * untypedExpr ) override final; 182 195 virtual Expression * mutate( NameExpr * nameExpr ) override final; 183 virtual Expression * mutate( AddressExpr * castExpr ) override final;196 virtual Expression * mutate( AddressExpr * addrExpr ) override final; 184 197 virtual Expression * mutate( LabelAddressExpr * labAddressExpr ) override final; 185 198 virtual Expression * mutate( CastExpr * castExpr ) override final; 199 virtual Expression * mutate( KeywordCastExpr * castExpr ) override final; 186 200 virtual Expression * mutate( VirtualCastExpr * castExpr ) override final; 187 201 virtual Expression * mutate( UntypedMemberExpr * memberExpr ) override final; … … 210 224 virtual Expression * mutate( StmtExpr * stmtExpr ) override final; 211 225 virtual Expression * mutate( UniqueExpr * uniqueExpr ) override final; 226 virtual Expression * mutate( UntypedInitExpr * initExpr ) override final; 227 virtual Expression * mutate( InitExpr * initExpr ) override final; 228 virtual Expression * mutate( DeletedExpr * delExpr ) override final; 229 virtual Expression * mutate( DefaultArgExpr * argExpr ) override final; 230 virtual Expression * mutate( GenericExpr * genExpr ) override final; 212 231 213 232 virtual Type * mutate( VoidType * basicType ) override final; … … 216 235 virtual Type * mutate( ArrayType * arrayType ) override final; 217 236 virtual Type * mutate( ReferenceType * referenceType ) override final; 237 virtual Type * mutate( QualifiedType * qualType ) override final; 218 238 virtual Type * mutate( FunctionType * functionType ) override final; 219 239 virtual Type * mutate( StructInstType * aggregateUseType ) override final; … … 228 248 virtual Type * mutate( ZeroType * zeroType ) override final; 229 249 virtual Type * mutate( OneType * oneType ) override final; 250 virtual Type * mutate( GlobalScopeType * globalType ) override final; 230 251 231 252 virtual Designation * mutate( Designation * designation ) override final; … … 243 264 244 265 private: 266 bool inFunction = false; 267 245 268 template<typename pass_t> friend void acceptAll( std::list< Declaration* > &decls, PassVisitor< pass_t >& visitor ); 246 269 template<typename pass_t> friend void mutateAll( std::list< Declaration* > &decls, PassVisitor< pass_t >& visitor ); … … 286 309 bool_ref * get_visit_children_ptr() { return visit_children_impl(pass, 0); } 287 310 288 void indexerScopeEnter () { indexer_impl_enterScope ( pass, 0 ); }289 void indexerScopeLeave () { indexer_impl_leaveScope ( pass, 0 ); }290 void indexerAddId ( DeclarationWithType * node) { indexer_impl_addId ( pass, 0, node ); }291 void indexerAddType ( NamedTypeDecl * node) { indexer_impl_addType ( pass, 0, node ); }292 void indexerAddStruct ( const std::string & id) { indexer_impl_addStruct ( pass, 0, id ); }293 void indexerAddStruct ( StructDecl * node) { indexer_impl_addStruct ( pass, 0, node ); }294 void indexerAddStructFwd( StructDecl * node) { indexer_impl_addStructFwd( pass, 0, node ); }295 void indexerAddEnum ( EnumDecl * node) { indexer_impl_addEnum ( pass, 0, node ); }296 void indexerAddUnion ( const std::string & id) { indexer_impl_addUnion ( pass, 0, id ); }297 void indexerAddUnion ( UnionDecl * node) { indexer_impl_addUnion ( pass, 0, node ); }298 void indexerAddUnionFwd ( UnionDecl * node) { indexer_impl_addUnionFwd ( pass, 0, node ); }299 void indexerAddTrait ( TraitDecl * node) { indexer_impl_addTrait ( pass, 0, node ); }300 void indexerAddWith ( WithStmt * node ) { indexer_impl_addWith ( pass, 0, node); }311 void indexerScopeEnter () { indexer_impl_enterScope ( pass, 0 ); } 312 void indexerScopeLeave () { indexer_impl_leaveScope ( pass, 0 ); } 313 void indexerAddId ( DeclarationWithType * node ) { indexer_impl_addId ( pass, 0, node ); } 314 void indexerAddType ( NamedTypeDecl * node ) { indexer_impl_addType ( pass, 0, node ); } 315 void indexerAddStruct ( const std::string & id ) { indexer_impl_addStruct ( pass, 0, id ); } 316 void indexerAddStruct ( StructDecl * node ) { indexer_impl_addStruct ( pass, 0, node ); } 317 void indexerAddStructFwd( StructDecl * node ) { indexer_impl_addStructFwd( pass, 0, node ); } 318 void indexerAddEnum ( EnumDecl * node ) { indexer_impl_addEnum ( pass, 0, node ); } 319 void indexerAddUnion ( const std::string & id ) { indexer_impl_addUnion ( pass, 0, id ); } 320 void indexerAddUnion ( UnionDecl * node ) { indexer_impl_addUnion ( pass, 0, node ); } 321 void indexerAddUnionFwd ( UnionDecl * node ) { indexer_impl_addUnionFwd ( pass, 0, node ); } 322 void indexerAddTrait ( TraitDecl * node ) { indexer_impl_addTrait ( pass, 0, node ); } 323 void indexerAddWith ( std::list< Expression * > & exprs, BaseSyntaxNode * withStmt ) { indexer_impl_addWith( pass, 0, exprs, withStmt ); } 301 324 302 325 … … 403 426 }; 404 427 428 #include "SynTree/TypeSubstitution.h" 405 429 #include "PassVisitor.impl.h" -
src/Common/PassVisitor.impl.h
rf9feab8 r90152a4 62 62 63 63 template< typename pass_type > 64 staticinline void acceptAll( std::list< Declaration* > &decls, PassVisitor< pass_type >& visitor ) {64 inline void acceptAll( std::list< Declaration* > &decls, PassVisitor< pass_type >& visitor ) { 65 65 DeclList_t* beforeDecls = visitor.get_beforeDecls(); 66 66 DeclList_t* afterDecls = visitor.get_afterDecls(); 67 SemanticError errors;67 SemanticErrorException errors; 68 68 69 69 for ( std::list< Declaration* >::iterator i = decls.begin(); ; ++i ) { … … 76 76 // run visitor on declaration 77 77 maybeAccept_impl( *i, visitor ); 78 } catch( SemanticError &e ) { 79 e.set_location( (*i)->location ); 78 } catch( SemanticErrorException &e ) { 80 79 errors.append( e ); 81 80 } … … 90 89 91 90 template< typename pass_type > 92 staticinline void mutateAll( std::list< Declaration* > &decls, PassVisitor< pass_type >& mutator ) {91 inline void mutateAll( std::list< Declaration* > &decls, PassVisitor< pass_type >& mutator ) { 93 92 DeclList_t* beforeDecls = mutator.get_beforeDecls(); 94 93 DeclList_t* afterDecls = mutator.get_afterDecls(); 95 SemanticError errors;94 SemanticErrorException errors; 96 95 97 96 for ( std::list< Declaration* >::iterator i = decls.begin(); ; ++i ) { … … 103 102 // run mutator on declaration 104 103 maybeMutate_impl( *i, mutator ); 105 } catch( SemanticError &e ) { 106 e.set_location( (*i)->location ); 104 } catch( SemanticErrorException &e ) { 107 105 errors.append( e ); 108 106 } … … 127 125 inline void maybeAccept_impl( Container & container, PassVisitor< pass_type > & visitor ) { 128 126 if ( ! visitor.get_visit_children() ) return; 129 SemanticError errors;127 SemanticErrorException errors; 130 128 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) { 131 129 try { … … 133 131 (*i)->accept( visitor ); 134 132 } 135 } catch( SemanticError &e ) { 136 e.set_location( (*i)->location ); 133 } catch( SemanticErrorException &e ) { 137 134 errors.append( e ); 138 135 } … … 155 152 inline void maybeMutate_impl( Container & container, PassVisitor< pass_type > & mutator ) { 156 153 if ( ! mutator.get_visit_children() ) return; 157 SemanticError errors;154 SemanticErrorException errors; 158 155 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) { 159 156 try { … … 162 159 assert( *i ); 163 160 } // if 164 } catch( SemanticError &e ) { 165 e.set_location( (*i)->location ); 161 } catch( SemanticErrorException &e ) { 166 162 errors.append( e ); 167 163 } // try … … 176 172 void PassVisitor< pass_type >::handleStatementList( std::list< Statement * > & statements, func_t func ) { 177 173 if ( ! get_visit_children() ) return; 178 SemanticError errors;174 SemanticErrorException errors; 179 175 180 176 // don't want statements from outer CompoundStmts to be added to this CompoundStmt … … 199 195 || ( empty( beforeDecls ) && empty( afterDecls )) ); 200 196 201 } catch ( SemanticError &e ) { 202 e.set_location( (*i)->location ); 197 } catch ( SemanticErrorException &e ) { 203 198 errors.append( e ); 204 199 } … … 365 360 maybeAccept_impl ( node->attributes , *this ); 366 361 367 if ( node->name != "" ) { 368 indexerAddId( node ); 369 } 362 indexerAddId( node ); 370 363 371 364 VISIT_END( node ); … … 381 374 maybeMutate_impl ( node->attributes , *this ); 382 375 383 if ( node->name != "" ) { 384 indexerAddId( node ); 385 } 376 indexerAddId( node ); 386 377 387 378 MUTATE_END( DeclarationWithType, node ); … … 394 385 VISIT_START( node ); 395 386 396 if ( node->name != "" ) { 397 indexerAddId( node ); 398 } 399 387 indexerAddId( node ); 388 389 maybeAccept_impl( node->withExprs, *this ); 400 390 { 391 // with clause introduces a level of scope (for the with expression members). 392 // with clause exprs are added to the indexer before parameters so that parameters 393 // shadow with exprs and not the other way around. 401 394 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 402 // implicit add __func__ identifier as specified in the C manual 6.4.2.2 403 static ObjectDecl func( 404 "__func__", noStorageClasses, LinkageSpec::C, nullptr, 405 new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ), nullptr, true, false ), 406 nullptr 407 ); 408 indexerAddId( &func ); 409 maybeAccept_impl( node->type, *this ); 410 maybeAccept_impl( node->statements, *this ); 411 maybeAccept_impl( node->attributes, *this ); 395 indexerAddWith( node->withExprs, node ); 396 { 397 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 398 // implicit add __func__ identifier as specified in the C manual 6.4.2.2 399 static ObjectDecl func( 400 "__func__", noStorageClasses, LinkageSpec::C, nullptr, 401 new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ), nullptr, true, false ), 402 nullptr 403 ); 404 indexerAddId( &func ); 405 maybeAccept_impl( node->type, *this ); 406 // function body needs to have the same scope as parameters - CompoundStmt will not enter 407 // a new scope if inFunction is true 408 ValueGuard< bool > oldInFunction( inFunction ); 409 inFunction = true; 410 maybeAccept_impl( node->statements, *this ); 411 maybeAccept_impl( node->attributes, *this ); 412 } 412 413 } 413 414 … … 419 420 MUTATE_START( node ); 420 421 421 if ( node->name != "" ) { 422 indexerAddId( node ); 423 } 422 indexerAddId( node ); 424 423 425 424 { 425 // with clause introduces a level of scope (for the with expression members). 426 // with clause exprs are added to the indexer before parameters so that parameters 427 // shadow with exprs and not the other way around. 426 428 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 427 // implicit add __func__ identifier as specified in the C manual 6.4.2.2 428 static ObjectDecl func( 429 "__func__", noStorageClasses, LinkageSpec::C, nullptr, 430 new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ), nullptr, true, false ), 431 nullptr 432 ); 433 indexerAddId( &func ); 434 maybeMutate_impl( node->type, *this ); 435 maybeMutate_impl( node->statements, *this ); 436 maybeMutate_impl( node->attributes, *this ); 429 indexerAddWith( node->withExprs, node ); 430 { 431 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 432 // implicit add __func__ identifier as specified in the C manual 6.4.2.2 433 static ObjectDecl func( 434 "__func__", noStorageClasses, LinkageSpec::C, nullptr, 435 new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ), nullptr, true, false ), 436 nullptr 437 ); 438 indexerAddId( &func ); 439 maybeMutate_impl( node->type, *this ); 440 // function body needs to have the same scope as parameters - CompoundStmt will not enter 441 // a new scope if inFunction is true 442 ValueGuard< bool > oldInFunction( inFunction ); 443 inFunction = true; 444 maybeMutate_impl( node->statements, *this ); 445 maybeMutate_impl( node->attributes, *this ); 446 } 437 447 } 438 448 … … 683 693 684 694 //-------------------------------------------------------------------------- 695 // StaticAssertDecl 696 template< typename pass_type > 697 void PassVisitor< pass_type >::visit( StaticAssertDecl * node ) { 698 VISIT_START( node ); 699 700 node->condition = visitExpression( node->condition ); 701 maybeAccept_impl( node->message, *this ); 702 703 VISIT_END( node ); 704 } 705 706 template< typename pass_type > 707 StaticAssertDecl * PassVisitor< pass_type >::mutate( StaticAssertDecl * node ) { 708 MUTATE_START( node ); 709 710 node->condition = mutateExpression( node->condition ); 711 maybeMutate_impl( node->message, *this ); 712 713 MUTATE_END( StaticAssertDecl, node ); 714 } 715 716 //-------------------------------------------------------------------------- 685 717 // CompoundStmt 686 718 template< typename pass_type > … … 688 720 VISIT_START( node ); 689 721 { 690 auto guard1 = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 722 // do not enter a new scope if inFunction is true - needs to check old state before the assignment 723 ValueGuard< bool > oldInFunction( inFunction ); 724 auto guard1 = makeFuncGuard( [this, &oldInFunction]() { if ( ! oldInFunction.old ) indexerScopeEnter(); }, [this, &oldInFunction]() { if ( ! oldInFunction.old ) indexerScopeLeave(); } ); 691 725 auto guard2 = makeFuncGuard( [this]() { call_beginScope(); }, [this]() { call_endScope(); } ); 726 inFunction = false; 692 727 visitStatementList( node->kids ); 693 728 } … … 699 734 MUTATE_START( node ); 700 735 { 701 auto guard1 = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 736 // do not enter a new scope if inFunction is true - needs to check old state before the assignment 737 ValueGuard< bool > oldInFunction( inFunction ); 738 auto guard1 = makeFuncGuard( [this, &oldInFunction]() { if ( ! oldInFunction.old ) indexerScopeEnter(); }, [this, &oldInFunction]() { if ( ! oldInFunction.old ) indexerScopeLeave(); } ); 702 739 auto guard2 = makeFuncGuard( [this]() { call_beginScope(); }, [this]() { call_endScope(); } ); 740 inFunction = false; 703 741 mutateStatementList( node->kids ); 704 742 } … … 730 768 template< typename pass_type > 731 769 void PassVisitor< pass_type >::visit( AsmStmt * node ) { 732 VISIT_BODY( node ); 770 VISIT_START( node ) 771 772 maybeAccept_impl( node->instruction, *this ); 773 maybeAccept_impl( node->output, *this ); 774 maybeAccept_impl( node->input, *this ); 775 maybeAccept_impl( node->clobber, *this ); 776 777 VISIT_END( node ); 733 778 } 734 779 735 780 template< typename pass_type > 736 781 Statement * PassVisitor< pass_type >::mutate( AsmStmt * node ) { 737 MUTATE_BODY( Statement, node ); 782 MUTATE_START( node ); 783 784 maybeMutate_impl( node->instruction, *this ); 785 maybeMutate_impl( node->output, *this ); 786 maybeMutate_impl( node->input, *this ); 787 maybeMutate_impl( node->clobber, *this ); 788 789 MUTATE_END( Statement, node ); 790 } 791 792 //-------------------------------------------------------------------------- 793 // AsmStmt 794 template< typename pass_type > 795 void PassVisitor< pass_type >::visit( DirectiveStmt * node ) { 796 VISIT_START( node ) 797 798 VISIT_END( node ); 799 } 800 801 template< typename pass_type > 802 Statement * PassVisitor< pass_type >::mutate( DirectiveStmt * node ) { 803 MUTATE_START( node ); 804 805 MUTATE_END( Statement, node ); 738 806 } 739 807 … … 774 842 VISIT_START( node ); 775 843 776 visitExpression( node->condition ); 777 node->body = visitStatement( node->body ); 844 { 845 // while statements introduce a level of scope (for the initialization) 846 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 847 maybeAccept_impl( node->initialization, *this ); 848 visitExpression ( node->condition ); 849 node->body = visitStatement( node->body ); 850 } 778 851 779 852 VISIT_END( node ); … … 784 857 MUTATE_START( node ); 785 858 786 node->condition = mutateExpression( node->condition ); 787 node->body = mutateStatement ( node->body ); 859 { 860 // while statements introduce a level of scope (for the initialization) 861 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 862 maybeMutate_impl( node->initialization, *this ); 863 node->condition = mutateExpression( node->condition ); 864 node->body = mutateStatement ( node->body ); 865 } 866 788 867 789 868 MUTATE_END( Statement, node ); … … 868 947 template< typename pass_type > 869 948 void PassVisitor< pass_type >::visit( BranchStmt * node ) { 870 VISIT_BODY( node ); 949 VISIT_START( node ); 950 VISIT_END( node ); 871 951 } 872 952 873 953 template< typename pass_type > 874 954 Statement * PassVisitor< pass_type >::mutate( BranchStmt * node ) { 875 MUTATE_BODY( Statement, node ); 955 MUTATE_START( node ); 956 MUTATE_END( Statement, node ); 876 957 } 877 958 … … 901 982 template< typename pass_type > 902 983 void PassVisitor< pass_type >::visit( ThrowStmt * node ) { 903 VISIT_BODY( node ); 984 VISIT_START( node ); 985 986 maybeAccept_impl( node->expr, *this ); 987 maybeAccept_impl( node->target, *this ); 988 989 VISIT_END( node ); 904 990 } 905 991 906 992 template< typename pass_type > 907 993 Statement * PassVisitor< pass_type >::mutate( ThrowStmt * node ) { 908 MUTATE_BODY( Statement, node ); 994 MUTATE_START( node ); 995 996 maybeMutate_impl( node->expr, *this ); 997 maybeMutate_impl( node->target, *this ); 998 999 MUTATE_END( Statement, node ); 909 1000 } 910 1001 … … 965 1056 template< typename pass_type > 966 1057 void PassVisitor< pass_type >::visit( FinallyStmt * node ) { 967 VISIT_BODY( node ); 1058 VISIT_START( node ); 1059 1060 maybeAccept_impl( node->block, *this ); 1061 1062 VISIT_END( node ); 968 1063 } 969 1064 970 1065 template< typename pass_type > 971 1066 Statement * PassVisitor< pass_type >::mutate( FinallyStmt * node ) { 972 MUTATE_BODY( Statement, node ); 1067 MUTATE_START( node ); 1068 1069 maybeMutate_impl( node->block, *this ); 1070 1071 MUTATE_END( Statement, node ); 973 1072 } 974 1073 … … 977 1076 template< typename pass_type > 978 1077 void PassVisitor< pass_type >::visit( WaitForStmt * node ) { 979 VISIT_BODY( node ); 1078 VISIT_START( node ); 1079 1080 for( auto & clause : node->clauses ) { 1081 maybeAccept_impl( clause.target.function, *this ); 1082 maybeAccept_impl( clause.target.arguments, *this ); 1083 1084 maybeAccept_impl( clause.statement, *this ); 1085 maybeAccept_impl( clause.condition, *this ); 1086 } 1087 1088 maybeAccept_impl( node->timeout.time, *this ); 1089 maybeAccept_impl( node->timeout.statement, *this ); 1090 maybeAccept_impl( node->timeout.condition, *this ); 1091 maybeAccept_impl( node->orelse.statement, *this ); 1092 maybeAccept_impl( node->orelse.condition, *this ); 1093 1094 VISIT_END( node ); 980 1095 } 981 1096 982 1097 template< typename pass_type > 983 1098 Statement * PassVisitor< pass_type >::mutate( WaitForStmt * node ) { 984 MUTATE_BODY( Statement, node ); 1099 MUTATE_START( node ); 1100 1101 for( auto & clause : node->clauses ) { 1102 maybeMutate_impl( clause.target.function, *this ); 1103 maybeMutate_impl( clause.target.arguments, *this ); 1104 1105 maybeMutate_impl( clause.statement, *this ); 1106 maybeMutate_impl( clause.condition, *this ); 1107 } 1108 1109 maybeMutate_impl( node->timeout.time, *this ); 1110 maybeMutate_impl( node->timeout.statement, *this ); 1111 maybeMutate_impl( node->timeout.condition, *this ); 1112 maybeMutate_impl( node->orelse.statement, *this ); 1113 maybeMutate_impl( node->orelse.condition, *this ); 1114 1115 MUTATE_END( Statement, node ); 985 1116 } 986 1117 … … 996 1127 // catch statements introduce a level of scope (for the caught exception) 997 1128 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 998 indexerAddWith( node );1129 indexerAddWith( node->exprs, node ); 999 1130 maybeAccept_impl( node->stmt, *this ); 1000 1131 } … … 1009 1140 // catch statements introduce a level of scope (for the caught exception) 1010 1141 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 1011 indexerAddWith( node );1142 indexerAddWith( node->exprs, node ); 1012 1143 maybeMutate_impl( node->stmt, *this ); 1013 1144 } … … 1019 1150 template< typename pass_type > 1020 1151 void PassVisitor< pass_type >::visit( NullStmt * node ) { 1021 VISIT_BODY( node ); 1152 VISIT_START( node ); 1153 VISIT_END( node ); 1022 1154 } 1023 1155 1024 1156 template< typename pass_type > 1025 1157 NullStmt * PassVisitor< pass_type >::mutate( NullStmt * node ) { 1026 MUTATE_BODY( NullStmt, node ); 1158 MUTATE_START( node ); 1159 MUTATE_END( NullStmt, node ); 1027 1160 } 1028 1161 … … 1031 1164 template< typename pass_type > 1032 1165 void PassVisitor< pass_type >::visit( DeclStmt * node ) { 1033 VISIT_BODY( node ); 1166 VISIT_START( node ); 1167 1168 maybeAccept_impl( node->decl, *this ); 1169 1170 VISIT_END( node ); 1034 1171 } 1035 1172 1036 1173 template< typename pass_type > 1037 1174 Statement * PassVisitor< pass_type >::mutate( DeclStmt * node ) { 1038 MUTATE_BODY( Statement, node ); 1175 MUTATE_START( node ); 1176 1177 maybeMutate_impl( node->decl, *this ); 1178 1179 MUTATE_END( Statement, node ); 1039 1180 } 1040 1181 … … 1043 1184 template< typename pass_type > 1044 1185 void PassVisitor< pass_type >::visit( ImplicitCtorDtorStmt * node ) { 1045 VISIT_BODY( node ); 1186 VISIT_START( node ); 1187 1188 maybeAccept_impl( node->callStmt, *this ); 1189 1190 VISIT_END( node ); 1046 1191 } 1047 1192 1048 1193 template< typename pass_type > 1049 1194 Statement * PassVisitor< pass_type >::mutate( ImplicitCtorDtorStmt * node ) { 1050 MUTATE_BODY( Statement, node ); 1195 MUTATE_START( node ); 1196 1197 maybeMutate_impl( node->callStmt, *this ); 1198 1199 MUTATE_END( Statement, node ); 1051 1200 } 1052 1201 … … 1141 1290 template< typename pass_type > 1142 1291 Expression * PassVisitor< pass_type >::mutate( CastExpr * node ) { 1292 MUTATE_START( node ); 1293 1294 indexerScopedMutate( node->env , *this ); 1295 indexerScopedMutate( node->result, *this ); 1296 maybeMutate_impl ( node->arg , *this ); 1297 1298 MUTATE_END( Expression, node ); 1299 } 1300 1301 //-------------------------------------------------------------------------- 1302 // KeywordCastExpr 1303 template< typename pass_type > 1304 void PassVisitor< pass_type >::visit( KeywordCastExpr * node ) { 1305 VISIT_START( node ); 1306 1307 indexerScopedAccept( node->result, *this ); 1308 maybeAccept_impl ( node->arg , *this ); 1309 1310 VISIT_END( node ); 1311 } 1312 1313 template< typename pass_type > 1314 Expression * PassVisitor< pass_type >::mutate( KeywordCastExpr * node ) { 1143 1315 MUTATE_START( node ); 1144 1316 … … 1404 1576 indexerScopedAccept( node->result, *this ); 1405 1577 maybeAccept_impl ( node->type , *this ); 1406 maybeAccept_impl ( node->member, *this );1407 1578 1408 1579 VISIT_END( node ); … … 1416 1587 indexerScopedMutate( node->result, *this ); 1417 1588 maybeMutate_impl ( node->type , *this ); 1418 maybeMutate_impl ( node->member, *this );1419 1589 1420 1590 MUTATE_END( Expression, node ); … … 1853 2023 } 1854 2024 2025 //-------------------------------------------------------------------------- 2026 // UntypedInitExpr 2027 template< typename pass_type > 2028 void PassVisitor< pass_type >::visit( UntypedInitExpr * node ) { 2029 VISIT_START( node ); 2030 2031 indexerScopedAccept( node->result, *this ); 2032 maybeAccept_impl ( node->expr , *this ); 2033 // not currently visiting initAlts, but this doesn't matter since this node is only used in the resolver. 2034 2035 VISIT_END( node ); 2036 } 2037 2038 template< typename pass_type > 2039 Expression * PassVisitor< pass_type >::mutate( UntypedInitExpr * node ) { 2040 MUTATE_START( node ); 2041 2042 indexerScopedMutate( node->env , *this ); 2043 indexerScopedMutate( node->result, *this ); 2044 maybeMutate_impl ( node->expr , *this ); 2045 // not currently visiting initAlts, but this doesn't matter since this node is only used in the resolver. 2046 2047 MUTATE_END( Expression, node ); 2048 } 2049 2050 //-------------------------------------------------------------------------- 2051 // InitExpr 2052 template< typename pass_type > 2053 void PassVisitor< pass_type >::visit( InitExpr * node ) { 2054 VISIT_START( node ); 2055 2056 indexerScopedAccept( node->result, *this ); 2057 maybeAccept_impl ( node->expr , *this ); 2058 maybeAccept_impl ( node->designation, *this ); 2059 2060 VISIT_END( node ); 2061 } 2062 2063 template< typename pass_type > 2064 Expression * PassVisitor< pass_type >::mutate( InitExpr * node ) { 2065 MUTATE_START( node ); 2066 2067 indexerScopedMutate( node->env , *this ); 2068 indexerScopedMutate( node->result, *this ); 2069 maybeMutate_impl ( node->expr , *this ); 2070 maybeMutate_impl ( node->designation, *this ); 2071 2072 MUTATE_END( Expression, node ); 2073 } 2074 2075 //-------------------------------------------------------------------------- 2076 // DeletedExpr 2077 template< typename pass_type > 2078 void PassVisitor< pass_type >::visit( DeletedExpr * node ) { 2079 VISIT_START( node ); 2080 2081 indexerScopedAccept( node->result, *this ); 2082 maybeAccept_impl( node->expr, *this ); 2083 // don't visit deleteStmt, because it is a pointer to somewhere else in the tree. 2084 2085 VISIT_END( node ); 2086 } 2087 2088 template< typename pass_type > 2089 Expression * PassVisitor< pass_type >::mutate( DeletedExpr * node ) { 2090 MUTATE_START( node ); 2091 2092 indexerScopedMutate( node->env, *this ); 2093 indexerScopedMutate( node->result, *this ); 2094 maybeMutate_impl( node->expr, *this ); 2095 2096 MUTATE_END( Expression, node ); 2097 } 2098 2099 //-------------------------------------------------------------------------- 2100 // DefaultArgExpr 2101 template< typename pass_type > 2102 void PassVisitor< pass_type >::visit( DefaultArgExpr * node ) { 2103 VISIT_START( node ); 2104 2105 indexerScopedAccept( node->result, *this ); 2106 maybeAccept_impl( node->expr, *this ); 2107 2108 VISIT_END( node ); 2109 } 2110 2111 template< typename pass_type > 2112 Expression * PassVisitor< pass_type >::mutate( DefaultArgExpr * node ) { 2113 MUTATE_START( node ); 2114 2115 indexerScopedMutate( node->env, *this ); 2116 indexerScopedMutate( node->result, *this ); 2117 maybeMutate_impl( node->expr, *this ); 2118 2119 MUTATE_END( Expression, node ); 2120 } 2121 2122 //-------------------------------------------------------------------------- 2123 // GenericExpr 2124 template< typename pass_type > 2125 void PassVisitor< pass_type >::visit( GenericExpr * node ) { 2126 VISIT_START( node ); 2127 2128 indexerScopedAccept( node->result, *this ); 2129 maybeAccept_impl( node->control, *this ); 2130 for ( GenericExpr::Association & assoc : node->associations ) { 2131 indexerScopedAccept( assoc.type, *this ); 2132 maybeAccept_impl( assoc.expr, *this ); 2133 } 2134 2135 VISIT_END( node ); 2136 } 2137 2138 template< typename pass_type > 2139 Expression * PassVisitor< pass_type >::mutate( GenericExpr * node ) { 2140 MUTATE_START( node ); 2141 2142 indexerScopedMutate( node->env, *this ); 2143 indexerScopedMutate( node->result, *this ); 2144 maybeMutate_impl( node->control, *this ); 2145 for ( GenericExpr::Association & assoc : node->associations ) { 2146 indexerScopedMutate( assoc.type, *this ); 2147 maybeMutate_impl( assoc.expr, *this ); 2148 } 2149 2150 MUTATE_END( Expression, node ); 2151 } 2152 2153 //-------------------------------------------------------------------------- 2154 // VoidType 1855 2155 template< typename pass_type > 1856 2156 void PassVisitor< pass_type >::visit( VoidType * node ) { 1857 VISIT_BODY( node ); 1858 } 1859 2157 VISIT_START( node ); 2158 2159 maybeAccept_impl( node->forall, *this ); 2160 2161 VISIT_END( node ); 2162 } 2163 2164 template< typename pass_type > 2165 Type * PassVisitor< pass_type >::mutate( VoidType * node ) { 2166 MUTATE_START( node ); 2167 2168 maybeMutate_impl( node->forall, *this ); 2169 2170 MUTATE_END( Type, node ); 2171 } 2172 2173 //-------------------------------------------------------------------------- 2174 // BasicType 1860 2175 template< typename pass_type > 1861 2176 void PassVisitor< pass_type >::visit( BasicType * node ) { 1862 VISIT_BODY( node ); 1863 } 1864 2177 VISIT_START( node ); 2178 2179 maybeAccept_impl( node->forall, *this ); 2180 2181 VISIT_END( node ); 2182 } 2183 2184 template< typename pass_type > 2185 Type * PassVisitor< pass_type >::mutate( BasicType * node ) { 2186 MUTATE_START( node ); 2187 2188 maybeMutate_impl( node->forall, *this ); 2189 2190 MUTATE_END( Type, node ); 2191 } 2192 2193 //-------------------------------------------------------------------------- 2194 // PointerType 1865 2195 template< typename pass_type > 1866 2196 void PassVisitor< pass_type >::visit( PointerType * node ) { 1867 VISIT_BODY( node ); 1868 } 1869 2197 VISIT_START( node ); 2198 2199 maybeAccept_impl( node->forall, *this ); 2200 // xxx - should PointerType visit/mutate dimension? 2201 maybeAccept_impl( node->base, *this ); 2202 2203 VISIT_END( node ); 2204 } 2205 2206 template< typename pass_type > 2207 Type * PassVisitor< pass_type >::mutate( PointerType * node ) { 2208 MUTATE_START( node ); 2209 2210 maybeMutate_impl( node->forall, *this ); 2211 // xxx - should PointerType visit/mutate dimension? 2212 maybeMutate_impl( node->base, *this ); 2213 2214 MUTATE_END( Type, node ); 2215 } 2216 2217 //-------------------------------------------------------------------------- 2218 // ArrayType 1870 2219 template< typename pass_type > 1871 2220 void PassVisitor< pass_type >::visit( ArrayType * node ) { 1872 VISIT_BODY( node ); 1873 } 1874 2221 VISIT_START( node ); 2222 2223 maybeAccept_impl( node->forall, *this ); 2224 maybeAccept_impl( node->dimension, *this ); 2225 maybeAccept_impl( node->base, *this ); 2226 2227 VISIT_END( node ); 2228 } 2229 2230 template< typename pass_type > 2231 Type * PassVisitor< pass_type >::mutate( ArrayType * node ) { 2232 MUTATE_START( node ); 2233 2234 maybeMutate_impl( node->forall, *this ); 2235 maybeMutate_impl( node->dimension, *this ); 2236 maybeMutate_impl( node->base, *this ); 2237 2238 MUTATE_END( Type, node ); 2239 } 2240 2241 //-------------------------------------------------------------------------- 2242 // ReferenceType 1875 2243 template< typename pass_type > 1876 2244 void PassVisitor< pass_type >::visit( ReferenceType * node ) { 1877 VISIT_BODY( node ); 1878 } 1879 2245 VISIT_START( node ); 2246 2247 maybeAccept_impl( node->forall, *this ); 2248 maybeAccept_impl( node->base, *this ); 2249 2250 VISIT_END( node ); 2251 } 2252 2253 template< typename pass_type > 2254 Type * PassVisitor< pass_type >::mutate( ReferenceType * node ) { 2255 MUTATE_START( node ); 2256 2257 maybeMutate_impl( node->forall, *this ); 2258 maybeMutate_impl( node->base, *this ); 2259 2260 MUTATE_END( Type, node ); 2261 } 2262 2263 //-------------------------------------------------------------------------- 2264 // QualifiedType 2265 template< typename pass_type > 2266 void PassVisitor< pass_type >::visit( QualifiedType * node ) { 2267 VISIT_START( node ); 2268 2269 maybeAccept_impl( node->forall, *this ); 2270 maybeAccept_impl( node->parent, *this ); 2271 maybeAccept_impl( node->child, *this ); 2272 2273 VISIT_END( node ); 2274 } 2275 2276 template< typename pass_type > 2277 Type * PassVisitor< pass_type >::mutate( QualifiedType * node ) { 2278 MUTATE_START( node ); 2279 2280 maybeMutate_impl( node->forall, *this ); 2281 maybeMutate_impl( node->parent, *this ); 2282 maybeMutate_impl( node->child, *this ); 2283 2284 MUTATE_END( Type, node ); 2285 } 2286 2287 //-------------------------------------------------------------------------- 2288 // FunctionType 1880 2289 template< typename pass_type > 1881 2290 void PassVisitor< pass_type >::visit( FunctionType * node ) { 1882 VISIT_BODY( node ); 2291 VISIT_START( node ); 2292 2293 maybeAccept_impl( node->forall, *this ); 2294 maybeAccept_impl( node->returnVals, *this ); 2295 maybeAccept_impl( node->parameters, *this ); 2296 2297 VISIT_END( node ); 2298 } 2299 2300 template< typename pass_type > 2301 Type * PassVisitor< pass_type >::mutate( FunctionType * node ) { 2302 MUTATE_START( node ); 2303 2304 maybeMutate_impl( node->forall, *this ); 2305 maybeMutate_impl( node->returnVals, *this ); 2306 maybeMutate_impl( node->parameters, *this ); 2307 2308 MUTATE_END( Type, node ); 1883 2309 } 1884 2310 … … 1951 2377 template< typename pass_type > 1952 2378 void PassVisitor< pass_type >::visit( EnumInstType * node ) { 1953 VISIT_BODY( node ); 2379 VISIT_START( node ); 2380 2381 maybeAccept_impl( node->forall, *this ); 2382 maybeAccept_impl( node->parameters, *this ); 2383 2384 VISIT_END( node ); 1954 2385 } 1955 2386 1956 2387 template< typename pass_type > 1957 2388 Type * PassVisitor< pass_type >::mutate( EnumInstType * node ) { 1958 MUTATE_BODY( Type, node ); 2389 MUTATE_START( node ); 2390 2391 maybeMutate_impl( node->forall, *this ); 2392 maybeMutate_impl( node->parameters, *this ); 2393 2394 MUTATE_END( Type, node ); 1959 2395 } 1960 2396 … … 1985 2421 template< typename pass_type > 1986 2422 void PassVisitor< pass_type >::visit( TypeInstType * node ) { 1987 VISIT_BODY( node ); 1988 } 1989 2423 VISIT_START( node ); 2424 2425 maybeAccept_impl( node->forall , *this ); 2426 maybeAccept_impl( node->parameters, *this ); 2427 2428 VISIT_END( node ); 2429 } 2430 2431 template< typename pass_type > 2432 Type * PassVisitor< pass_type >::mutate( TypeInstType * node ) { 2433 MUTATE_START( node ); 2434 2435 maybeMutate_impl( node->forall , *this ); 2436 maybeMutate_impl( node->parameters, *this ); 2437 2438 MUTATE_END( Type, node ); 2439 } 2440 2441 //-------------------------------------------------------------------------- 2442 // TupleType 1990 2443 template< typename pass_type > 1991 2444 void PassVisitor< pass_type >::visit( TupleType * node ) { 1992 VISIT_BODY( node ); 1993 } 1994 2445 VISIT_START( node ); 2446 2447 maybeAccept_impl( node->forall, *this ); 2448 maybeAccept_impl( node->types, *this ); 2449 maybeAccept_impl( node->members, *this ); 2450 2451 VISIT_END( node ); 2452 } 2453 2454 template< typename pass_type > 2455 Type * PassVisitor< pass_type >::mutate( TupleType * node ) { 2456 MUTATE_START( node ); 2457 2458 maybeMutate_impl( node->forall, *this ); 2459 maybeMutate_impl( node->types, *this ); 2460 maybeMutate_impl( node->members, *this ); 2461 2462 MUTATE_END( Type, node ); 2463 } 2464 2465 //-------------------------------------------------------------------------- 2466 // TypeofType 1995 2467 template< typename pass_type > 1996 2468 void PassVisitor< pass_type >::visit( TypeofType * node ) { 1997 VISIT_BODY( node ); 1998 } 1999 2469 VISIT_START( node ); 2470 2471 assert( node->expr ); 2472 maybeAccept_impl( node->expr, *this ); 2473 2474 VISIT_END( node ); 2475 } 2476 2477 template< typename pass_type > 2478 Type * PassVisitor< pass_type >::mutate( TypeofType * node ) { 2479 MUTATE_START( node ); 2480 2481 assert( node->expr ); 2482 maybeMutate_impl( node->expr, *this ); 2483 2484 MUTATE_END( Type, node ); 2485 } 2486 2487 //-------------------------------------------------------------------------- 2488 // AttrType 2000 2489 template< typename pass_type > 2001 2490 void PassVisitor< pass_type >::visit( AttrType * node ) { 2002 VISIT_BODY( node ); 2003 } 2004 2491 VISIT_START( node ); 2492 2493 if ( node->isType ) { 2494 assert( node->type ); 2495 maybeAccept_impl( node->type, *this ); 2496 } else { 2497 assert( node->expr ); 2498 maybeAccept_impl( node->expr, *this ); 2499 } // if 2500 2501 VISIT_END( node ); 2502 } 2503 2504 template< typename pass_type > 2505 Type * PassVisitor< pass_type >::mutate( AttrType * node ) { 2506 MUTATE_START( node ); 2507 2508 if ( node->isType ) { 2509 assert( node->type ); 2510 maybeMutate_impl( node->type, *this ); 2511 } else { 2512 assert( node->expr ); 2513 maybeMutate_impl( node->expr, *this ); 2514 } // if 2515 2516 MUTATE_END( Type, node ); 2517 } 2518 2519 //-------------------------------------------------------------------------- 2520 // VarArgsType 2005 2521 template< typename pass_type > 2006 2522 void PassVisitor< pass_type >::visit( VarArgsType * node ) { 2007 VISIT_BODY( node ); 2008 } 2009 2523 VISIT_START( node ); 2524 2525 maybeAccept_impl( node->forall, *this ); 2526 2527 VISIT_END( node ); 2528 } 2529 2530 template< typename pass_type > 2531 Type * PassVisitor< pass_type >::mutate( VarArgsType * node ) { 2532 MUTATE_START( node ); 2533 2534 maybeMutate_impl( node->forall, *this ); 2535 2536 MUTATE_END( Type, node ); 2537 } 2538 2539 //-------------------------------------------------------------------------- 2540 // ZeroType 2010 2541 template< typename pass_type > 2011 2542 void PassVisitor< pass_type >::visit( ZeroType * node ) { 2012 VISIT_BODY( node ); 2013 } 2014 2543 VISIT_START( node ); 2544 2545 maybeAccept_impl( node->forall, *this ); 2546 2547 VISIT_END( node ); 2548 } 2549 2550 template< typename pass_type > 2551 Type * PassVisitor< pass_type >::mutate( ZeroType * node ) { 2552 MUTATE_START( node ); 2553 2554 maybeMutate_impl( node->forall, *this ); 2555 2556 MUTATE_END( Type, node ); 2557 } 2558 2559 //-------------------------------------------------------------------------- 2560 // OneType 2015 2561 template< typename pass_type > 2016 2562 void PassVisitor< pass_type >::visit( OneType * node ) { 2017 VISIT_BODY( node ); 2018 } 2019 2563 VISIT_START( node ); 2564 2565 maybeAccept_impl( node->forall, *this ); 2566 2567 VISIT_END( node ); 2568 } 2569 2570 template< typename pass_type > 2571 Type * PassVisitor< pass_type >::mutate( OneType * node ) { 2572 MUTATE_START( node ); 2573 2574 maybeMutate_impl( node->forall, *this ); 2575 2576 MUTATE_END( Type, node ); 2577 } 2578 2579 //-------------------------------------------------------------------------- 2580 // GlobalScopeType 2581 template< typename pass_type > 2582 void PassVisitor< pass_type >::visit( GlobalScopeType * node ) { 2583 VISIT_START( node ); 2584 2585 maybeAccept_impl( node->forall, *this ); 2586 2587 VISIT_END( node ); 2588 } 2589 2590 template< typename pass_type > 2591 Type * PassVisitor< pass_type >::mutate( GlobalScopeType * node ) { 2592 MUTATE_START( node ); 2593 2594 maybeMutate_impl( node->forall, *this ); 2595 2596 MUTATE_END( Type, node ); 2597 } 2598 2599 //-------------------------------------------------------------------------- 2600 // Designation 2020 2601 template< typename pass_type > 2021 2602 void PassVisitor< pass_type >::visit( Designation * node ) { 2022 2603 VISIT_START( node ); 2023 2604 2024 maybeAccept_impl( node-> get_designators(), *this );2605 maybeAccept_impl( node->designators, *this ); 2025 2606 2026 2607 VISIT_END( node ); … … 2031 2612 MUTATE_START( node ); 2032 2613 2033 maybeMutate_impl( node-> get_designators(), *this );2614 maybeMutate_impl( node->designators, *this ); 2034 2615 2035 2616 MUTATE_END( Designation, node ); … … 2042 2623 VISIT_START( node ); 2043 2624 2044 visitExpression( node-> get_value());2625 visitExpression( node->value ); 2045 2626 2046 2627 VISIT_END( node ); … … 2051 2632 MUTATE_START( node ); 2052 2633 2053 node-> set_value( mutateExpression( node->get_value() ));2634 node->value = mutateExpression( node->value ); 2054 2635 2055 2636 MUTATE_END( Initializer, node ); 2056 2637 } 2057 2638 2639 //-------------------------------------------------------------------------- 2640 // ListInit 2058 2641 template< typename pass_type > 2059 2642 void PassVisitor< pass_type >::visit( ListInit * node ) { 2060 VISIT_BODY( node ); 2061 } 2062 2643 VISIT_START( node ); 2644 2645 maybeAccept_impl( node->designations, *this ); 2646 maybeAccept_impl( node->initializers, *this ); 2647 2648 VISIT_END( node ); 2649 } 2650 2651 template< typename pass_type > 2652 Initializer * PassVisitor< pass_type >::mutate( ListInit * node ) { 2653 MUTATE_START( node ); 2654 2655 maybeMutate_impl( node->designations, *this ); 2656 maybeMutate_impl( node->initializers, *this ); 2657 2658 MUTATE_END( Initializer, node ); 2659 } 2660 2661 //-------------------------------------------------------------------------- 2662 // ConstructorInit 2063 2663 template< typename pass_type > 2064 2664 void PassVisitor< pass_type >::visit( ConstructorInit * node ) { 2065 VISIT_BODY( node ); 2066 } 2067 2665 VISIT_START( node ); 2666 2667 maybeAccept_impl( node->ctor, *this ); 2668 maybeAccept_impl( node->dtor, *this ); 2669 maybeAccept_impl( node->init, *this ); 2670 2671 VISIT_END( node ); 2672 } 2673 2674 template< typename pass_type > 2675 Initializer * PassVisitor< pass_type >::mutate( ConstructorInit * node ) { 2676 MUTATE_START( node ); 2677 2678 maybeMutate_impl( node->ctor, *this ); 2679 maybeMutate_impl( node->dtor, *this ); 2680 maybeMutate_impl( node->init, *this ); 2681 2682 MUTATE_END( Initializer, node ); 2683 } 2684 2685 //-------------------------------------------------------------------------- 2686 // Subrange 2068 2687 template< typename pass_type > 2069 2688 void PassVisitor< pass_type >::visit( Subrange * node ) { 2070 VISIT_BODY( node ); 2071 } 2072 2689 VISIT_START( node ); 2690 2691 VISIT_END( node ); 2692 } 2693 2694 template< typename pass_type > 2695 Subrange * PassVisitor< pass_type >::mutate( Subrange * node ) { 2696 MUTATE_START( node ); 2697 2698 MUTATE_END( Subrange, node ); 2699 } 2700 2701 //-------------------------------------------------------------------------- 2702 // Attribute 2073 2703 template< typename pass_type > 2074 2704 void PassVisitor< pass_type >::visit( Constant * node ) { 2075 VISIT_BODY( node ); 2076 } 2077 2705 VISIT_START( node ); 2706 2707 VISIT_END( node ); 2708 } 2709 2710 template< typename pass_type > 2711 Constant * PassVisitor< pass_type >::mutate( Constant * node ) { 2712 MUTATE_START( node ); 2713 2714 MUTATE_END( Constant, node ); 2715 } 2716 2717 //-------------------------------------------------------------------------- 2718 // Attribute 2078 2719 template< typename pass_type > 2079 2720 void PassVisitor< pass_type >::visit( Attribute * node ) { 2080 VISIT_BODY( node ); 2081 } 2082 2083 //--------------------------------------------------------------------------------------------------------------- 2084 template< typename pass_type > 2085 Type * PassVisitor< pass_type >::mutate( VoidType * node ) { 2086 MUTATE_BODY( Type, node ); 2087 } 2088 2089 template< typename pass_type > 2090 Type * PassVisitor< pass_type >::mutate( BasicType * node ) { 2091 MUTATE_BODY( Type, node ); 2092 } 2093 2094 template< typename pass_type > 2095 Type * PassVisitor< pass_type >::mutate( PointerType * node ) { 2096 MUTATE_BODY( Type, node ); 2097 } 2098 2099 template< typename pass_type > 2100 Type * PassVisitor< pass_type >::mutate( ArrayType * node ) { 2101 MUTATE_BODY( Type, node ); 2102 } 2103 2104 template< typename pass_type > 2105 Type * PassVisitor< pass_type >::mutate( ReferenceType * node ) { 2106 MUTATE_BODY( Type, node ); 2107 } 2108 2109 template< typename pass_type > 2110 Type * PassVisitor< pass_type >::mutate( FunctionType * node ) { 2111 MUTATE_BODY( Type, node ); 2112 } 2113 2114 template< typename pass_type > 2115 Type * PassVisitor< pass_type >::mutate( TypeInstType * node ) { 2116 MUTATE_BODY( Type, node ); 2117 } 2118 2119 template< typename pass_type > 2120 Type * PassVisitor< pass_type >::mutate( TupleType * node ) { 2121 MUTATE_BODY( Type, node ); 2122 } 2123 2124 template< typename pass_type > 2125 Type * PassVisitor< pass_type >::mutate( TypeofType * node ) { 2126 MUTATE_BODY( Type, node ); 2127 } 2128 2129 template< typename pass_type > 2130 Type * PassVisitor< pass_type >::mutate( AttrType * node ) { 2131 MUTATE_BODY( Type, node ); 2132 } 2133 2134 template< typename pass_type > 2135 Type * PassVisitor< pass_type >::mutate( VarArgsType * node ) { 2136 MUTATE_BODY( Type, node ); 2137 } 2138 2139 template< typename pass_type > 2140 Type * PassVisitor< pass_type >::mutate( ZeroType * node ) { 2141 MUTATE_BODY( Type, node ); 2142 } 2143 2144 template< typename pass_type > 2145 Type * PassVisitor< pass_type >::mutate( OneType * node ) { 2146 MUTATE_BODY( Type, node ); 2147 } 2148 2149 template< typename pass_type > 2150 Initializer * PassVisitor< pass_type >::mutate( ListInit * node ) { 2151 MUTATE_BODY( Initializer, node ); 2152 } 2153 2154 template< typename pass_type > 2155 Initializer * PassVisitor< pass_type >::mutate( ConstructorInit * node ) { 2156 MUTATE_BODY( Initializer, node ); 2157 } 2158 2159 template< typename pass_type > 2160 Subrange * PassVisitor< pass_type >::mutate( Subrange * node ) { 2161 MUTATE_BODY( Subrange, node ); 2162 } 2163 2164 template< typename pass_type > 2165 Constant * PassVisitor< pass_type >::mutate( Constant * node ) { 2166 MUTATE_BODY( Constant, node ); 2721 VISIT_START( node ); 2722 2723 maybeAccept_impl( node->parameters, *this ); 2724 2725 VISIT_END( node ); 2167 2726 } 2168 2727 2169 2728 template< typename pass_type > 2170 2729 Attribute * PassVisitor< pass_type >::mutate( Attribute * node ) { 2171 MUTATE_BODY( Attribute, node ); 2172 } 2173 2730 MUTATE_START( node ); 2731 2732 maybeMutate_impl( node->parameters, *this ); 2733 2734 MUTATE_END( Attribute, node ); 2735 } 2736 2737 //-------------------------------------------------------------------------- 2738 // TypeSubstitution 2174 2739 template< typename pass_type > 2175 2740 TypeSubstitution * PassVisitor< pass_type >::mutate( TypeSubstitution * node ) { -
src/Common/PassVisitor.proto.h
rf9feab8 r90152a4 47 47 48 48 operator bool() { return m_ref ? *m_ref : true; } 49 bool operator=( bool val ) { return *m_ref = val; }49 bool operator=( bool val ) { assert(m_ref); return *m_ref = val; } 50 50 51 51 private: … … 53 53 friend class ChildrenGuard; 54 54 55 bool * set( bool &val ) {55 bool * set( bool * val ) { 56 56 bool * prev = m_ref; 57 m_ref = &val;57 m_ref = val; 58 58 return prev; 59 59 } … … 67 67 ChildrenGuard( bool_ref * ref ) 68 68 : m_val ( true ) 69 , m_prev( ref ? ref->set( m_val ) : nullptr )69 , m_prev( ref ? ref->set( &m_val ) : nullptr ) 70 70 , m_ref ( ref ) 71 71 {} … … 73 73 ~ChildrenGuard() { 74 74 if( m_ref ) { 75 m_ref->set( *m_prev );75 m_ref->set( m_prev ); 76 76 } 77 77 } … … 193 193 194 194 195 #define INDEXER_FUNC ( func, type ) \195 #define INDEXER_FUNC1( func, type ) \ 196 196 template<typename pass_type> \ 197 197 static inline auto indexer_impl_##func ( pass_type & pass, int, type arg ) -> decltype( pass.indexer.func( arg ), void() ) { \ … … 202 202 static inline void indexer_impl_##func ( pass_type &, long, type ) { } \ 203 203 204 INDEXER_FUNC( addId , DeclarationWithType * ); 205 INDEXER_FUNC( addType , NamedTypeDecl * ); 206 INDEXER_FUNC( addStruct , StructDecl * ); 207 INDEXER_FUNC( addEnum , EnumDecl * ); 208 INDEXER_FUNC( addUnion , UnionDecl * ); 209 INDEXER_FUNC( addTrait , TraitDecl * ); 210 INDEXER_FUNC( addWith , WithStmt * ); 204 #define INDEXER_FUNC2( func, type1, type2 ) \ 205 template<typename pass_type> \ 206 static inline auto indexer_impl_##func ( pass_type & pass, int, type1 arg1, type2 arg2 ) -> decltype( pass.indexer.func( arg1, arg2 ), void() ) { \ 207 pass.indexer.func( arg1, arg2 ); \ 208 } \ 209 \ 210 template<typename pass_type> \ 211 static inline void indexer_impl_##func ( pass_type &, long, type1, type2 ) { } 212 213 214 INDEXER_FUNC1( addId , DeclarationWithType * ); 215 INDEXER_FUNC1( addType , NamedTypeDecl * ); 216 INDEXER_FUNC1( addStruct , StructDecl * ); 217 INDEXER_FUNC1( addEnum , EnumDecl * ); 218 INDEXER_FUNC1( addUnion , UnionDecl * ); 219 INDEXER_FUNC1( addTrait , TraitDecl * ); 220 INDEXER_FUNC2( addWith , std::list< Expression * > &, BaseSyntaxNode * ); 211 221 212 222 -
src/Common/ScopedMap.h
rf9feab8 r90152a4 10 10 // Created On : Wed Dec 2 11:37:00 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 21 22:18:24 201713 // Update Count : 212 // Last Modified On : Mon May 21 15:22:40 2018 13 // Update Count : 3 14 14 // 15 15 … … 22 22 #include <vector> 23 23 24 /// Default (empty) ScopedMap note type 25 struct EmptyNote {}; 26 24 27 /// A map where the items are placed into nested scopes; 25 /// inserted items are placed into the innermost scope, lookup looks from the innermost scope outward 26 template<typename Key, typename Value> 28 /// inserted items are placed into the innermost scope, lookup looks from the innermost scope outward. 29 /// Scopes may be annotated with a value; the annotation defaults to empty 30 template<typename Key, typename Value, typename Note = EmptyNote> 27 31 class ScopedMap { 28 typedef std::map< Key, Value > Scope; 32 typedef std::map< Key, Value > MapType; 33 struct Scope { 34 MapType map; 35 Note note; 36 37 template<typename N> 38 Scope(N&& n) : map(), note(std::forward<N>(n)) {} 39 40 Scope() = default; 41 Scope(const Scope&) = default; 42 Scope(Scope&&) = default; 43 Scope& operator= (const Scope&) = default; 44 Scope& operator= (Scope&&) = default; 45 }; 29 46 typedef std::vector< Scope > ScopeList; 30 47 31 48 ScopeList scopes; ///< scoped list of maps 32 49 public: 33 typedef typename Scope::key_type key_type;34 typedef typename Scope::mapped_type mapped_type;35 typedef typename Scope::value_type value_type;50 typedef typename MapType::key_type key_type; 51 typedef typename MapType::mapped_type mapped_type; 52 typedef typename MapType::value_type value_type; 36 53 typedef typename ScopeList::size_type size_type; 37 54 typedef typename ScopeList::difference_type difference_type; 38 typedef typename Scope::reference reference;39 typedef typename Scope::const_reference const_reference;40 typedef typename Scope::pointer pointer;41 typedef typename Scope::const_pointer const_pointer;55 typedef typename MapType::reference reference; 56 typedef typename MapType::const_reference const_reference; 57 typedef typename MapType::pointer pointer; 58 typedef typename MapType::const_pointer const_pointer; 42 59 43 60 class iterator : public std::iterator< std::bidirectional_iterator_tag, … … 45 62 friend class ScopedMap; 46 63 friend class const_iterator; 47 typedef typename std::map< Key, Value >::iterator wrapped_iterator;48 typedef typename std::vector< std::map< Key, Value > >scope_list;64 typedef typename ScopedMap::MapType::iterator wrapped_iterator; 65 typedef typename ScopedMap::ScopeList scope_list; 49 66 typedef typename scope_list::size_type size_type; 50 67 51 68 /// Checks if this iterator points to a valid item 52 69 bool is_valid() const { 53 return it != (*scopes)[level]. end();70 return it != (*scopes)[level].map.end(); 54 71 } 55 72 … … 79 96 80 97 iterator& operator++ () { 81 if ( it == (*scopes)[level]. end() ) {98 if ( it == (*scopes)[level].map.end() ) { 82 99 if ( level == 0 ) return *this; 83 100 --level; 84 it = (*scopes)[level]. begin();101 it = (*scopes)[level].map.begin(); 85 102 } else { 86 103 ++it; … … 92 109 iterator& operator-- () { 93 110 // may fail if this is the begin iterator; allowed by STL spec 94 if ( it == (*scopes)[level]. begin() ) {111 if ( it == (*scopes)[level].map.begin() ) { 95 112 ++level; 96 it = (*scopes)[level]. end();113 it = (*scopes)[level].map.end(); 97 114 } 98 115 --it; … … 107 124 108 125 size_type get_level() const { return level; } 126 127 Note& get_note() { return (*scopes)[level].note; } 128 const Note& get_note() const { return (*scopes)[level].note; } 109 129 110 130 private: … … 117 137 value_type > { 118 138 friend class ScopedMap; 119 typedef typename std::map< Key, Value >::iterator wrapped_iterator;120 typedef typename std::map< Key, Value >::const_iterator wrapped_const_iterator;121 typedef typename std::vector< std::map< Key, Value > >scope_list;139 typedef typename ScopedMap::MapType::iterator wrapped_iterator; 140 typedef typename ScopedMap::MapType::const_iterator wrapped_const_iterator; 141 typedef typename ScopedMap::ScopeList scope_list; 122 142 typedef typename scope_list::size_type size_type; 123 143 124 144 /// Checks if this iterator points to a valid item 125 145 bool is_valid() const { 126 return it != (*scopes)[level]. end();146 return it != (*scopes)[level].map.end(); 127 147 } 128 148 … … 157 177 158 178 const_iterator& operator++ () { 159 if ( it == (*scopes)[level]. end() ) {179 if ( it == (*scopes)[level].map.end() ) { 160 180 if ( level == 0 ) return *this; 161 181 --level; 162 it = (*scopes)[level]. begin();182 it = (*scopes)[level].map.begin(); 163 183 } else { 164 184 ++it; … … 170 190 const_iterator& operator-- () { 171 191 // may fail if this is the begin iterator; allowed by STL spec 172 if ( it == (*scopes)[level]. begin() ) {192 if ( it == (*scopes)[level].map.begin() ) { 173 193 ++level; 174 it = (*scopes)[level]. end();194 it = (*scopes)[level].map.end(); 175 195 } 176 196 --it; … … 185 205 186 206 size_type get_level() const { return level; } 207 208 const Note& get_note() const { return (*scopes)[level].note; } 187 209 188 210 private: … … 197 219 } 198 220 221 // Starts a new scope with the given note 222 template<typename N> 223 void beginScope( N&& n ) { 224 scopes.emplace_back( std::forward<N>(n) ); 225 } 226 199 227 /// Ends a scope; invalidates any iterators pointing to elements of that scope 200 228 void endScope() { … … 204 232 205 233 /// Default constructor initializes with one scope 206 ScopedMap() { beginScope(); } 207 208 iterator begin() { return iterator(scopes, scopes.back().begin(), currentScope()).next_valid(); } 209 const_iterator begin() const { return const_iterator(scopes, scopes.back().begin(), currentScope()).next_valid(); } 210 const_iterator cbegin() const { return const_iterator(scopes, scopes.back().begin(), currentScope()).next_valid(); } 211 iterator end() { return iterator(scopes, scopes[0].end(), 0); } 212 const_iterator end() const { return const_iterator(scopes, scopes[0].end(), 0); } 213 const_iterator cend() const { return const_iterator(scopes, scopes[0].end(), 0); } 234 ScopedMap() : scopes() { beginScope(); } 235 236 /// Constructs with a given note on the outermost scope 237 template<typename N> 238 ScopedMap( N&& n ) : scopes() { beginScope(std::forward<N>(n)); } 239 240 iterator begin() { return iterator(scopes, scopes.back().map.begin(), currentScope()).next_valid(); } 241 const_iterator begin() const { return const_iterator(scopes, scopes.back().map.begin(), currentScope()).next_valid(); } 242 const_iterator cbegin() const { return const_iterator(scopes, scopes.back().map.begin(), currentScope()).next_valid(); } 243 iterator end() { return iterator(scopes, scopes[0].map.end(), 0); } 244 const_iterator end() const { return const_iterator(scopes, scopes[0].map.end(), 0); } 245 const_iterator cend() const { return const_iterator(scopes, scopes[0].map.end(), 0); } 214 246 215 247 /// Gets the index of the current scope (counted from 1) 216 248 size_type currentScope() const { return scopes.size() - 1; } 249 250 /// Gets the note at the given scope 251 Note& getNote( size_type i ) { return scopes[i].note; } 252 const Note& getNote( size_type i ) const { return scopes[i].note; } 217 253 218 254 /// Finds the given key in the outermost scope it occurs; returns end() for none such 219 255 iterator find( const Key &key ) { 220 256 for ( size_type i = scopes.size() - 1; ; --i ) { 221 typename Scope::iterator val = scopes[i].find( key );222 if ( val != scopes[i]. end() ) return iterator( scopes, val, i );257 typename MapType::iterator val = scopes[i].map.find( key ); 258 if ( val != scopes[i].map.end() ) return iterator( scopes, val, i ); 223 259 if ( i == 0 ) break; 224 260 } … … 226 262 } 227 263 const_iterator find( const Key &key ) const { 228 return const_iterator( const_cast< ScopedMap< Key, Value >* >(this)->find( key ) );264 return const_iterator( const_cast< ScopedMap< Key, Value, Note >* >(this)->find( key ) ); 229 265 } 230 266 231 267 /// Finds the given key in the provided scope; returns end() for none such 232 268 iterator findAt( size_type scope, const Key& key ) { 233 typename Scope::iterator val = scopes[scope].find( key );234 if ( val != scopes[scope]. end() ) return iterator( scopes, val, scope );269 typename MapType::iterator val = scopes[scope].map.find( key ); 270 if ( val != scopes[scope].map.end() ) return iterator( scopes, val, scope ); 235 271 return end(); 236 272 } 237 273 const_iterator findAt( size_type scope, const Key& key ) const { 238 return const_iterator( const_cast< ScopedMap< Key, Value >* >(this)->findAt( scope, key ) );274 return const_iterator( const_cast< ScopedMap< Key, Value, Note >* >(this)->findAt( scope, key ) ); 239 275 } 240 276 … … 243 279 if ( it.level == 0 ) return end(); 244 280 for ( size_type i = it.level - 1; ; --i ) { 245 typename Scope::iterator val = scopes[i].find( key );246 if ( val != scopes[i]. end() ) return iterator( scopes, val, i );281 typename MapType::iterator val = scopes[i].map.find( key ); 282 if ( val != scopes[i].map.end() ) return iterator( scopes, val, i ); 247 283 if ( i == 0 ) break; 248 284 } … … 250 286 } 251 287 const_iterator findNext( const_iterator &it, const Key &key ) const { 252 return const_iterator( const_cast< ScopedMap< Key, Value >* >(this)->findNext( it, key ) );288 return const_iterator( const_cast< ScopedMap< Key, Value, Note >* >(this)->findNext( it, key ) ); 253 289 } 254 290 … … 256 292 template< typename value_type_t > 257 293 std::pair< iterator, bool > insert( value_type_t&& value ) { 258 std::pair< typename Scope::iterator, bool > res = scopes.back().insert( std::forward<value_type_t>( value ) );294 std::pair< typename MapType::iterator, bool > res = scopes.back().map.insert( std::forward<value_type_t>( value ) ); 259 295 return std::make_pair( iterator(scopes, std::move( res.first ), scopes.size()-1), std::move( res.second ) ); 260 296 } … … 262 298 template< typename value_type_t > 263 299 std::pair< iterator, bool > insert( iterator at, value_type_t&& value ) { 264 Scope& scope = (*at.scopes) [ at.level ];265 std::pair< typename Scope::iterator, bool > res = scope.insert( std::forward<value_type_t>( value ) );300 MapType& scope = (*at.scopes)[ at.level ].map; 301 std::pair< typename MapType::iterator, bool > res = scope.insert( std::forward<value_type_t>( value ) ); 266 302 return std::make_pair( iterator(scopes, std::move( res.first ), at.level), std::move( res.second ) ); 267 303 } … … 272 308 template< typename value_type_t > 273 309 std::pair< iterator, bool > insertAt( size_type scope, value_type_t&& value ) { 274 std::pair< typename Scope::iterator, bool > res = scopes.at(scope).insert( std::forward<value_type_t>( value ) );310 std::pair< typename MapType::iterator, bool > res = scopes.at(scope).map.insert( std::forward<value_type_t>( value ) ); 275 311 return std::make_pair( iterator(scopes, std::move( res.first ), scope), std::move( res.second ) ); 312 } 313 314 template< typename value_t > 315 std::pair< iterator, bool > insertAt( size_type scope, const Key& key, value_t&& value ) { 316 return insertAt( scope, std::make_pair( key, std::forward<value_t>( value ) ) ); 276 317 } 277 318 … … 283 324 284 325 iterator erase( iterator pos ) { 285 Scope& scope = (*pos.scopes) [ pos.level ];326 MapType& scope = (*pos.scopes)[ pos.level ].map; 286 327 const typename iterator::wrapped_iterator& new_it = scope.erase( pos.it ); 287 328 iterator it( *pos.scopes, new_it, pos.level ); -
src/Common/SemanticError.cc
rf9feab8 r90152a4 7 7 // SemanticError.cc -- 8 8 // 9 // Author : Richard C. Bilson9 // Author : Thierry Delisle 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Aug 29 18:17:35 201713 // Update Count : 312 // Last Modified On : Thu Jun 7 08:05:26 2018 13 // Update Count : 10 14 14 // 15 15 16 #include <cstdarg> 16 17 #include <cstdio> // for fileno, stderr 18 #include <cstring> 17 19 #include <unistd.h> // for isatty 18 20 #include <iostream> // for basic_ostream, operator<<, ostream 19 21 #include <list> // for list, _List_iterator 20 22 #include <string> // for string, operator<<, operator+, to_string 23 #include <vector> 21 24 22 25 #include "Common/utility.h" // for to_string, CodeLocation (ptr only) 23 26 #include "SemanticError.h" 24 27 25 SemanticError::SemanticError() { 28 //----------------------------------------------------------------------------- 29 // Severity Handling 30 std::vector<Severity> & get_severities() { 31 static std::vector<Severity> severities; 32 if(severities.empty()) { 33 severities.reserve((size_t)Warning::NUMBER_OF_WARNINGS); 34 for ( const auto w : WarningFormats ) { 35 severities.push_back( w.default_severity ); 36 } // for 37 } 38 return severities; 26 39 } 27 40 28 SemanticError::SemanticError( std::string error ) { 29 append( error ); 41 void SemanticWarning_SuppressAll() { 42 for( auto & s : get_severities() ) { 43 s = Severity::Suppress; 44 } 30 45 } 31 46 32 void SemanticError::append( SemanticError &other ) { 47 void SemanticWarning_EnableAll() { 48 for( auto & s : get_severities() ) { 49 s = Severity::Warn; 50 } 51 } 52 53 void SemanticWarning_WarningAsError() { 54 for( auto & s : get_severities() ) { 55 if(s == Severity::Warn) s = Severity::Error; 56 } 57 } 58 59 void SemanticWarning_Set(const char * const name, Severity s) { 60 size_t idx = 0; 61 for ( const auto & w : WarningFormats ) { 62 if ( std::strcmp( name, w.name ) == 0 ) { 63 get_severities()[idx] = s; 64 break; 65 } 66 idx++; 67 } 68 } 69 70 //----------------------------------------------------------------------------- 71 // Semantic Error 72 bool SemanticErrorThrow = false; 73 74 SemanticErrorException::SemanticErrorException( CodeLocation location, std::string error ) { 75 append( location, error ); 76 } 77 78 void SemanticErrorException::append( SemanticErrorException &other ) { 33 79 errors.splice( errors.end(), other.errors ); 34 80 } 35 81 36 void SemanticError ::append(const std::string & msg ) {37 errors.emplace_back( error_str() +msg );82 void SemanticErrorException::append( CodeLocation location, const std::string & msg ) { 83 errors.emplace_back( location, msg ); 38 84 } 39 85 40 bool SemanticError ::isEmpty() const {86 bool SemanticErrorException::isEmpty() const { 41 87 return errors.empty(); 42 88 } 43 89 44 void SemanticError ::print( std::ostream &os) {90 void SemanticErrorException::print() { 45 91 using std::to_string; 46 92 for( auto err : errors ) { 47 os << err.location<< err.description << std::endl;93 std::cerr << ErrorHelpers::bold() << err.location << ErrorHelpers::error_str() << ErrorHelpers::reset_font() << err.description << std::endl; 48 94 } 49 95 } 50 96 51 void SemanticError::set_location( const CodeLocation& location ) { 52 errors.begin()->maybeSet( location ); 97 void SemanticError( CodeLocation location, std::string error ) { 98 SemanticErrorThrow = true; 99 throw SemanticErrorException( location, error ); 100 } 101 102 namespace { 103 // convert format string and arguments into a single string 104 std::string fmtToString(const char * fmt, va_list ap) { 105 int size = 128; 106 while ( true ) { 107 char buf[size]; 108 va_list args; 109 va_copy( args, ap ); 110 int n = vsnprintf(&buf[0], size, fmt, args); 111 va_end( args ); 112 if ( n < size && n >= 0 ) return buf; 113 size *= 2; 114 } 115 assert( false ); 116 } 117 } 118 119 void SemanticWarningImpl( CodeLocation location, Warning warning, const char * const fmt, ... ) { 120 Severity severity = get_severities()[(int)warning]; 121 switch(severity) { 122 case Severity::Suppress : 123 break; 124 case Severity::Warn : 125 { 126 va_list args; 127 va_start(args, fmt); 128 std::string msg = fmtToString( fmt, args ); 129 va_end(args); 130 std::cerr << ErrorHelpers::bold() << location << ErrorHelpers::warning_str() << ErrorHelpers::reset_font() << msg << std::endl; 131 } 132 break; 133 case Severity::Error : 134 { 135 va_list args; 136 va_start(args, fmt); 137 std::string msg = fmtToString( fmt, args ); 138 va_end(args); 139 SemanticError(location, msg); 140 } 141 break; 142 case Severity::Critical : 143 assertf(false, "Critical errors not implemented yet"); 144 break; 145 } 146 } 147 148 //----------------------------------------------------------------------------- 149 // Helpers 150 namespace ErrorHelpers { 151 const std::string & error_str() { 152 static std::string str = isatty( STDERR_FILENO ) ? "\e[31merror:\e[39m " : "error: "; 153 return str; 154 } 155 156 const std::string & warning_str() { 157 static std::string str = isatty( STDERR_FILENO ) ? "\e[95mwarning:\e[39m " : "warning: "; 158 return str; 159 } 160 161 const std::string & bold_ttycode() { 162 static std::string str = isatty( STDERR_FILENO ) ? "\e[1m" : ""; 163 return str; 164 } 165 166 const std::string & reset_font_ttycode() { 167 static std::string str = isatty( STDERR_FILENO ) ? "\e[0m" : ""; 168 return str; 169 } 170 171 std::string make_bold( const std::string & str ) { 172 return bold_ttycode() + str + reset_font_ttycode(); 173 } 174 175 std::ostream & operator<<(std::ostream & os, bold) { 176 os << bold_ttycode(); 177 return os; 178 } 179 180 std::ostream & operator<<(std::ostream & os, reset_font) { 181 os << reset_font_ttycode(); 182 return os; 183 } 53 184 } 54 185 -
src/Common/SemanticError.h
rf9feab8 r90152a4 7 7 // SemanticError.h -- 8 8 // 9 // Author : Richard C. Bilson9 // Author : Thierry Delisle 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Aug 29 22:03:36 201713 // Update Count : 1712 // Last Modified On : Thu Jul 19 10:09:17 2018 13 // Update Count : 31 14 14 // 15 15 16 16 #pragma once 17 17 18 #include <exception> // for exception 19 #include <iostream> // for ostream 20 #include <list> // for list 21 #include <string> // for string 22 #include <unistd.h> // for isatty 18 #include "ErrorObjects.h" 19 #include <cstring> 23 20 24 #include "CodeLocation.h" // for CodeLocation, toString 21 //----------------------------------------------------------------------------- 22 // Errors 25 23 26 struct error { 27 std::string description; 28 CodeLocation location; 24 extern bool SemanticErrorThrow; 29 25 30 error() = default; 31 error( const std::string & str ) : description( str ) {} 26 __attribute__((noreturn)) void SemanticError( CodeLocation location, std::string error ); 32 27 33 void maybeSet( const CodeLocation & location ) { 34 if( this->location.isUnset() ) { 35 this->location = location; 36 } 37 } 28 template< typename T > 29 __attribute__((noreturn)) static inline void SemanticError( const T * obj, const std::string & error ) { 30 SemanticError( obj->location, toString( error, obj ) ); 31 } 32 33 template< typename T > 34 __attribute__((noreturn)) static inline void SemanticError( CodeLocation location, const T * obj, const std::string & error ) { 35 SemanticError( location, toString( error, obj ) ); 36 } 37 38 //----------------------------------------------------------------------------- 39 // Warnings 40 41 enum class Severity { 42 Suppress, 43 Warn, 44 Error, 45 Critical 38 46 }; 39 47 40 class SemanticError : public std::exception { 41 public: 42 SemanticError(); 43 SemanticError( std::string error ); 44 template< typename T > SemanticError( const std::string & error, const T * obj ); 45 ~SemanticError() throw() {} 46 47 static inline const std::string & error_str() { 48 static std::string str = isatty( STDERR_FILENO ) ? "\e[31merror:\e[39m " : "error: "; 49 return str; 50 } 51 52 void append( SemanticError & other ); 53 void append( const std::string & ); 54 bool isEmpty() const; 55 void print( std::ostream & os ); 56 57 void set_location( const CodeLocation & location ); 58 // constructs an exception using the given message and the printed representation of the obj (T must have a print 59 // method) 60 private: 61 std::list< error > errors; 48 struct WarningData { 49 const char * const name; 50 const char * const message; 51 const Severity default_severity; 62 52 }; 63 53 64 template< typename T > 65 SemanticError::SemanticError( const std::string & error, const T * obj ) { 66 append( toString( error, obj ) ); 54 constexpr WarningData WarningFormats[] = { 55 {"self-assign" , "self assignment of expression: %s" , Severity::Warn}, 56 {"reference-conversion" , "rvalue to reference conversion of rvalue: %s" , Severity::Warn}, 57 {"qualifiers-zero_t-one_t", "questionable use of type qualifier %s with %s", Severity::Warn}, 58 {"aggregate-forward-decl" , "forward declaration of nested aggregate: %s" , Severity::Warn}, 59 {"superfluous-decl" , "declaration does not allocate storage: %s" , Severity::Warn}, 60 {"gcc-attributes" , "invalid attribute: %s" , Severity::Warn}, 61 }; 62 63 enum class Warning { 64 SelfAssignment, 65 RvalueToReferenceConversion, 66 BadQualifiersZeroOne, 67 AggrForwardDecl, 68 SuperfluousDecl, 69 GccAttributes, 70 NUMBER_OF_WARNINGS, // This MUST be the last warning 71 }; 72 73 static_assert( 74 (sizeof(WarningFormats) / sizeof(WarningFormats[0])) == ((unsigned long)Warning::NUMBER_OF_WARNINGS), 75 "Each warning format should have a corresponding warning enum value" 76 ); 77 78 #define SemanticWarning(loc, id, ...) SemanticWarningImpl(loc, id, WarningFormats[(int)id].message, __VA_ARGS__) 79 80 void SemanticWarningImpl (CodeLocation loc, Warning warn, const char * const fmt, ...) __attribute__((format(printf, 3, 4))); 81 82 void SemanticWarning_SuppressAll (); 83 void SemanticWarning_EnableAll (); 84 void SemanticWarning_WarningAsError(); 85 void SemanticWarning_Set (const char * const name, Severity s); 86 87 // SKULLDUGGERY: cfa.cc is built before SemanticError.cc but needs this routine. 88 static inline bool SemanticWarning_Exist(const char * const name) { 89 for ( const auto & w : WarningFormats ) { 90 if ( std::strcmp( name, w.name ) == 0 ) return true; 91 } 92 return false; 93 } 94 95 //----------------------------------------------------------------------------- 96 // Helpers 97 namespace ErrorHelpers { 98 const std::string & error_str(); 99 const std::string & warning_str(); 100 const std::string & bold_ttycode(); 101 const std::string & reset_font_ttycode(); 102 103 std::string make_bold( const std::string & str ); 104 105 struct bold {}; 106 std::ostream & operator<<(std::ostream & os, bold); 107 108 struct reset_font {}; 109 std::ostream & operator<<(std::ostream & os, reset_font); 67 110 } 68 111 -
src/Common/module.mk
rf9feab8 r90152a4 6 6 ## file "LICENCE" distributed with Cforall. 7 7 ## 8 ## module.mk -- 8 ## module.mk -- 9 9 ## 10 10 ## Author : Richard C. Bilson … … 18 18 Common/UniqueName.cc \ 19 19 Common/DebugMalloc.cc \ 20 Common/Assert.cc 20 Common/Assert.cc \ 21 Common/Heap.cc \ 22 Common/Eval.cc -
src/Common/utility.h
rf9feab8 r90152a4 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Thr Aug 17 11:38:00 201713 // Update Count : 3411 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun May 6 22:24:16 2018 13 // Update Count : 40 14 14 // 15 15 … … 31 31 #include "Common/Indenter.h" 32 32 33 class Expression; 34 33 35 template< typename T > 34 36 static inline T * maybeClone( const T *orig ) { … … 98 100 } 99 101 102 template< typename SrcContainer, typename DestContainer, typename Predicate > 103 void cloneAll_if( const SrcContainer &src, DestContainer &dest, Predicate pred ) { 104 std::back_insert_iterator< DestContainer > out( dest ); 105 for ( auto x : src ) { 106 if ( pred(x) ) { 107 *out++ = x->clone(); 108 } 109 } // while 110 } 111 100 112 template< typename Container > 101 113 void assertAll( const Container &container ) { … … 151 163 return os.str(); 152 164 } 165 166 #define toCString( ... ) toString( __VA_ARGS__ ).c_str() 153 167 154 168 // replace element of list with all elements of another list … … 424 438 } 425 439 426 440 // ----------------------------------------------------------------------------- 441 // O(1) polymorphic integer ilog2, using clz, which returns the number of leading 0-bits, starting at the most 442 // significant bit (single instruction on x86) 443 444 template<typename T> 445 inline 446 #if defined(__GNUC__) && __GNUC__ > 4 447 constexpr 448 #endif 449 T ilog2(const T & t) { 450 if(std::is_integral<T>::value) { 451 const constexpr int r = sizeof(t) * __CHAR_BIT__ - 1; 452 if( sizeof(T) == sizeof(unsigned int) ) return r - __builtin_clz ( t ); 453 if( sizeof(T) == sizeof(unsigned long) ) return r - __builtin_clzl ( t ); 454 if( sizeof(T) == sizeof(unsigned long long) ) return r - __builtin_clzll( t ); 455 } 456 assert(false); 457 return -1; 458 } // ilog2 459 460 // ----------------------------------------------------------------------------- 461 /// evaluates expr as a long long int. If second is false, expr could not be evaluated 462 std::pair<long long int, bool> eval(Expression * expr); 427 463 428 464 // Local Variables: // -
src/Concurrency/Keywords.cc
rf9feab8 r90152a4 25 25 #include "InitTweak/InitTweak.h" // for getPointerBase 26 26 #include "Parser/LinkageSpec.h" // for Cforall 27 #include "SymTab/AddVisit.h" // for acceptAndAdd28 27 #include "SynTree/Constant.h" // for Constant 29 28 #include "SynTree/Declaration.h" // for StructDecl, FunctionDecl, ObjectDecl … … 54 53 public: 55 54 56 ConcurrentSueKeyword( std::string&& type_name, std::string&& field_name, std::string&& getter_name, std::string&& context_error, bool needs_main ) :57 type_name( type_name ), field_name( field_name ), getter_name( getter_name ), context_error( context_error ), needs_main( needs_main ) {}55 ConcurrentSueKeyword( std::string&& type_name, std::string&& field_name, std::string&& getter_name, std::string&& context_error, bool needs_main, KeywordCastExpr::Target cast_target ) : 56 type_name( type_name ), field_name( field_name ), getter_name( getter_name ), context_error( context_error ), needs_main( needs_main ), cast_target( cast_target ) {} 58 57 59 58 virtual ~ConcurrentSueKeyword() {} 60 59 61 void postvisit( StructDecl * decl );60 Declaration * postmutate( StructDecl * decl ); 62 61 63 62 void handle( StructDecl * ); … … 67 66 68 67 virtual bool is_target( StructDecl * decl ) = 0; 68 69 Expression * postmutate( KeywordCastExpr * cast ); 69 70 70 71 private: … … 74 75 const std::string context_error; 75 76 bool needs_main; 77 KeywordCastExpr::Target cast_target; 76 78 77 79 StructDecl* type_decl = nullptr; … … 95 97 "__thrd", 96 98 "get_thread", 97 "thread keyword requires threads to be in scope, add #include <thread>", 98 true 99 "thread keyword requires threads to be in scope, add #include <thread.hfa>", 100 true, 101 KeywordCastExpr::Thread 99 102 ) 100 103 {} … … 106 109 static void implement( std::list< Declaration * > & translationUnit ) { 107 110 PassVisitor< ThreadKeyword > impl; 108 acceptAll( translationUnit, impl );111 mutateAll( translationUnit, impl ); 109 112 } 110 113 }; … … 126 129 "__cor", 127 130 "get_coroutine", 128 "coroutine keyword requires coroutines to be in scope, add #include <coroutine>", 129 true 131 "coroutine keyword requires coroutines to be in scope, add #include <coroutine.hfa>", 132 true, 133 KeywordCastExpr::Coroutine 130 134 ) 131 135 {} … … 137 141 static void implement( std::list< Declaration * > & translationUnit ) { 138 142 PassVisitor< CoroutineKeyword > impl; 139 acceptAll( translationUnit, impl );143 mutateAll( translationUnit, impl ); 140 144 } 141 145 }; … … 157 161 "__mon", 158 162 "get_monitor", 159 "monitor keyword requires monitors to be in scope, add #include <monitor>", 160 false 163 "monitor keyword requires monitors to be in scope, add #include <monitor.hfa>", 164 false, 165 KeywordCastExpr::Monitor 161 166 ) 162 167 {} … … 168 173 static void implement( std::list< Declaration * > & translationUnit ) { 169 174 PassVisitor< MonitorKeyword > impl; 170 acceptAll( translationUnit, impl );175 mutateAll( translationUnit, impl ); 171 176 } 172 177 }; … … 186 191 void postvisit( StructDecl * decl ); 187 192 188 std::list<DeclarationWithType*> findMutexArgs( FunctionDecl* );193 std::list<DeclarationWithType*> findMutexArgs( FunctionDecl*, bool & first ); 189 194 void validate( DeclarationWithType * ); 190 195 void addDtorStatments( FunctionDecl* func, CompoundStmt *, const std::list<DeclarationWithType * > &); … … 257 262 // Generic keyword implementation 258 263 //============================================================================================= 259 void ConcurrentSueKeyword::postvisit(StructDecl * decl) { 264 void fixupGenerics(FunctionType * func, StructDecl * decl) { 265 cloneAll(decl->parameters, func->forall); 266 for ( TypeDecl * td : func->forall ) { 267 strict_dynamic_cast<StructInstType*>( 268 func->parameters.front()->get_type()->stripReferences() 269 )->parameters.push_back( 270 new TypeExpr( new TypeInstType( noQualifiers, td->name, td ) ) 271 ); 272 } 273 } 274 275 Declaration * ConcurrentSueKeyword::postmutate(StructDecl * decl) { 260 276 if( decl->name == type_name && decl->body ) { 261 277 assert( !type_decl ); … … 265 281 handle( decl ); 266 282 } 267 268 } 283 return decl; 284 } 285 286 Expression * ConcurrentSueKeyword::postmutate( KeywordCastExpr * cast ) { 287 if ( cast_target == cast->target ) { 288 // convert (thread &)t to (thread_desc &)*get_thread(t), etc. 289 if( !type_decl ) SemanticError( cast, context_error ); 290 Expression * arg = cast->arg; 291 cast->arg = nullptr; 292 delete cast; 293 return new CastExpr( 294 UntypedExpr::createDeref( 295 new UntypedExpr( new NameExpr( getter_name ), { arg } ) 296 ), 297 new ReferenceType( 298 noQualifiers, 299 new StructInstType( noQualifiers, type_decl ) ) 300 ); 301 } 302 return cast; 303 } 304 269 305 270 306 void ConcurrentSueKeyword::handle( StructDecl * decl ) { 271 307 if( ! decl->body ) return; 272 308 273 if( !type_decl ) throw SemanticError( context_error, decl);309 if( !type_decl ) SemanticError( decl, context_error ); 274 310 275 311 FunctionDecl * func = forwardDeclare( decl ); … … 301 337 ); 302 338 303 get_type->get_parameters().push_back( this_decl );339 get_type->get_parameters().push_back( this_decl->clone() ); 304 340 get_type->get_returnVals().push_back( 305 341 new ObjectDecl( … … 318 354 ) 319 355 ); 356 fixupGenerics(get_type, decl); 320 357 321 358 FunctionDecl * get_decl = new FunctionDecl( … … 343 380 nullptr 344 381 ); 345 } 382 fixupGenerics(main_type, decl); 383 } 384 385 delete this_decl; 346 386 347 387 declsToAddBefore.push_back( forward ); … … 377 417 new MemberExpr( 378 418 field, 379 UntypedExpr::createDeref( new VariableExpr( func->get_functionType()->get_parameters().front() ) ) 419 new CastExpr( 420 new VariableExpr( func->get_functionType()->get_parameters().front() ), 421 func->get_functionType()->get_parameters().front()->get_type()->stripReferences()->clone() 422 ) 380 423 ) 381 424 ) … … 398 441 void MutexKeyword::postvisit(FunctionDecl* decl) { 399 442 400 std::list<DeclarationWithType*> mutexArgs = findMutexArgs( decl ); 401 if( mutexArgs.empty() ) return; 402 403 if( CodeGen::isConstructor(decl->name) ) throw SemanticError( "constructors cannot have mutex parameters", decl ); 404 443 bool first = false; 444 std::list<DeclarationWithType*> mutexArgs = findMutexArgs( decl, first ); 405 445 bool isDtor = CodeGen::isDestructor( decl->name ); 406 446 407 if( isDtor && mutexArgs.size() != 1 ) throw SemanticError( "destructors can only have 1 mutex argument", decl ); 408 447 // Is this function relevant to monitors 448 if( mutexArgs.empty() ) { 449 // If this is the destructor for a monitor it must be mutex 450 if(isDtor) { 451 Type* ty = decl->get_functionType()->get_parameters().front()->get_type(); 452 453 // If it's a copy, it's not a mutex 454 ReferenceType* rty = dynamic_cast< ReferenceType * >( ty ); 455 if( ! rty ) return; 456 457 // If we are not pointing directly to a type, it's not a mutex 458 Type* base = rty->get_base(); 459 if( dynamic_cast< ReferenceType * >( base ) ) return; 460 if( dynamic_cast< PointerType * >( base ) ) return; 461 462 // Check if its a struct 463 StructInstType * baseStruct = dynamic_cast< StructInstType * >( base ); 464 if( !baseStruct ) return; 465 466 // Check if its a monitor 467 if(baseStruct->baseStruct->is_monitor() || baseStruct->baseStruct->is_thread()) 468 SemanticError( decl, "destructors for structures declared as \"monitor\" must use mutex parameters\n" ); 469 } 470 return; 471 } 472 473 // Monitors can't be constructed with mutual exclusion 474 if( CodeGen::isConstructor(decl->name) && !first ) SemanticError( decl, "constructors cannot have mutex parameters" ); 475 476 // It makes no sense to have multiple mutex parameters for the destructor 477 if( isDtor && mutexArgs.size() != 1 ) SemanticError( decl, "destructors can only have 1 mutex argument" ); 478 479 // Make sure all the mutex arguments are monitors 409 480 for(auto arg : mutexArgs) { 410 481 validate( arg ); 411 482 } 412 483 484 // Check if we need to instrument the body 413 485 CompoundStmt* body = decl->get_statements(); 414 486 if( ! body ) return; 415 487 416 if( !monitor_decl ) throw SemanticError( "mutex keyword requires monitors to be in scope, add #include <monitor>", decl ); 417 if( !guard_decl ) throw SemanticError( "mutex keyword requires monitors to be in scope, add #include <monitor>", decl ); 418 if( !dtor_guard_decl ) throw SemanticError( "mutex keyword requires monitors to be in scope, add #include <monitor>", decl ); 419 488 // Do we have the required headers 489 if( !monitor_decl || !guard_decl || !dtor_guard_decl ) 490 SemanticError( decl, "mutex keyword requires monitors to be in scope, add #include <monitor.hfa>\n" ); 491 492 // Instrument the body 420 493 if( isDtor ) { 421 494 addDtorStatments( decl, body, mutexArgs ); … … 428 501 void MutexKeyword::postvisit(StructDecl* decl) { 429 502 430 if( decl->name == "monitor_desc" ) {503 if( decl->name == "monitor_desc" && decl->body ) { 431 504 assert( !monitor_decl ); 432 505 monitor_decl = decl; 433 506 } 434 else if( decl->name == "monitor_guard_t" ) {507 else if( decl->name == "monitor_guard_t" && decl->body ) { 435 508 assert( !guard_decl ); 436 509 guard_decl = decl; 437 510 } 438 else if( decl->name == "monitor_dtor_guard_t" ) {511 else if( decl->name == "monitor_dtor_guard_t" && decl->body ) { 439 512 assert( !dtor_guard_decl ); 440 513 dtor_guard_decl = decl; … … 442 515 } 443 516 444 std::list<DeclarationWithType*> MutexKeyword::findMutexArgs( FunctionDecl* decl ) {517 std::list<DeclarationWithType*> MutexKeyword::findMutexArgs( FunctionDecl* decl, bool & first ) { 445 518 std::list<DeclarationWithType*> mutexArgs; 446 519 520 bool once = true; 447 521 for( auto arg : decl->get_functionType()->get_parameters()) { 448 522 //Find mutex arguments … … 450 524 if( ! ty->get_mutex() ) continue; 451 525 526 if(once) {first = true;} 527 once = false; 528 452 529 //Append it to the list 453 530 mutexArgs.push_back( arg ); … … 462 539 //Makes sure it's not a copy 463 540 ReferenceType* rty = dynamic_cast< ReferenceType * >( ty ); 464 if( ! rty ) throw SemanticError( "Mutex argument must be of reference type ", arg);541 if( ! rty ) SemanticError( arg, "Mutex argument must be of reference type " ); 465 542 466 543 //Make sure the we are pointing directly to a type 467 544 Type* base = rty->get_base(); 468 if( dynamic_cast< ReferenceType * >( base ) ) throw SemanticError( "Mutex argument have exactly one level of indirection ", arg);469 if( dynamic_cast< PointerType * >( base ) ) throw SemanticError( "Mutex argument have exactly one level of indirection ", arg);545 if( dynamic_cast< ReferenceType * >( base ) ) SemanticError( arg, "Mutex argument have exactly one level of indirection " ); 546 if( dynamic_cast< PointerType * >( base ) ) SemanticError( arg, "Mutex argument have exactly one level of indirection " ); 470 547 471 548 //Make sure that typed isn't mutex 472 if( base->get_mutex() ) throw SemanticError( "mutex keyword may only appear once per argument ", arg);549 if( base->get_mutex() ) SemanticError( arg, "mutex keyword may only appear once per argument " ); 473 550 } 474 551 … … 608 685 if( type && type->get_baseStruct()->is_thread() ) { 609 686 if( !thread_decl || !thread_ctor_seen ) { 610 throw SemanticError("thread keyword requires threads to be in scope, add #include <thread>");687 SemanticError( type->get_baseStruct()->location, "thread keyword requires threads to be in scope, add #include <thread.hfa>"); 611 688 } 612 689 -
src/Concurrency/Waitfor.cc
rf9feab8 r90152a4 249 249 250 250 Statement * GenerateWaitForPass::postmutate( WaitForStmt * waitfor ) { 251 if( !decl_monitor || !decl_acceptable || !decl_mask ) throw SemanticError( "waitfor keyword requires monitors to be in scope, add #include <monitor>", waitfor ); 251 if( !decl_monitor || !decl_acceptable || !decl_mask ) 252 SemanticError( waitfor, "waitfor keyword requires monitors to be in scope, add #include <monitor.hfa>" ); 252 253 253 254 CompoundStmt * stmt = new CompoundStmt(); … … 507 508 new ListInit({ 508 509 new SingleInit( new AddressExpr( new VariableExpr( index ) ) ), 509 new SingleInit( new VariableExpr( acceptables ) ), 510 new SingleInit( new ConstantExpr( Constant::from_ulong( count ) ) ) 510 new ListInit({ 511 new SingleInit( new VariableExpr( acceptables ) ), 512 new SingleInit( new ConstantExpr( Constant::from_ulong( count ) ) ) 513 }) 511 514 }) 512 515 ); -
src/ControlStruct/ExceptTranslate.cc
rf9feab8 r90152a4 34 34 #include "SynTree/Statement.h" // for CompoundStmt, CatchStmt, ThrowStmt 35 35 #include "SynTree/Type.h" // for FunctionType, Type, noQualifiers 36 #include "SynTree/ VarExprReplacer.h" // for VarExprReplacer, VarExprReplace...36 #include "SynTree/DeclReplacer.h" // for DeclReplacer 37 37 #include "SynTree/Visitor.h" // for acceptAll 38 38 … … 314 314 // Update variables in the body to point to this local copy. 315 315 { 316 VarExprReplacer::DeclMap mapping; 317 mapping[ handler_decl ] = new VariableExpr( local_except ); 318 VarExprReplacer mapper( mapping ); 319 handler->body->acceptMutator( mapper ); 316 DeclReplacer::DeclMap mapping; 317 mapping[ handler_decl ] = local_except; 318 DeclReplacer::replace( handler->body, mapping ); 320 319 } 321 320 … … 573 572 // Pass. 574 573 } else if ( CatchStmt::Terminate == catchStmt->get_kind() ) { 575 throw SemanticError("catch must have exception type");574 SemanticError(catchStmt->location, "catch must have exception type"); 576 575 } else { 577 throw SemanticError("catchResume must have exception type");576 SemanticError(catchStmt->location, "catchResume must have exception type"); 578 577 } 579 578 -
src/ControlStruct/ForExprMutator.cc
rf9feab8 r90152a4 45 45 return hoist( forStmt, forStmt->initialization ); 46 46 } 47 Statement *ForExprMutator::postmutate( WhileStmt *whileStmt ) { 48 return hoist( whileStmt, whileStmt->initialization ); 49 } 47 50 } // namespace ControlStruct 48 51 -
src/ControlStruct/ForExprMutator.h
rf9feab8 r90152a4 18 18 class IfStmt; 19 19 class ForStmt; 20 class WhileStmt; 20 21 class Statement; 21 22 … … 25 26 Statement *postmutate( IfStmt * ); 26 27 Statement *postmutate( ForStmt * ); 28 Statement *postmutate( WhileStmt * ); 27 29 }; 28 30 } // namespace ControlStruct -
src/ControlStruct/LabelFixer.cc
rf9feab8 r90152a4 44 44 45 45 void LabelFixer::postvisit( FunctionDecl * functionDecl ) { 46 MLEMutatormlemut( resolveJumps(), generator );46 PassVisitor<MLEMutator> mlemut( resolveJumps(), generator ); 47 47 functionDecl->acceptMutator( mlemut ); 48 48 } … … 92 92 } else if ( labelTable[ l ]->defined() ) { 93 93 // defined twice, error 94 throw SemanticError("Duplicate definition of label: " + l.get_name() );94 SemanticError( l.get_statement()->location, "Duplicate definition of label: " + l.get_name() ); 95 95 } else { 96 96 // used previously, but undefined until now -> link with this entry … … 117 117 118 118 // Builds a table that maps a label to its defining statement. 119 std::map<Label, Statement * > *LabelFixer::resolveJumps() throw ( SemanticError ) {119 std::map<Label, Statement * > *LabelFixer::resolveJumps() throw ( SemanticErrorException ) { 120 120 std::map< Label, Statement * > *ret = new std::map< Label, Statement * >(); 121 121 for ( std::map< Label, Entry * >::iterator i = labelTable.begin(); i != labelTable.end(); ++i ) { 122 122 if ( ! i->second->defined() ) { 123 throw SemanticError("Use of undefined label: " + i->first.get_name() );123 SemanticError( i->first.get_statement()->location, "Use of undefined label: " + i->first.get_name() ); 124 124 } 125 125 (*ret)[ i->first ] = i->second->get_definition(); -
src/ControlStruct/LabelFixer.h
rf9feab8 r90152a4 33 33 LabelFixer( LabelGenerator *gen = 0 ); 34 34 35 std::map < Label, Statement * > *resolveJumps() throw ( SemanticError );35 std::map < Label, Statement * > *resolveJumps() throw ( SemanticErrorException ); 36 36 37 37 // Declarations -
src/ControlStruct/MLEMutator.cc
rf9feab8 r90152a4 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Aug 4 11:21:32 201613 // Update Count : 2 0212 // Last Modified On : Thu Mar 8 17:08:25 2018 13 // Update Count : 219 14 14 // 15 15 … … 38 38 } 39 39 namespace { 40 Statement * isLoop( Statement * stmt ) { return dynamic_cast< WhileStmt * >( stmt ) ? stmt : dynamic_cast< ForStmt * >( stmt ) ? stmt : 0; } 41 } 40 bool isLoop( const MLEMutator::Entry & e ) { return dynamic_cast< WhileStmt * >( e.get_controlStructure() ) || dynamic_cast< ForStmt * >( e.get_controlStructure() ); } 41 bool isSwitch( const MLEMutator::Entry & e ) { return dynamic_cast< SwitchStmt *>( e.get_controlStructure() ); } 42 43 bool isBreakTarget( const MLEMutator::Entry & e ) { return isLoop( e ) || isSwitch( e ) || dynamic_cast< CompoundStmt *>( e.get_controlStructure() ); } 44 bool isContinueTarget( const MLEMutator::Entry & e ) { return isLoop( e ); } 45 bool isFallthroughTarget( const MLEMutator::Entry & e ) { return dynamic_cast< CaseStmt *>( e.get_controlStructure() );; } 46 bool isFallthroughDefaultTarget( const MLEMutator::Entry & e ) { return isSwitch( e ); } 47 } // namespace 42 48 43 49 // break labels have to come after the statement they break out of, so mutate a statement, then if they inform us 44 50 // through the breakLabel field tha they need a place to jump to on a break statement, add the break label to the 45 51 // body of statements 46 void MLEMutator::fixBlock( std::list< Statement * > &kids ) { 52 void MLEMutator::fixBlock( std::list< Statement * > &kids, bool caseClause ) { 53 SemanticErrorException errors; 54 47 55 for ( std::list< Statement * >::iterator k = kids.begin(); k != kids.end(); k++ ) { 48 *k = (*k)->acceptMutator(*this); 56 if ( caseClause ) { 57 // once a label is seen, it's no longer a valid fallthrough target 58 for ( Label & l : (*k)->labels ) { 59 fallthroughLabels.erase( l ); 60 } 61 } 62 63 // aggregate errors since the PassVisitor mutate loop was unrollled 64 try { 65 *k = (*k)->acceptMutator(*visitor); 66 } catch( SemanticErrorException &e ) { 67 errors.append( e ); 68 } 49 69 50 70 if ( ! get_breakLabel().empty() ) { … … 55 75 } // if 56 76 } // for 57 } 58 59 CompoundStmt* MLEMutator::mutate( CompoundStmt *cmpndStmt ) { 60 bool labeledBlock = !(cmpndStmt->get_labels().empty()); 77 78 if ( ! errors.isEmpty() ) { 79 throw errors; 80 } 81 } 82 83 void MLEMutator::premutate( CompoundStmt *cmpndStmt ) { 84 visit_children = false; 85 bool labeledBlock = !(cmpndStmt->labels.empty()); 61 86 if ( labeledBlock ) { 62 87 Label brkLabel = generator->newLabel("blockBreak", cmpndStmt); 63 88 enclosingControlStructures.push_back( Entry( cmpndStmt, brkLabel ) ); 89 GuardAction( [this]() { enclosingControlStructures.pop_back(); } ); 64 90 } // if 65 91 66 92 // a child statement may set the break label - if they do, attach it to the next statement 67 std::list< Statement * > &kids = cmpndStmt-> get_kids();93 std::list< Statement * > &kids = cmpndStmt->kids; 68 94 fixBlock( kids ); 69 95 … … 73 99 set_breakLabel( enclosingControlStructures.back().useBreakExit() ); 74 100 } // if 75 enclosingControlStructures.pop_back(); 76 } // if 77 78 return cmpndStmt; 79 } 80 81 template< typename LoopClass > 82 Statement *MLEMutator::handleLoopStmt( LoopClass *loopStmt ) { 83 // remember this as the most recent enclosing loop, then mutate the body of the loop -- this will determine 84 // whether brkLabel and contLabel are used with branch statements and will recursively do the same to nested 85 // loops 86 Label brkLabel = generator->newLabel("loopBreak", loopStmt); 87 Label contLabel = generator->newLabel("loopContinue", loopStmt); 88 enclosingControlStructures.push_back( Entry( loopStmt, brkLabel, contLabel ) ); 89 loopStmt->set_body ( loopStmt->get_body()->acceptMutator( *this ) ); 90 91 assert( ! enclosingControlStructures.empty() ); 92 Entry &e = enclosingControlStructures.back(); 93 // sanity check that the enclosing loops have been popped correctly 94 assert ( e == loopStmt ); 95 96 // this will take the necessary steps to add definitions of the previous two labels, if they are used. 97 loopStmt->set_body( mutateLoop( loopStmt->get_body(), e ) ); 98 enclosingControlStructures.pop_back(); 99 100 return loopStmt; 101 } 102 103 Statement *MLEMutator::mutate( CaseStmt *caseStmt ) { 104 caseStmt->set_condition( maybeMutate( caseStmt->get_condition(), *this ) ); 105 fixBlock( caseStmt->get_statements() ); 106 107 return caseStmt; 108 } 109 110 template< typename IfClass > 111 Statement *MLEMutator::handleIfStmt( IfClass *ifStmt ) { 112 // generate a label for breaking out of a labeled if 113 bool labeledBlock = !(ifStmt->get_labels().empty()); 114 if ( labeledBlock ) { 115 Label brkLabel = generator->newLabel("blockBreak", ifStmt); 116 enclosingControlStructures.push_back( Entry( ifStmt, brkLabel ) ); 117 } // if 118 119 Parent::mutate( ifStmt ); 120 121 if ( labeledBlock ) { 122 if ( ! enclosingControlStructures.back().useBreakExit().empty() ) { 123 set_breakLabel( enclosingControlStructures.back().useBreakExit() ); 124 } // if 125 enclosingControlStructures.pop_back(); 126 } // if 127 return ifStmt; 128 } 129 130 template< typename SwitchClass > 131 Statement *MLEMutator::handleSwitchStmt( SwitchClass *switchStmt ) { 132 // generate a label for breaking out of a labeled switch 133 Label brkLabel = generator->newLabel("switchBreak", switchStmt); 134 enclosingControlStructures.push_back( Entry(switchStmt, brkLabel) ); 135 mutateAll( switchStmt->get_statements(), *this ); 136 137 Entry &e = enclosingControlStructures.back(); 138 assert ( e == switchStmt ); 139 140 // only generate break label if labeled break is used 141 if ( e.isBreakUsed() ) { 142 // for the purposes of keeping switch statements uniform (i.e. all statements that are direct children of a 143 // switch should be CastStmts), append the exit label + break to the last case statement; create a default 144 // case if there are no cases 145 std::list< Statement * > &statements = switchStmt->get_statements(); 146 if ( statements.empty() ) { 147 statements.push_back( CaseStmt::makeDefault() ); 148 } // if 149 150 if ( CaseStmt * c = dynamic_cast< CaseStmt * >( statements.back() ) ) { 151 Statement * stmt = new BranchStmt( Label("brkLabel"), BranchStmt::Break ); 152 stmt->labels.push_back( brkLabel ); 153 c->get_statements().push_back( stmt ); 154 } else assert(0); // as of this point, all statements of a switch are still CaseStmts 155 } // if 156 157 assert ( enclosingControlStructures.back() == switchStmt ); 158 enclosingControlStructures.pop_back(); 159 return switchStmt; 160 } 101 } // if 102 } 103 161 104 162 105 void addUnused( Statement * stmt, const Label & originalTarget ) { … … 179 122 180 123 181 Statement *MLEMutator:: mutate( BranchStmt *branchStmt ) throw ( SemanticError) {182 std::string originalTarget = branchStmt-> get_originalTarget();124 Statement *MLEMutator::postmutate( BranchStmt *branchStmt ) throw ( SemanticErrorException ) { 125 std::string originalTarget = branchStmt->originalTarget; 183 126 184 127 std::list< Entry >::reverse_iterator targetEntry; … … 193 136 if ( isContinue ) { 194 137 // continue target is outermost loop 195 targetEntry = std::find_if( enclosingControlStructures.rbegin(), enclosingControlStructures.rend(), [](Entry &e) { return isLoop( e.get_controlStructure() ); });138 targetEntry = std::find_if( enclosingControlStructures.rbegin(), enclosingControlStructures.rend(), isContinueTarget ); 196 139 } else { 197 // break target is out mostcontrol structure198 if ( enclosingControlStructures.empty() ) throw SemanticError( "'break' outside a loop, switch, or labelled block" );199 targetEntry = enclosingControlStructures.rbegin();140 // break target is outermost loop, switch, or block control structure 141 if ( enclosingControlStructures.empty() ) SemanticError( branchStmt->location, "'break' outside a loop, 'switch', or labelled block" ); 142 targetEntry = std::find_if( enclosingControlStructures.rbegin(), enclosingControlStructures.rend(), isBreakTarget ); 200 143 } // if 201 144 } else { … … 204 147 } // if 205 148 // ensure that selected target is valid 206 if ( targetEntry == enclosingControlStructures.rend() || (isContinue && ! is Loop( targetEntry->get_controlStructure()) ) ) {207 throw SemanticError(toString( (isContinue ? "'continue'" : "'break'"), " target must be an enclosing ", (isContinue ? "loop: " : "control structure: "), originalTarget ) );149 if ( targetEntry == enclosingControlStructures.rend() || (isContinue && ! isContinueTarget( *targetEntry ) ) ) { 150 SemanticError( branchStmt->location, toString( (isContinue ? "'continue'" : "'break'"), " target must be an enclosing ", (isContinue ? "loop: " : "control structure: "), originalTarget ) ); 208 151 } // if 209 152 break; 210 153 } 154 case BranchStmt::FallThrough: 155 targetEntry = std::find_if( enclosingControlStructures.rbegin(), enclosingControlStructures.rend(), isFallthroughTarget ); 156 // ensure that selected target is valid 157 if ( targetEntry == enclosingControlStructures.rend() ) { 158 SemanticError( branchStmt->location, "'fallthrough' must be enclosed in a 'switch' or 'choose'" ); 159 } // if 160 if ( branchStmt->get_target() != "" ) { 161 // labelled fallthrough 162 // target must be in the set of valid fallthrough labels 163 if ( ! fallthroughLabels.count( branchStmt->get_target() ) ) { 164 SemanticError( branchStmt->location, toString( "'fallthrough' target must be a later case statement: ", originalTarget ) ); 165 } 166 return new BranchStmt( originalTarget, BranchStmt::Goto ); 167 } 168 break; 169 case BranchStmt::FallThroughDefault: { 170 // fallthrough default 171 targetEntry = std::find_if( enclosingControlStructures.rbegin(), enclosingControlStructures.rend(), isFallthroughDefaultTarget ); 172 173 // ensure that fallthrough is within a switch or choose 174 if ( targetEntry == enclosingControlStructures.rend() ) { 175 SemanticError( branchStmt->location, "'fallthrough' must be enclosed in a 'switch' or 'choose'" ); 176 } // if 177 178 // ensure that switch or choose has a default clause 179 SwitchStmt * switchStmt = strict_dynamic_cast< SwitchStmt * >( targetEntry->get_controlStructure() ); 180 bool foundDefault = false; 181 for ( Statement * stmt : switchStmt->statements ) { 182 CaseStmt * caseStmt = strict_dynamic_cast< CaseStmt * >( stmt ); 183 if ( caseStmt->isDefault() ) { 184 foundDefault = true; 185 } // if 186 } // for 187 if ( ! foundDefault ) { 188 SemanticError( branchStmt->location, "'fallthrough default' must be enclosed in a 'switch' or 'choose' control structure with a 'default' clause" ); 189 } 190 break; 191 } 192 211 193 default: 212 194 assert( false ); … … 215 197 // branch error checks, get the appropriate label name and create a goto 216 198 Label exitLabel; 217 switch ( branchStmt-> get_type()) {199 switch ( branchStmt->type ) { 218 200 case BranchStmt::Break: 219 201 assert( targetEntry->useBreakExit() != ""); … … 224 206 exitLabel = targetEntry->useContExit(); 225 207 break; 208 case BranchStmt::FallThrough: 209 assert( targetEntry->useFallExit() != ""); 210 exitLabel = targetEntry->useFallExit(); 211 break; 212 case BranchStmt::FallThroughDefault: 213 assert( targetEntry->useFallDefaultExit() != ""); 214 exitLabel = targetEntry->useFallDefaultExit(); 215 // check that fallthrough default comes before the default clause 216 if ( ! targetEntry->isFallDefaultValid() ) { 217 SemanticError( branchStmt->location, "'fallthrough default' must precede the 'default' clause" ); 218 } 219 break; 226 220 default: 227 221 assert(0); // shouldn't be here … … 229 223 230 224 // add unused attribute to label to silence warnings 231 addUnused( targetEntry->get_controlStructure(), branchStmt-> get_originalTarget());225 addUnused( targetEntry->get_controlStructure(), branchStmt->originalTarget ); 232 226 233 227 // transform break/continue statements into goto to simplify later handling of branches … … 260 254 } 261 255 262 Statement *MLEMutator::mutate( WhileStmt *whileStmt ) { 263 return handleLoopStmt( whileStmt ); 264 } 265 266 Statement *MLEMutator::mutate( ForStmt *forStmt ) { 267 return handleLoopStmt( forStmt ); 268 } 269 270 Statement *MLEMutator::mutate( IfStmt *ifStmt ) { 271 return handleIfStmt( ifStmt ); 272 } 273 274 Statement *MLEMutator::mutate( SwitchStmt *switchStmt ) { 275 return handleSwitchStmt( switchStmt ); 256 template< typename LoopClass > 257 void MLEMutator::prehandleLoopStmt( LoopClass * loopStmt ) { 258 // remember this as the most recent enclosing loop, then mutate the body of the loop -- this will determine 259 // whether brkLabel and contLabel are used with branch statements and will recursively do the same to nested 260 // loops 261 Label brkLabel = generator->newLabel("loopBreak", loopStmt); 262 Label contLabel = generator->newLabel("loopContinue", loopStmt); 263 enclosingControlStructures.push_back( Entry( loopStmt, brkLabel, contLabel ) ); 264 GuardAction( [this]() { enclosingControlStructures.pop_back(); } ); 265 } 266 267 template< typename LoopClass > 268 Statement * MLEMutator::posthandleLoopStmt( LoopClass * loopStmt ) { 269 assert( ! enclosingControlStructures.empty() ); 270 Entry &e = enclosingControlStructures.back(); 271 // sanity check that the enclosing loops have been popped correctly 272 assert ( e == loopStmt ); 273 274 // this will take the necessary steps to add definitions of the previous two labels, if they are used. 275 loopStmt->body = mutateLoop( loopStmt->get_body(), e ); 276 return loopStmt; 277 } 278 279 void MLEMutator::premutate( WhileStmt * whileStmt ) { 280 return prehandleLoopStmt( whileStmt ); 281 } 282 283 void MLEMutator::premutate( ForStmt * forStmt ) { 284 return prehandleLoopStmt( forStmt ); 285 } 286 287 Statement * MLEMutator::postmutate( WhileStmt * whileStmt ) { 288 return posthandleLoopStmt( whileStmt ); 289 } 290 291 Statement * MLEMutator::postmutate( ForStmt * forStmt ) { 292 return posthandleLoopStmt( forStmt ); 293 } 294 295 void MLEMutator::premutate( IfStmt * ifStmt ) { 296 // generate a label for breaking out of a labeled if 297 bool labeledBlock = !(ifStmt->get_labels().empty()); 298 if ( labeledBlock ) { 299 Label brkLabel = generator->newLabel("blockBreak", ifStmt); 300 enclosingControlStructures.push_back( Entry( ifStmt, brkLabel ) ); 301 GuardAction( [this]() { enclosingControlStructures.pop_back(); } ); 302 } // if 303 } 304 305 Statement * MLEMutator::postmutate( IfStmt * ifStmt ) { 306 bool labeledBlock = !(ifStmt->get_labels().empty()); 307 if ( labeledBlock ) { 308 if ( ! enclosingControlStructures.back().useBreakExit().empty() ) { 309 set_breakLabel( enclosingControlStructures.back().useBreakExit() ); 310 } // if 311 } // if 312 return ifStmt; 313 } 314 315 void MLEMutator::premutate( CaseStmt *caseStmt ) { 316 visit_children = false; 317 318 // mark default as seen before visiting its statements to catch default loops 319 if ( caseStmt->isDefault() ) { 320 enclosingControlStructures.back().seenDefault(); 321 } // if 322 323 caseStmt->condition = maybeMutate( caseStmt->condition, *visitor ); 324 Label fallLabel = generator->newLabel( "fallThrough", caseStmt ); 325 { 326 // ensure that stack isn't corrupted by exceptions in fixBlock 327 auto guard = makeFuncGuard( [&]() { enclosingControlStructures.push_back( Entry( caseStmt, fallLabel ) ); }, [this]() { enclosingControlStructures.pop_back(); } ); 328 329 // empty case statement 330 if( ! caseStmt->stmts.empty() ) { 331 // the parser ensures that all statements in a case are grouped into a block 332 CompoundStmt * block = strict_dynamic_cast< CompoundStmt * >( caseStmt->stmts.front() ); 333 fixBlock( block->kids, true ); 334 335 // add fallthrough label if necessary 336 assert( ! enclosingControlStructures.empty() ); 337 if ( enclosingControlStructures.back().isFallUsed() ) { 338 std::list<Label> ls{ enclosingControlStructures.back().useFallExit() }; 339 caseStmt->stmts.push_back( new NullStmt( ls ) ); 340 } // if 341 } // if 342 } 343 assert( ! enclosingControlStructures.empty() ); 344 assertf( dynamic_cast<SwitchStmt *>( enclosingControlStructures.back().get_controlStructure() ), "Control structure enclosing a case clause must be a switch, but is: %s", toCString( enclosingControlStructures.back().get_controlStructure() ) ); 345 if ( caseStmt->isDefault() ) { 346 if ( enclosingControlStructures.back().isFallDefaultUsed() ) { 347 // add fallthrough default label if necessary 348 std::list<Label> ls{ enclosingControlStructures.back().useFallDefaultExit() }; 349 caseStmt->stmts.push_front( new NullStmt( ls ) ); 350 } // if 351 } // if 352 } 353 354 void MLEMutator::premutate( SwitchStmt *switchStmt ) { 355 // generate a label for breaking out of a labeled switch 356 Label brkLabel = generator->newLabel("switchBreak", switchStmt); 357 auto it = std::find_if( switchStmt->statements.rbegin(), switchStmt->statements.rend(), [](Statement * stmt) { 358 CaseStmt * caseStmt = strict_dynamic_cast< CaseStmt * >( stmt ); 359 return caseStmt->isDefault(); 360 }); 361 CaseStmt * defaultCase = it != switchStmt->statements.rend() ? strict_dynamic_cast<CaseStmt *>( *it ) : nullptr; 362 Label fallDefaultLabel = defaultCase ? generator->newLabel( "fallThroughDefault", defaultCase ) : ""; 363 enclosingControlStructures.push_back( Entry(switchStmt, brkLabel, fallDefaultLabel) ); 364 GuardAction( [this]() { enclosingControlStructures.pop_back(); } ); 365 366 // Collect valid labels for fallthrough. This is initially all labels at the same level as a case statement. 367 // As labels are seen during traversal, they are removed, since fallthrough is not allowed to jump backwards. 368 for ( Statement * stmt : switchStmt->statements ) { 369 CaseStmt * caseStmt = strict_dynamic_cast< CaseStmt * >( stmt ); 370 if ( caseStmt->stmts.empty() ) continue; 371 CompoundStmt * block = dynamic_cast< CompoundStmt * >( caseStmt->stmts.front() ); 372 for ( Statement * stmt : block->kids ) { 373 for ( Label & l : stmt->labels ) { 374 fallthroughLabels.insert( l ); 375 } 376 } 377 } 378 } 379 380 Statement * MLEMutator::postmutate( SwitchStmt * switchStmt ) { 381 Entry &e = enclosingControlStructures.back(); 382 assert ( e == switchStmt ); 383 384 // only generate break label if labeled break is used 385 if ( e.isBreakUsed() ) { 386 // for the purposes of keeping switch statements uniform (i.e. all statements that are direct children of a 387 // switch should be CastStmts), append the exit label + break to the last case statement; create a default 388 // case if there are no cases 389 std::list< Statement * > &statements = switchStmt->statements; 390 if ( statements.empty() ) { 391 statements.push_back( CaseStmt::makeDefault() ); 392 } // if 393 394 if ( CaseStmt * c = dynamic_cast< CaseStmt * >( statements.back() ) ) { 395 Statement * stmt = new BranchStmt( Label("brkLabel"), BranchStmt::Break ); 396 stmt->labels.push_back( e.useBreakExit() ); 397 c->stmts.push_back( stmt ); 398 } else assert(0); // as of this point, all statements of a switch are still CaseStmts 399 } // if 400 401 assert ( enclosingControlStructures.back() == switchStmt ); 402 return switchStmt; 276 403 } 277 404 } // namespace ControlStruct -
src/ControlStruct/MLEMutator.h
rf9feab8 r90152a4 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 22 09:19:59 201713 // Update Count : 3512 // Last Modified On : Thu Mar 8 16:42:32 2018 13 // Update Count : 41 14 14 // 15 15 … … 19 19 #include <map> // for map 20 20 #include <string> // for string 21 #include <set> // for unordered_set 21 22 23 #include "Common/PassVisitor.h" 22 24 #include "Common/SemanticError.h" // for SemanticError 23 25 #include "SynTree/Label.h" // for Label … … 26 28 27 29 namespace ControlStruct { 28 class LabelGenerator;30 class LabelGenerator; 29 31 30 class MLEMutator : public Mutator { 32 class MLEMutator : public WithVisitorRef<MLEMutator>, public WithShortCircuiting, public WithGuards { 33 public: 31 34 class Entry; 32 33 typedef Mutator Parent;34 public:35 35 MLEMutator( std::map<Label, Statement *> *t, LabelGenerator *gen = 0 ) : targetTable( t ), breakLabel(std::string("")), generator( gen ) {} 36 36 ~MLEMutator(); 37 37 38 virtual CompoundStmt *mutate( CompoundStmt *cmpndStmt ) override; 39 virtual Statement *mutate( WhileStmt *whileStmt ) override; 40 virtual Statement *mutate( ForStmt *forStmt ) override; 41 virtual Statement *mutate( BranchStmt *branchStmt ) throw ( SemanticError ) override; 42 virtual Statement *mutate( CaseStmt *caseStmt ) override; 43 virtual Statement *mutate( IfStmt *ifStmt ) override; 44 virtual Statement *mutate( SwitchStmt *switchStmt ) override; 38 void premutate( CompoundStmt *cmpndStmt ); 39 Statement * postmutate( BranchStmt *branchStmt ) throw ( SemanticErrorException ); 40 void premutate( WhileStmt *whileStmt ); 41 Statement * postmutate( WhileStmt *whileStmt ); 42 void premutate( ForStmt *forStmt ); 43 Statement * postmutate( ForStmt *forStmt ); 44 void premutate( CaseStmt *caseStmt ); 45 void premutate( IfStmt *ifStmt ); 46 Statement * postmutate( IfStmt *ifStmt ); 47 void premutate( SwitchStmt *switchStmt ); 48 Statement * postmutate( SwitchStmt *switchStmt ); 45 49 46 50 Statement *mutateLoop( Statement *bodyLoop, Entry &e ); … … 48 52 Label &get_breakLabel() { return breakLabel; } 49 53 void set_breakLabel( Label newValue ) { breakLabel = newValue; } 50 private: 54 51 55 class Entry { 52 56 public: 53 explicit Entry( Statement *_loop, Label _breakExit, Label _contExit = Label("") ) : 54 loop( _loop ), breakExit( _breakExit ), contExit( _contExit ), breakUsed(false), contUsed(false) {} 57 // specialized constructors for each combination of statement with labelled break/continue/fallthrough that is valid to cleanup the use cases 58 explicit Entry( ForStmt *stmt, Label breakExit, Label contExit ) : 59 stmt( stmt ), breakExit( breakExit ), contExit( contExit ) {} 55 60 56 bool operator==( const Statement *stmt ) { return ( loop == stmt ); }57 bool operator!=( const Statement *stmt ) { return ( loop != stmt );}61 explicit Entry( WhileStmt *stmt, Label breakExit, Label contExit ) : 62 stmt( stmt ), breakExit( breakExit ), contExit( contExit ) {} 58 63 59 bool operator==( const Entry &other ) { return ( loop == other.get_controlStructure() ); } 64 explicit Entry( CompoundStmt *stmt, Label breakExit ) : 65 stmt( stmt ), breakExit( breakExit ) {} 60 66 61 Statement *get_controlStructure() const { return loop; } 67 explicit Entry( IfStmt *stmt, Label breakExit ) : 68 stmt( stmt ), breakExit( breakExit ) {} 69 70 explicit Entry( CaseStmt *stmt, Label fallExit ) : 71 stmt( stmt ), fallExit( fallExit ) {} 72 73 explicit Entry( SwitchStmt *stmt, Label breakExit, Label fallDefaultExit ) : 74 stmt( stmt ), breakExit( breakExit ), fallDefaultExit( fallDefaultExit ) {} 75 76 bool operator==( const Statement *other ) { return stmt == other; } 77 bool operator!=( const Statement *other ) { return stmt != other; } 78 79 bool operator==( const Entry &other ) { return stmt == other.get_controlStructure(); } 80 81 Statement *get_controlStructure() const { return stmt; } 62 82 63 83 Label useContExit() { contUsed = true; return contExit; } 64 84 Label useBreakExit() { breakUsed = true; return breakExit; } 85 Label useFallExit() { fallUsed = true; return fallExit; } 86 Label useFallDefaultExit() { fallDefaultUsed = true; return fallDefaultExit; } 65 87 66 88 bool isContUsed() const { return contUsed; } 67 89 bool isBreakUsed() const { return breakUsed; } 90 bool isFallUsed() const { return fallUsed; } 91 bool isFallDefaultUsed() const { return fallDefaultUsed; } 92 void seenDefault() { fallDefaultValid = false; } 93 bool isFallDefaultValid() const { return fallDefaultValid; } 68 94 private: 69 Statement *loop; 70 Label breakExit, contExit; 71 bool breakUsed, contUsed; 95 Statement *stmt; 96 Label breakExit, contExit, fallExit, fallDefaultExit; 97 bool breakUsed = false, contUsed = false, fallUsed = false, fallDefaultUsed = false; 98 bool fallDefaultValid = true; 72 99 }; 73 100 101 private: 74 102 std::map< Label, Statement * > *targetTable; 103 std::set< Label > fallthroughLabels; 75 104 std::list< Entry > enclosingControlStructures; 76 105 Label breakLabel; … … 78 107 79 108 template< typename LoopClass > 80 Statement *handleLoopStmt( LoopClass *loopStmt );109 void prehandleLoopStmt( LoopClass * loopStmt ); 81 110 82 template< typename IfClass >83 Statement * handleIfStmt( IfClass *switchStmt );111 template< typename LoopClass > 112 Statement * posthandleLoopStmt( LoopClass * loopStmt ); 84 113 85 template< typename SwitchClass > 86 Statement *handleSwitchStmt( SwitchClass *switchStmt ); 87 88 void fixBlock( std::list< Statement * > &kids ); 114 void fixBlock( std::list< Statement * > &kids, bool caseClause = false ); 89 115 }; 90 116 } // namespace ControlStruct -
src/ControlStruct/Mutate.cc
rf9feab8 r90152a4 18 18 19 19 #include "Common/PassVisitor.h" // for mutateAll 20 #include "Common/SemanticError.h" // for SemanticError21 20 #include "ForExprMutator.h" // for ForExprMutator 22 21 #include "LabelFixer.h" // for LabelFixer … … 28 27 #include "SynTree/Visitor.h" // for acceptAll 29 28 30 using namespace std; 29 namespace ControlStruct { 30 void fixLabels( std::list< Declaration * > & translationUnit ) { 31 PassVisitor<LabelFixer> lfix; 32 acceptAll( translationUnit, lfix ); 33 } 31 34 32 namespace ControlStruct { 33 void mutate( std::list< Declaration * > translationUnit ) { 34 // hoist initialization out of for statements 35 void hoistControlDecls( std::list< Declaration * > & translationUnit ) { 35 36 PassVisitor<ForExprMutator> formut; 36 37 // normalizes label definitions and generates multi-level exit labels38 PassVisitor<LabelFixer> lfix;39 40 37 mutateAll( translationUnit, formut ); 41 acceptAll( translationUnit, lfix );42 38 } 43 39 } // namespace CodeGen -
src/ControlStruct/Mutate.h
rf9feab8 r90152a4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Mutate.h -- 7 // Mutate.h -- 8 8 // 9 9 // Author : Rodolfo G. Esteves … … 20 20 class Declaration; 21 21 22 /// Desugars Cforall control structures 22 23 namespace ControlStruct { 23 /// Desugars Cforall control structures 24 void mutate( std::list< Declaration* > translationUnit ); 24 /// normalizes label definitions and generates multi-level exit labels 25 void fixLabels( std::list< Declaration * > & translationUnit ); 26 27 /// hoist initialization out of for statements 28 void hoistControlDecls( std::list< Declaration * > & translationUnit ); 25 29 } // namespace ControlStruct 26 30 -
src/GenPoly/Box.cc
rf9feab8 r90152a4 163 163 void premutate( DeclStmt *declStmt ); 164 164 Expression *postmutate( MemberExpr *memberExpr ); 165 void premutate( AddressExpr *addrExpr ); 166 Expression *postmutate( AddressExpr *addrExpr ); 165 167 Expression *postmutate( SizeofExpr *sizeofExpr ); 166 168 Expression *postmutate( AlignofExpr *alignofExpr ); … … 182 184 /// change the type of generic aggregate members to char[] 183 185 void mutateMembers( AggregateDecl * aggrDecl ); 186 /// returns the calculated sizeof expression for ty, or nullptr for use C sizeof() 187 Expression* genSizeof( Type* ty ); 184 188 185 189 /// Enters a new scope for type-variables, adding the type variables from ty … … 193 197 ScopedSet< std::string > knownOffsets; ///< Set of non-generic types for which the offset array exists in the current scope, indexed by offsetofName 194 198 UniqueName bufNamer; ///< Namer for VLA buffers 199 Expression * addrMember = nullptr; ///< AddressExpr argument is MemberExpr? 195 200 }; 196 201 … … 215 220 inline void mutateTranslationUnit( std::list< Declaration* > &translationUnit, MutatorType &mutator ) { 216 221 bool seenIntrinsic = false; 217 SemanticError errors;222 SemanticErrorException errors; 218 223 for ( typename std::list< Declaration* >::iterator i = translationUnit.begin(); i != translationUnit.end(); ++i ) { 219 224 try { … … 228 233 assert( *i ); 229 234 } // if 230 } catch( SemanticError &e ) { 231 e.set_location( (*i)->location ); 235 } catch( SemanticErrorException &e ) { 232 236 errors.append( e ); 233 237 } // try … … 302 306 Expression *makeOp( const std::string &name, Expression *arg ) { 303 307 UntypedExpr *expr = new UntypedExpr( new NameExpr( name ) ); 304 expr-> get_args().push_back( arg );308 expr->args.push_back( arg ); 305 309 return expr; 306 310 } … … 309 313 Expression *makeOp( const std::string &name, Expression *lhs, Expression *rhs ) { 310 314 UntypedExpr *expr = new UntypedExpr( new NameExpr( name ) ); 311 expr-> get_args().push_back( lhs );312 expr-> get_args().push_back( rhs );315 expr->args.push_back( lhs ); 316 expr->args.push_back( rhs ); 313 317 return expr; 314 318 } … … 316 320 /// Returns the dereference of a local pointer variable 317 321 Expression *derefVar( ObjectDecl *var ) { 318 return makeOp( "*?",new VariableExpr( var ) );322 return UntypedExpr::createDeref( new VariableExpr( var ) ); 319 323 } 320 324 … … 380 384 unsigned long n_members = 0; 381 385 bool firstMember = true; 382 for ( std::list< Declaration* >::const_iterator member = structDecl->get_members().begin(); member != structDecl->get_members().end(); ++member) {383 DeclarationWithType *dwt = dynamic_cast< DeclarationWithType * >( *member );386 for ( Declaration* member : structDecl->get_members() ) { 387 DeclarationWithType *dwt = dynamic_cast< DeclarationWithType * >( member ); 384 388 assert( dwt ); 385 389 Type *memberType = dwt->get_type(); … … 576 580 } 577 581 } else { 578 throw SemanticError( "Cannot pass non-struct type for generic struct: ", argBaseType);582 SemanticError( argBaseType, "Cannot pass non-struct type for generic struct: " ); 579 583 } 580 584 } … … 598 602 } else { 599 603 // xxx - should this be an assertion? 600 throw SemanticError( toString( *env, "\nunbound type variable: ", tyParm->first, " in application " ), appExpr);604 SemanticError( appExpr, toString( *env, "\nunbound type variable: ", tyParm->first, " in application " ) ); 601 605 } // if 602 606 } // if … … 831 835 if ( ! isPolyType( arg->get_type() ) ) { 832 836 UntypedExpr *deref = new UntypedExpr( new NameExpr( "*?" ) ); 833 deref->get_args().push_back( new CastExpr( new VariableExpr( param ), new PointerType( Type::Qualifiers(), arg->get_type()->clone() ) ) ); 834 deref->set_result( arg->get_type()->clone() ); 837 deref->args.push_back( new CastExpr( new VariableExpr( param ), new PointerType( Type::Qualifiers(), arg->get_type()->clone() ) ) ); 838 deref->result = arg->get_type()->clone(); 839 deref->result->set_lvalue( true ); 835 840 return deref; 836 841 } // if … … 987 992 988 993 Expression *Pass1::handleIntrinsics( ApplicationExpr *appExpr ) { 989 if ( VariableExpr *varExpr = dynamic_cast< VariableExpr *>( appExpr-> get_function()) ) {990 if ( varExpr-> get_var()->get_linkage()== LinkageSpec::Intrinsic ) {991 if ( varExpr-> get_var()->get_name()== "?[?]" ) {994 if ( VariableExpr *varExpr = dynamic_cast< VariableExpr *>( appExpr->function ) ) { 995 if ( varExpr->var->linkage == LinkageSpec::Intrinsic ) { 996 if ( varExpr->var->name == "?[?]" ) { 992 997 assert( appExpr->result ); 993 998 assert( appExpr->get_args().size() == 2 ); 994 Type *baseType1 = isPolyPtr( appExpr-> get_args().front()->get_result(), scopeTyVars, env );995 Type *baseType2 = isPolyPtr( appExpr-> get_args().back()->get_result(), scopeTyVars, env );999 Type *baseType1 = isPolyPtr( appExpr->args.front()->result, scopeTyVars, env ); 1000 Type *baseType2 = isPolyPtr( appExpr->args.back()->result, scopeTyVars, env ); 996 1001 assert( ! baseType1 || ! baseType2 ); // the arguments cannot both be polymorphic pointers 997 1002 UntypedExpr *ret = 0; … … 1174 1179 if ( expr->result && isPolyType( expr->result, scopeTyVars, env ) ) { 1175 1180 if ( NameExpr *name = dynamic_cast< NameExpr *>( expr->function ) ) { 1176 if ( name-> get_name()== "*?" ) {1181 if ( name->name == "*?" ) { 1177 1182 Expression *ret = expr->args.front(); 1178 1183 expr->args.clear(); … … 1187 1192 void Pass1::premutate( AddressExpr * ) { visit_children = false; } 1188 1193 Expression * Pass1::postmutate( AddressExpr * addrExpr ) { 1189 assert( addrExpr-> get_arg()->result && ! addrExpr->get_arg()->get_result()->isVoid() );1194 assert( addrExpr->arg->result && ! addrExpr->arg->result->isVoid() ); 1190 1195 1191 1196 bool needs = false; 1192 if ( UntypedExpr *expr = dynamic_cast< UntypedExpr *>( addrExpr-> get_arg()) ) {1193 if ( expr->result && isPolyType( expr-> get_result(), scopeTyVars, env ) ) {1194 if ( NameExpr *name = dynamic_cast< NameExpr *>( expr-> get_function()) ) {1195 if ( name-> get_name()== "*?" ) {1196 if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( expr-> get_args().front() ) ) {1197 assert( appExpr-> get_function()->result );1198 FunctionType *function = getFunctionType( appExpr-> get_function()->get_result());1197 if ( UntypedExpr *expr = dynamic_cast< UntypedExpr *>( addrExpr->arg ) ) { 1198 if ( expr->result && isPolyType( expr->result, scopeTyVars, env ) ) { 1199 if ( NameExpr *name = dynamic_cast< NameExpr *>( expr->function ) ) { 1200 if ( name->name == "*?" ) { 1201 if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( expr->args.front() ) ) { 1202 assert( appExpr->function->result ); 1203 FunctionType *function = getFunctionType( appExpr->function->result ); 1199 1204 assert( function ); 1200 1205 needs = needsAdapter( function, scopeTyVars ); … … 1206 1211 // isPolyType check needs to happen before mutating addrExpr arg, so pull it forward 1207 1212 // out of the if condition. 1208 addrExpr->arg = addrExpr-> get_arg()->acceptMutator( *visitor );1213 addrExpr->arg = addrExpr->arg->acceptMutator( *visitor ); 1209 1214 // ... but must happen after mutate, since argument might change (e.g. intrinsic *?, ?[?]) - re-evaluate above comment 1210 bool polytype = isPolyType( addrExpr-> get_arg()->get_result(), scopeTyVars, env );1215 bool polytype = isPolyType( addrExpr->arg->result, scopeTyVars, env ); 1211 1216 if ( polytype || needs ) { 1212 Expression *ret = addrExpr-> get_arg();1213 delete ret-> get_result();1214 ret-> set_result( addrExpr->get_result()->clone());1215 addrExpr-> set_arg( 0 );1217 Expression *ret = addrExpr->arg; 1218 delete ret->result; 1219 ret->result = addrExpr->result->clone(); 1220 addrExpr->arg = nullptr; 1216 1221 delete addrExpr; 1217 1222 return ret; … … 1250 1255 1251 1256 void Pass2::addAdapters( FunctionType *functionType ) { 1252 std::list< DeclarationWithType *> ¶mList = functionType-> get_parameters();1257 std::list< DeclarationWithType *> ¶mList = functionType->parameters; 1253 1258 std::list< FunctionType *> functions; 1254 1259 for ( std::list< DeclarationWithType *>::iterator arg = paramList.begin(); arg != paramList.end(); ++arg ) { … … 1271 1276 1272 1277 DeclarationWithType * Pass2::postmutate( FunctionDecl *functionDecl ) { 1273 FunctionType * ftype = functionDecl-> get_functionType();1274 if ( ! ftype-> get_returnVals().empty() && functionDecl->get_statements()) {1275 if ( ! isPrefix( functionDecl-> get_name(), "_thunk" ) && ! isPrefix( functionDecl->get_name(), "_adapter" ) ) { // xxx - remove check for prefix once thunks properly use ctor/dtors1276 assert( ftype-> get_returnVals().size() == 1 );1277 DeclarationWithType * retval = ftype-> get_returnVals().front();1278 if ( retval-> get_name()== "" ) {1279 retval-> set_name( "_retval" );1278 FunctionType * ftype = functionDecl->type; 1279 if ( ! ftype->returnVals.empty() && functionDecl->statements ) { 1280 if ( ! isPrefix( functionDecl->name, "_thunk" ) && ! isPrefix( functionDecl->name, "_adapter" ) ) { // xxx - remove check for prefix once thunks properly use ctor/dtors 1281 assert( ftype->returnVals.size() == 1 ); 1282 DeclarationWithType * retval = ftype->returnVals.front(); 1283 if ( retval->name == "" ) { 1284 retval->name = "_retval"; 1280 1285 } 1281 functionDecl-> get_statements()->get_kids().push_front( new DeclStmt( retval ) );1286 functionDecl->statements->kids.push_front( new DeclStmt( retval ) ); 1282 1287 DeclarationWithType * newRet = retval->clone(); // for ownership purposes 1283 ftype-> get_returnVals().front() = newRet;1288 ftype->returnVals.front() = newRet; 1284 1289 } 1285 1290 } 1286 1291 // errors should have been caught by this point, remove initializers from parameters to allow correct codegen of default arguments 1287 for ( Declaration * param : functionDecl-> get_functionType()->get_parameters()) {1292 for ( Declaration * param : functionDecl->type->parameters ) { 1288 1293 if ( ObjectDecl * obj = dynamic_cast< ObjectDecl * >( param ) ) { 1289 delete obj-> get_init();1290 obj-> set_init( nullptr );1294 delete obj->init; 1295 obj->init = nullptr; 1291 1296 } 1292 1297 } … … 1554 1559 // only mutate member expressions for polymorphic types 1555 1560 int tyDepth; 1556 Type *objectType = hasPolyBase( memberExpr-> get_aggregate()->get_result(), scopeTyVars, &tyDepth );1561 Type *objectType = hasPolyBase( memberExpr->aggregate->result, scopeTyVars, &tyDepth ); 1557 1562 if ( ! objectType ) return memberExpr; 1558 1563 findGeneric( objectType ); // ensure layout for this type is available 1559 1564 1560 1565 // replace member expression with dynamically-computed layout expression 1561 Expression *newMemberExpr = 0;1566 Expression *newMemberExpr = nullptr; 1562 1567 if ( StructInstType *structType = dynamic_cast< StructInstType* >( objectType ) ) { 1563 1568 // look up offset index 1564 long i = findMember( memberExpr-> get_member(), structType->get_baseStruct()->get_members());1569 long i = findMember( memberExpr->member, structType->baseStruct->members ); 1565 1570 if ( i == -1 ) return memberExpr; 1566 1571 1567 1572 // replace member expression with pointer to base plus offset 1568 1573 UntypedExpr *fieldLoc = new UntypedExpr( new NameExpr( "?+?" ) ); 1569 Expression * aggr = memberExpr-> get_aggregate()->clone();1570 delete aggr-> get_env(); // xxx - there's a problem with keeping the env for some reason, so for now just get rid of it1571 aggr-> set_env( nullptr );1574 Expression * aggr = memberExpr->aggregate->clone(); 1575 delete aggr->env; // xxx - there's a problem with keeping the env for some reason, so for now just get rid of it 1576 aggr->env = nullptr; 1572 1577 fieldLoc->get_args().push_back( aggr ); 1573 1578 fieldLoc->get_args().push_back( makeOffsetIndex( objectType, i ) ); 1574 fieldLoc->set_result( memberExpr-> get_result()->clone() );1579 fieldLoc->set_result( memberExpr->result->clone() ); 1575 1580 newMemberExpr = fieldLoc; 1576 1581 } else if ( dynamic_cast< UnionInstType* >( objectType ) ) { 1577 1582 // union members are all at offset zero, so just use the aggregate expr 1578 Expression * aggr = memberExpr-> get_aggregate()->clone();1579 delete aggr-> get_env(); // xxx - there's a problem with keeping the env for some reason, so for now just get rid of it1580 aggr-> set_env( nullptr );1583 Expression * aggr = memberExpr->aggregate->clone(); 1584 delete aggr->env; // xxx - there's a problem with keeping the env for some reason, so for now just get rid of it 1585 aggr->env= nullptr; 1581 1586 newMemberExpr = aggr; 1582 newMemberExpr-> set_result( memberExpr->get_result()->clone());1587 newMemberExpr->result = memberExpr->result->clone(); 1583 1588 } else return memberExpr; 1584 1589 assert( newMemberExpr ); 1585 1590 1586 Type *memberType = memberExpr->get_member()->get_type(); 1591 // Must apply the generic substitution to the member type to handle cases where the member is a generic parameter substituted by a known concrete type, e.g. 1592 // forall(otype T) struct Box { T x; } 1593 // forall(otype T) f() { 1594 // Box(T *) b; b.x; 1595 // } 1596 // TODO: memberExpr->result should be exactly memberExpr->member->get_type() after substitution, so it doesn't seem like it should be necessary to apply the substitution manually. For some reason this is not currently the case. This requires more investigation. 1597 Type *memberType = memberExpr->member->get_type()->clone(); 1598 TypeSubstitution sub = objectType->genericSubstitution(); 1599 sub.apply( memberType ); 1587 1600 if ( ! isPolyType( memberType, scopeTyVars ) ) { 1588 1601 // Not all members of a polymorphic type are themselves of polymorphic type; in this case the member expression should be wrapped and dereferenced to form an lvalue … … 1592 1605 } 1593 1606 1607 delete memberType; 1594 1608 delete memberExpr; 1595 1609 return newMemberExpr; 1596 1610 } 1597 1611 1612 void PolyGenericCalculator::premutate( AddressExpr * addrExpr ) { 1613 GuardValue( addrMember ); 1614 // is the argument a MemberExpr before mutating? 1615 addrMember = dynamic_cast< MemberExpr * >( addrExpr->arg ); 1616 } 1617 1618 Expression * PolyGenericCalculator::postmutate( AddressExpr * addrExpr ) { 1619 if ( addrMember && addrMember != addrExpr->arg ) { 1620 // arg was a MemberExpr and has been mutated 1621 if ( UntypedExpr * untyped = dynamic_cast< UntypedExpr * >( addrExpr->arg ) ) { 1622 if ( InitTweak::getFunctionName( untyped ) == "?+?" ) { 1623 // MemberExpr was converted to pointer+offset, and it is not valid C to take the address of an addition, so strip the address-of 1624 // TODO: should addrExpr->arg->result be changed to addrExpr->result? 1625 Expression * ret = addrExpr->arg; 1626 addrExpr->arg = nullptr; 1627 std::swap( addrExpr->env, ret->env ); 1628 delete addrExpr; 1629 return ret; 1630 } 1631 } 1632 } 1633 return addrExpr; 1634 } 1635 1598 1636 ObjectDecl *PolyGenericCalculator::makeVar( const std::string &name, Type *type, Initializer *init ) { 1599 ObjectDecl *newObj = new ObjectDecl( name, Type::StorageClasses(), LinkageSpec::C, 0, type, init );1637 ObjectDecl *newObj = new ObjectDecl( name, Type::StorageClasses(), LinkageSpec::C, nullptr, type, init ); 1600 1638 stmtsToAddBefore.push_back( new DeclStmt( newObj ) ); 1601 1639 return newObj; … … 1711 1749 } 1712 1750 1751 Expression * PolyGenericCalculator::genSizeof( Type* ty ) { 1752 if ( ArrayType * aty = dynamic_cast<ArrayType *>(ty) ) { 1753 // generate calculated size for possibly generic array 1754 Expression * sizeofBase = genSizeof( aty->get_base() ); 1755 if ( ! sizeofBase ) return nullptr; 1756 Expression * dim = aty->get_dimension(); 1757 aty->set_dimension( nullptr ); 1758 return makeOp( "?*?", sizeofBase, dim ); 1759 } else if ( findGeneric( ty ) ) { 1760 // generate calculated size for generic type 1761 return new NameExpr( sizeofName( mangleType( ty ) ) ); 1762 } else return nullptr; 1763 } 1764 1713 1765 Expression *PolyGenericCalculator::postmutate( SizeofExpr *sizeofExpr ) { 1714 Type *ty = sizeofExpr->get_isType() ? sizeofExpr->get_type() : sizeofExpr->get_expr()->get_result(); 1715 if ( findGeneric( ty ) ) { 1716 Expression *ret = new NameExpr( sizeofName( mangleType( ty ) ) ); 1766 Type *ty = sizeofExpr->get_isType() ? 1767 sizeofExpr->get_type() : sizeofExpr->get_expr()->get_result(); 1768 1769 Expression * gen = genSizeof( ty ); 1770 if ( gen ) { 1717 1771 delete sizeofExpr; 1718 return ret; 1719 } 1720 return sizeofExpr; 1772 return gen; 1773 } else return sizeofExpr; 1721 1774 } 1722 1775 -
src/GenPoly/FindFunction.cc
rf9feab8 r90152a4 19 19 20 20 #include "Common/PassVisitor.h" // for PassVisitor 21 #include "Common/SemanticError.h" // for SemanticError22 21 #include "GenPoly/ErasableScopedMap.h" // for ErasableScopedMap<>::iterator 23 22 #include "GenPoly/GenPoly.h" // for TyVarMap -
src/GenPoly/GenPoly.cc
rf9feab8 r90152a4 100 100 if ( dynamic_cast< TypeInstType * >( type ) ) { 101 101 return type; 102 } else if ( ArrayType * arrayType = dynamic_cast< ArrayType * >( type ) ) { 103 return isPolyType( arrayType->base, env ); 102 104 } else if ( StructInstType *structType = dynamic_cast< StructInstType* >( type ) ) { 103 105 if ( hasPolyParams( structType->get_parameters(), env ) ) return type; … … 115 117 return type; 116 118 } 119 } else if ( ArrayType * arrayType = dynamic_cast< ArrayType * >( type ) ) { 120 return isPolyType( arrayType->base, tyVars, env ); 117 121 } else if ( StructInstType *structType = dynamic_cast< StructInstType* >( type ) ) { 118 122 if ( hasPolyParams( structType->get_parameters(), tyVars, env ) ) return type; … … 367 371 return is<VoidType>( ap->get_base() ) || is<VoidType>( bp->get_base() ) 368 372 || typesPolyCompatible( ap->get_base(), bp->get_base() ); 373 } else if ( aid == type_index{typeid(ReferenceType)} ) { 374 ReferenceType *ap = as<ReferenceType>(a), *bp = as<ReferenceType>(b); 375 return is<VoidType>( ap->get_base() ) || is<VoidType>( bp->get_base() ) 376 || typesPolyCompatible( ap->get_base(), bp->get_base() ); 369 377 } else if ( aid == type_index{typeid(ArrayType)} ) { 370 378 ArrayType *aa = as<ArrayType>(a), *ba = as<ArrayType>(b); -
src/GenPoly/InstantiateGeneric.cc
rf9feab8 r90152a4 24 24 #include "Common/PassVisitor.h" // for PassVisitor, WithDeclsToAdd 25 25 #include "Common/ScopedMap.h" // for ScopedMap 26 #include "Common/SemanticError.h" // for SemanticError27 26 #include "Common/UniqueName.h" // for UniqueName 28 27 #include "Common/utility.h" // for deleteAll, cloneAll … … 476 475 DeclarationWithType * field = strict_dynamic_cast< DeclarationWithType * >( member ); 477 476 MemberExpr * ret = new MemberExpr( field, memberExpr->aggregate->clone() ); 477 ResolvExpr::adjustExprType( ret->result ); // pointer decay 478 478 std::swap( ret->env, memberExpr->env ); 479 479 delete memberExpr; … … 496 496 Expression * FixDtypeStatic::fixMemberExpr( AggrInst * inst, MemberExpr * memberExpr ) { 497 497 // need to cast dtype-static member expressions to their actual type before that type is erased. 498 // NOTE: the casts here have the third argument (isGenerated) set to false so that these casts persist until Box, where they are needed. 498 499 auto & baseParams = *inst->get_baseParameters(); 499 500 if ( isDtypeStatic( baseParams ) ) { … … 515 516 // Note: this currently creates more temporaries than is strictly necessary, since it does not check for duplicate uses of the same member expression. 516 517 static UniqueName tmpNamer( "_dtype_static_member_" ); 517 Expression * init = new CastExpr( new AddressExpr( memberExpr ), new PointerType( Type::Qualifiers(), concType->clone() ) );518 Expression * init = new CastExpr( new AddressExpr( memberExpr ), new PointerType( Type::Qualifiers(), concType->clone() ), false ); 518 519 ObjectDecl * tmp = ObjectDecl::newObject( tmpNamer.newName(), new ReferenceType( Type::Qualifiers(), concType ), new SingleInit( init ) ); 519 520 stmtsToAddBefore.push_back( new DeclStmt( tmp ) ); … … 521 522 } else { 522 523 // can simply add a cast to actual type 523 return new CastExpr( memberExpr, concType );524 return new CastExpr( memberExpr, concType, false ); 524 525 } 525 526 } -
src/GenPoly/Lvalue.cc
rf9feab8 r90152a4 18 18 19 19 #include "Common/PassVisitor.h" 20 #include "Common/SemanticError.h" // for SemanticError21 20 #include "GenPoly.h" // for isPolyType 22 21 #include "Lvalue.h" … … 46 45 Expression * mkDeref( Expression * arg ) { 47 46 if ( SymTab::dereferenceOperator ) { 47 // note: reference depth can be arbitrarily deep here, so peel off the outermost pointer/reference, not just pointer because they are effecitvely equivalent in this pass 48 48 VariableExpr * deref = new VariableExpr( SymTab::dereferenceOperator ); 49 deref-> set_result( new PointerType( Type::Qualifiers(), deref->get_result() ));50 Type * base = InitTweak::getPointerBase( arg-> get_result());51 assertf( base, "expected pointer type in dereference (type was %s)", toString( arg-> get_result()).c_str() );49 deref->result = new PointerType( Type::Qualifiers(), deref->result ); 50 Type * base = InitTweak::getPointerBase( arg->result ); 51 assertf( base, "expected pointer type in dereference (type was %s)", toString( arg->result ).c_str() ); 52 52 ApplicationExpr * ret = new ApplicationExpr( deref, { arg } ); 53 delete ret-> get_result();54 ret-> set_result( base->clone());55 ret-> get_result()->set_lvalue( true );53 delete ret->result; 54 ret->result = base->clone(); 55 ret->result->set_lvalue( true ); 56 56 return ret; 57 57 } else { … … 60 60 } 61 61 62 struct ReferenceConversions final {62 struct ReferenceConversions final : public WithStmtsToAdd { 63 63 Expression * postmutate( CastExpr * castExpr ); 64 64 Expression * postmutate( AddressExpr * addrExpr ); … … 98 98 }; 99 99 100 struct AddrRef final : public WithGuards {100 struct AddrRef final : public WithGuards, public WithVisitorRef<AddrRef>, public WithShortCircuiting { 101 101 void premutate( AddressExpr * addrExpr ); 102 102 Expression * postmutate( AddressExpr * addrExpr ); 103 103 void premutate( Expression * expr ); 104 void premutate( ApplicationExpr * appExpr ); 105 void premutate( SingleInit * init ); 106 107 void handleNonAddr( Expression * ); 104 108 105 109 bool first = true; 106 110 bool current = false; 107 111 int refDepth = 0; 112 bool addCast = false; 108 113 }; 109 114 } // namespace … … 115 120 } 116 121 117 void convertLvalue( std::list< Declaration* > & translationUnit ) {122 void convertLvalue( std::list< Declaration* > & translationUnit ) { 118 123 PassVisitor<ReferenceConversions> refCvt; 119 124 PassVisitor<ReferenceTypeElimination> elim; … … 141 146 142 147 namespace { 143 // true for intrinsic function calls that return a reference148 // true for intrinsic function calls that return an lvalue in C 144 149 bool isIntrinsicReference( Expression * expr ) { 150 // known intrinsic-reference prelude functions 151 static std::set<std::string> lvalueFunctions = { "*?", "?[?]" }; 145 152 if ( UntypedExpr * untyped = dynamic_cast< UntypedExpr * >( expr ) ) { 146 153 std::string fname = InitTweak::getFunctionName( untyped ); 147 // known intrinsic-reference prelude functions 148 return fname == "*?" || fname == "?[?]"; 154 return lvalueFunctions.count(fname); 149 155 } else if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * > ( expr ) ) { 150 156 if ( DeclarationWithType * func = InitTweak::getFunction( appExpr ) ) { 151 // use type of return variable rather than expr result type, since it may have been changed to a pointer type 152 FunctionType * ftype = GenPoly::getFunctionType( func->get_type() ); 153 Type * ret = ftype->get_returnVals().empty() ? nullptr : ftype->get_returnVals().front()->get_type(); 154 return func->get_linkage() == LinkageSpec::Intrinsic && dynamic_cast<ReferenceType *>( ret ); 157 return func->linkage == LinkageSpec::Intrinsic && lvalueFunctions.count(func->name); 155 158 } 156 159 } … … 161 164 if ( isIntrinsicReference( appExpr ) ) { 162 165 // eliminate reference types from intrinsic applications - now they return lvalues 163 Type * result = appExpr->get_result();164 appExpr-> set_result( result->stripReferences()->clone());165 appExpr-> get_result()->set_lvalue( true );166 ReferenceType * result = strict_dynamic_cast< ReferenceType * >( appExpr->result ); 167 appExpr->result = result->base->clone(); 168 appExpr->result->set_lvalue( true ); 166 169 if ( ! inIntrinsic ) { 167 170 // when not in an intrinsic function, add a cast to 168 171 // don't add cast when in an intrinsic function, since they already have the cast 169 172 Expression * ret = new CastExpr( appExpr, result ); 170 ret->set_env( appExpr->get_env() ); 171 appExpr->set_env( nullptr ); 173 std::swap( ret->env, appExpr->env ); 172 174 return ret; 173 175 } … … 179 181 void FixIntrinsicResult::premutate( FunctionDecl * funcDecl ) { 180 182 GuardValue( inIntrinsic ); 181 inIntrinsic = 183 inIntrinsic = funcDecl->linkage == LinkageSpec::Intrinsic; 182 184 } 183 185 … … 188 190 assertf( ftype, "Function declaration does not have function type." ); 189 191 // can be of differing lengths only when function is variadic 190 assertf( ftype-> get_parameters().size() == appExpr->get_args().size() || ftype->get_isVarArgs(), "ApplicationExpr args do not match formal parameter type." );192 assertf( ftype->parameters.size() == appExpr->args.size() || ftype->isVarArgs, "ApplicationExpr args do not match formal parameter type." ); 191 193 192 194 193 195 unsigned int i = 0; 194 const unsigned int end = ftype-> get_parameters().size();195 for ( auto p : unsafe_group_iterate( appExpr-> get_args(), ftype->get_parameters()) ) {196 const unsigned int end = ftype->parameters.size(); 197 for ( auto p : unsafe_group_iterate( appExpr->args, ftype->parameters ) ) { 196 198 if (i == end) break; 197 199 Expression *& arg = std::get<0>( p ); … … 199 201 PRINT( 200 202 std::cerr << "pair<0>: " << arg << std::endl; 203 std::cerr << " -- " << arg->result << std::endl; 201 204 std::cerr << "pair<1>: " << formal << std::endl; 202 205 ) 203 206 if ( dynamic_cast<ReferenceType*>( formal ) ) { 204 if ( isIntrinsicReference( arg ) ) { // do not combine conditions, because that changes the meaning of the else if 205 if ( function->get_linkage() != LinkageSpec::Intrinsic ) { // intrinsic functions that turn pointers into references 206 // if argument is dereference or array subscript, the result isn't REALLY a reference, so it's not necessary to fix the argument 207 PRINT( 208 std::cerr << "===is intrinsic arg in non-intrinsic call - adding address" << std::endl; 209 ) 210 arg = new AddressExpr( arg ); 211 } 212 } else if ( function->get_linkage() == LinkageSpec::Intrinsic ) { 213 // std::cerr << "===adding deref to arg" << std::endl; 214 // if the parameter is a reference, add a dereference to the reference-typed argument. 215 Type * baseType = InitTweak::getPointerBase( arg->get_result() ); 216 assertf( baseType, "parameter is reference, arg must be pointer or reference: %s", toString( arg->get_result() ).c_str() ); 207 PRINT( 208 std::cerr << "===formal is reference" << std::endl; 209 ) 210 // TODO: it's likely that the second condition should be ... && ! isIntrinsicReference( arg ), but this requires investigation. 211 212 if ( function->linkage != LinkageSpec::Intrinsic && isIntrinsicReference( arg ) ) { 213 // needed for definition of prelude functions, etc. 214 // if argument is dereference or array subscript, the result isn't REALLY a reference, but non-intrinsic functions expect a reference: take address 215 216 // NOTE: previously, this condition fixed 217 // void f(int *&); 218 // int & x = ...; 219 // f(&x); 220 // But now this is taken care of by a reference cast added by AddrRef. Need to find a new 221 // example or remove this branch. 222 223 PRINT( 224 std::cerr << "===is intrinsic arg in non-intrinsic call - adding address" << std::endl; 225 ) 226 arg = new AddressExpr( arg ); 227 // } else if ( function->get_linkage() == LinkageSpec::Intrinsic && InitTweak::getPointerBase( arg->result ) ) { 228 } else if ( function->linkage == LinkageSpec::Intrinsic && arg->result->referenceDepth() != 0 ) { 229 // argument is a 'real' reference, but function expects a C lvalue: add a dereference to the reference-typed argument 230 PRINT( 231 std::cerr << "===is non-intrinsic arg in intrinsic call - adding deref to arg" << std::endl; 232 ) 233 Type * baseType = InitTweak::getPointerBase( arg->result ); 234 assertf( baseType, "parameter is reference, arg must be pointer or reference: %s", toString( arg->result ).c_str() ); 217 235 PointerType * ptrType = new PointerType( Type::Qualifiers(), baseType->clone() ); 218 delete arg-> get_result();219 arg-> set_result( ptrType );236 delete arg->result; 237 arg->result = ptrType; 220 238 arg = mkDeref( arg ); 239 // assertf( arg->result->referenceDepth() == 0, "Reference types should have been eliminated from intrinsic function calls, but weren't: %s", toCString( arg->result ) ); 221 240 } 222 241 } … … 228 247 229 248 // idea: &&&E: get outer &, inner & 230 // at inner &, record depth D of reference type 249 // at inner &, record depth D of reference type of argument of & 231 250 // at outer &, add D derefs. 232 void AddrRef::premutate( Expression * ) { 251 void AddrRef::handleNonAddr( Expression * ) { 252 // non-address-of: reset status variables: 253 // * current expr is NOT the first address-of expr in an address-of chain 254 // * next seen address-of expr IS the first in the chain. 233 255 GuardValue( current ); 234 256 GuardValue( first ); … … 237 259 } 238 260 261 void AddrRef::premutate( Expression * expr ) { 262 handleNonAddr( expr ); 263 GuardValue( addCast ); 264 addCast = false; 265 } 266 239 267 void AddrRef::premutate( AddressExpr * ) { 240 268 GuardValue( current ); 241 269 GuardValue( first ); 242 current = first; 243 first = false; 244 if ( current ) { 270 current = first; // is this the first address-of in the chain? 271 first = false; // from here out, no longer possible for next address-of to be first in chain 272 if ( current ) { // this is the outermost address-of in a chain 245 273 GuardValue( refDepth ); 246 refDepth = 0; 274 refDepth = 0; // set depth to 0 so that postmutate can find the innermost address-of easily 247 275 } 248 276 } 249 277 250 278 Expression * AddrRef::postmutate( AddressExpr * addrExpr ) { 279 PRINT( std::cerr << "addr ref at " << addrExpr << std::endl; ) 251 280 if ( refDepth == 0 ) { 252 if ( ! isIntrinsicReference( addrExpr->get_arg() ) ) { 281 PRINT( std::cerr << "depth 0, get new depth..." << std::endl; ) 282 // this is the innermost address-of in a chain, record depth D 283 if ( ! isIntrinsicReference( addrExpr->arg ) ) { 253 284 // try to avoid ?[?] 254 refDepth = addrExpr->get_arg()->get_result()->referenceDepth(); 255 } 256 } 257 if ( current ) { 285 // xxx - is this condition still necessary? intrinsicReferences should have a cast around them at this point, so I don't think this condition ever fires. 286 refDepth = addrExpr->arg->result->referenceDepth(); 287 PRINT( std::cerr << "arg not intrinsic reference, new depth is: " << refDepth << std::endl; ) 288 } else { 289 assertf( false, "AddrRef : address-of should not have intrinsic reference argument: %s", toCString( addrExpr->arg ) ); 290 } 291 } 292 if ( current ) { // this is the outermost address-of in a chain 293 PRINT( std::cerr << "current, depth is: " << refDepth << std::endl; ) 258 294 Expression * ret = addrExpr; 259 295 while ( refDepth ) { 296 // add one dereference for each 260 297 ret = mkDeref( ret ); 261 298 refDepth--; 262 299 } 300 301 // if addrExpr depth is 0, then the result is a pointer because the arg was depth 1 and not lvalue. 302 // This means the dereference result is not a reference, is lvalue, and one less pointer depth than 303 // the addrExpr. Thus the cast is meaningless. 304 // TODO: One thing to double check is whether it is possible for the types to differ outside of the single 305 // pointer level (i.e. can the base type of addrExpr differ from the type of addrExpr-arg?). 306 // If so then the cast might need to be added, conditional on a more sophisticated check. 307 if ( addCast && addrExpr->result->referenceDepth() != 0 ) { 308 PRINT( std::cerr << "adding cast to " << addrExpr->result << std::endl; ) 309 return new CastExpr( ret, addrExpr->result->clone() ); 310 } 263 311 return ret; 264 312 } 313 PRINT( std::cerr << "not current..." << std::endl; ) 265 314 return addrExpr; 266 315 } 316 317 void AddrRef::premutate( ApplicationExpr * appExpr ) { 318 visit_children = false; 319 GuardValue( addCast ); 320 handleNonAddr( appExpr ); 321 for ( Expression *& arg : appExpr->args ) { 322 // each argument with address-of requires a cast 323 addCast = true; 324 arg = arg->acceptMutator( *visitor ); 325 } 326 } 327 328 void AddrRef::premutate( SingleInit * ) { 329 GuardValue( addCast ); 330 // each initialization context with address-of requires a cast 331 addCast = true; 332 } 333 267 334 268 335 Expression * ReferenceConversions::postmutate( AddressExpr * addrExpr ) { … … 281 348 // pointer casts in the right places. 282 349 283 // conversion to reference type 284 if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( castExpr->get_result() ) ) { 285 (void)refType; 286 if ( ReferenceType * otherRef = dynamic_cast< ReferenceType * >( castExpr->get_arg()->get_result() ) ) { 287 // nothing to do if casting from reference to reference. 288 (void)otherRef; 289 PRINT( std::cerr << "convert reference to reference -- nop" << std::endl; ) 290 if ( isIntrinsicReference( castExpr->get_arg() ) ) { 291 Expression * callExpr = castExpr->get_arg(); 292 PRINT( 293 std::cerr << "but arg is deref -- &" << std::endl; 294 std::cerr << callExpr << std::endl; 295 ) 296 callExpr = new AddressExpr( callExpr ); // this doesn't work properly for multiple casts 297 delete callExpr->get_result(); 298 callExpr->set_result( refType->clone() ); 299 // move environment out to new top-level 300 callExpr->set_env( castExpr->get_env() ); 301 castExpr->set_arg( nullptr ); 302 castExpr->set_env( nullptr ); 303 delete castExpr; 304 return callExpr; 305 } 306 int depth1 = refType->referenceDepth(); 307 int depth2 = otherRef->referenceDepth(); 308 int diff = depth1-depth2; 309 if ( diff == 0 ) { 310 assertf( depth1 == depth2, "non-intrinsic reference with cast of reference to reference not yet supported: %d %d %s", depth1, depth2, toString( castExpr ).c_str() ); 311 PRINT( std::cerr << castExpr << std::endl; ) 312 return castExpr; 313 } else if ( diff < 0 ) { 314 Expression * ret = castExpr->get_arg(); 315 for ( int i = 0; i < diff; ++i ) { 316 ret = mkDeref( ret ); 317 } 318 ret->set_env( castExpr->get_env() ); 319 delete ret->get_result(); 320 ret->set_result( castExpr->get_result() ); 321 castExpr->set_env( nullptr ); 322 castExpr->set_arg( nullptr ); 323 castExpr->set_result( nullptr ); 324 delete castExpr; 325 return ret; 326 } else if ( diff > 0 ) { 327 Expression * ret = castExpr->get_arg(); 328 for ( int i = 0; i < diff; ++i ) { 329 ret = new AddressExpr( ret ); 330 } 331 ret->set_env( castExpr->get_env() ); 332 delete ret->get_result(); 333 ret->set_result( castExpr->get_result() ); 334 castExpr->set_env( nullptr ); 335 castExpr->set_arg( nullptr ); 336 castExpr->set_result( nullptr ); 337 delete castExpr; 338 return ret; 339 } 340 341 assertf( depth1 == depth2, "non-intrinsic reference with cast of reference to reference not yet supported: %d %d %s", depth1, depth2, toString( castExpr ).c_str() ); 342 PRINT( std::cerr << castExpr << std::endl; ) 350 // Note: reference depth difference is the determining factor in what code is run, rather than whether something is 351 // reference type or not, since conversion still needs to occur when both types are references that differ in depth. 352 353 Type * destType = castExpr->result; 354 Type * srcType = castExpr->arg->result; 355 int depth1 = destType->referenceDepth(); 356 int depth2 = srcType->referenceDepth(); 357 int diff = depth1 - depth2; 358 359 if ( diff > 0 && ! srcType->get_lvalue() ) { 360 // rvalue to reference conversion -- introduce temporary 361 // know that reference depth of cast argument is 0, need to introduce n temporaries for reference depth of n, e.g. 362 // (int &&&)3; 363 // becomes 364 // int __ref_tmp_0 = 3; 365 // int & __ref_tmp_1 = _&_ref_tmp_0; 366 // int && __ref_tmp_2 = &__ref_tmp_1; 367 // &__ref_tmp_2; 368 // the last & comes from the remaining reference conversion code 369 SemanticWarning( castExpr->arg->location, Warning::RvalueToReferenceConversion, toCString( castExpr->arg ) ); 370 371 static UniqueName tempNamer( "__ref_tmp_" ); 372 ObjectDecl * temp = ObjectDecl::newObject( tempNamer.newName(), castExpr->arg->result->clone(), new SingleInit( castExpr->arg ) ); 373 PRINT( std::cerr << "made temp: " << temp << std::endl; ) 374 stmtsToAddBefore.push_back( new DeclStmt( temp ) ); 375 for ( int i = 0; i < depth1-1; i++ ) { // xxx - maybe this should be diff-1? check how this works with reference type for srcType 376 ObjectDecl * newTemp = ObjectDecl::newObject( tempNamer.newName(), new ReferenceType( Type::Qualifiers(), temp->type->clone() ), new SingleInit( new AddressExpr( new VariableExpr( temp ) ) ) ); 377 PRINT( std::cerr << "made temp" << i << ": " << newTemp << std::endl; ) 378 stmtsToAddBefore.push_back( new DeclStmt( newTemp ) ); 379 temp = newTemp; 380 } 381 // update diff so that remaining code works out correctly 382 castExpr->arg = new VariableExpr( temp ); 383 PRINT( std::cerr << "update cast to: " << castExpr << std::endl; ) 384 srcType = castExpr->arg->result; 385 depth2 = srcType->referenceDepth(); 386 diff = depth1 - depth2; 387 assert( diff == 1 ); 388 } 389 390 // handle conversion between different depths 391 PRINT ( 392 if ( depth1 || depth2 ) { 393 std::cerr << "destType: " << destType << " / srcType: " << srcType << std::endl; 394 std::cerr << "depth: " << depth1 << " / " << depth2 << std::endl; 395 } 396 ) 397 if ( diff > 0 ) { 398 // conversion to type with more depth (e.g. int & -> int &&): add address-of for each level of difference 399 Expression * ret = castExpr->arg; 400 for ( int i = 0; i < diff; ++i ) { 401 ret = new AddressExpr( ret ); 402 } 403 if ( srcType->get_lvalue() && ! ResolvExpr::typesCompatible( srcType, strict_dynamic_cast<ReferenceType *>( destType )->base, SymTab::Indexer() ) ) { 404 // must keep cast if cast-to type is different from the actual type 405 castExpr->arg = ret; 343 406 return castExpr; 344 } else if ( castExpr->get_arg()->get_result()->get_lvalue() ) { 345 // conversion from lvalue to reference 346 // xxx - keep cast, but turn into pointer cast?? 347 // xxx - memory 407 } 408 ret->env = castExpr->env; 409 delete ret->result; 410 ret->result = castExpr->result; 411 castExpr->env = nullptr; 412 castExpr->arg = nullptr; 413 castExpr->result = nullptr; 414 delete castExpr; 415 return ret; 416 } else if ( diff < 0 ) { 417 // conversion to type with less depth (e.g. int && -> int &): add dereferences for each level of difference 418 diff = -diff; // care only about magnitude now 419 Expression * ret = castExpr->arg; 420 for ( int i = 0; i < diff; ++i ) { 421 ret = mkDeref( ret ); 422 // xxx - try removing one reference here? actually, looks like mkDeref already does this, so more closely look at the types generated. 423 } 424 if ( ! ResolvExpr::typesCompatibleIgnoreQualifiers( destType->stripReferences(), srcType->stripReferences(), SymTab::Indexer() ) ) { 425 // must keep cast if types are different 426 castExpr->arg = ret; 427 return castExpr; 428 } 429 ret->env = castExpr->env; 430 delete ret->result; 431 ret->result = castExpr->result; 432 ret->result->set_lvalue( true ); // ensure result is lvalue 433 castExpr->env = nullptr; 434 castExpr->arg = nullptr; 435 castExpr->result = nullptr; 436 delete castExpr; 437 return ret; 438 } else { 439 assert( diff == 0 ); 440 // conversion between references of the same depth 441 if ( ResolvExpr::typesCompatible( castExpr->result, castExpr->arg->result, SymTab::Indexer() ) && castExpr->isGenerated ) { 442 // Remove useless generated casts 348 443 PRINT( 349 std::cerr << "convert lvalue to reference -- &" << std::endl; 350 std::cerr << castExpr->get_arg() << std::endl; 444 std::cerr << "types are compatible, removing cast: " << castExpr << std::endl; 445 std::cerr << "-- " << castExpr->result << std::endl; 446 std::cerr << "-- " << castExpr->arg->result << std::endl; 351 447 ) 352 AddressExpr * ret = new AddressExpr( castExpr->get_arg() ); 353 if ( refType->get_base()->get_qualifiers() != castExpr->get_arg()->get_result()->get_qualifiers() ) { 354 // must keep cast if cast-to type is different from the actual type 355 castExpr->set_arg( ret ); 356 return castExpr; 357 } 358 ret->set_env( castExpr->get_env() ); 359 delete ret->get_result(); 360 ret->set_result( castExpr->get_result() ); 361 castExpr->set_env( nullptr ); 362 castExpr->set_arg( nullptr ); 363 castExpr->set_result( nullptr ); 448 Expression * ret = castExpr->arg; 449 castExpr->arg = nullptr; 450 std::swap( castExpr->env, ret->env ); 364 451 delete castExpr; 365 452 return ret; 366 } else { 367 // rvalue to reference conversion -- introduce temporary 368 } 369 assertf( false, "Only conversions to reference from lvalue are currently supported: %s", toString( castExpr ).c_str() ); 370 } else if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( castExpr->get_arg()->get_result() ) ) { 371 (void)refType; 372 // conversion from reference to rvalue 373 PRINT( 374 std::cerr << "convert reference to rvalue -- *" << std::endl; 375 std::cerr << "was = " << castExpr << std::endl; 376 ) 377 Expression * ret = castExpr->get_arg(); 378 TypeSubstitution * env = castExpr->get_env(); 379 castExpr->set_env( nullptr ); 380 if ( ! isIntrinsicReference( ret ) ) { 381 // dereference if not already dereferenced 382 ret = mkDeref( ret ); 383 } 384 if ( ResolvExpr::typesCompatibleIgnoreQualifiers( castExpr->get_result(), castExpr->get_arg()->get_result()->stripReferences(), SymTab::Indexer() ) ) { 385 // can remove cast if types are compatible, changing expression type to value type 386 ret->set_result( castExpr->get_result()->clone() ); 387 castExpr->set_arg( nullptr ); 388 delete castExpr; 389 } else { 390 // must keep cast if types are different 391 castExpr->set_arg( ret ); 392 ret = castExpr; 393 } 394 ret->set_env( env ); 395 PRINT( std::cerr << "now: " << ret << std::endl; ) 396 return ret; 397 } 398 return castExpr; 453 } 454 return castExpr; 455 } 399 456 } 400 457 401 458 Type * ReferenceTypeElimination::postmutate( ReferenceType * refType ) { 402 Type * base = refType-> get_base();459 Type * base = refType->base; 403 460 Type::Qualifiers qualifiers = refType->get_qualifiers(); 404 refType-> set_base( nullptr );461 refType->base = nullptr; 405 462 delete refType; 406 463 return new PointerType( qualifiers, base ); … … 410 467 Expression * GeneralizedLvalue::applyTransformation( Expression * expr, Expression * arg, Func mkExpr ) { 411 468 if ( CommaExpr * commaExpr = dynamic_cast< CommaExpr * >( arg ) ) { 412 Expression * arg1 = commaExpr-> get_arg1()->clone();413 Expression * arg2 = commaExpr-> get_arg2()->clone();469 Expression * arg1 = commaExpr->arg1->clone(); 470 Expression * arg2 = commaExpr->arg2->clone(); 414 471 Expression * ret = new CommaExpr( arg1, mkExpr( arg2 )->acceptMutator( *visitor ) ); 415 ret-> set_env( expr->get_env() );416 expr-> set_env( nullptr );472 ret->env = expr->env; 473 expr->env = nullptr; 417 474 delete expr; 418 475 return ret; 419 476 } else if ( ConditionalExpr * condExpr = dynamic_cast< ConditionalExpr * >( arg ) ) { 420 Expression * arg1 = condExpr-> get_arg1()->clone();421 Expression * arg2 = condExpr-> get_arg2()->clone();422 Expression * arg3 = condExpr-> get_arg3()->clone();477 Expression * arg1 = condExpr->arg1->clone(); 478 Expression * arg2 = condExpr->arg2->clone(); 479 Expression * arg3 = condExpr->arg3->clone(); 423 480 ConditionalExpr * ret = new ConditionalExpr( arg1, mkExpr( arg2 )->acceptMutator( *visitor ), mkExpr( arg3 )->acceptMutator( *visitor ) ); 424 ret-> set_env( expr->get_env() );425 expr-> set_env( nullptr );481 ret->env = expr->env; 482 expr->env = nullptr; 426 483 delete expr; 427 484 … … 432 489 AssertionSet needAssertions, haveAssertions; 433 490 OpenVarSet openVars; 434 unify( ret-> get_arg2()->get_result(), ret->get_arg3()->get_result(), newEnv, needAssertions, haveAssertions, openVars, SymTab::Indexer(), commonType );435 ret-> set_result( commonType ? commonType : ret->get_arg2()->get_result()->clone());491 unify( ret->arg2->result, ret->arg3->result, newEnv, needAssertions, haveAssertions, openVars, SymTab::Indexer(), commonType ); 492 ret->result = commonType ? commonType : ret->arg2->result->clone(); 436 493 return ret; 437 494 } … … 440 497 441 498 Expression * GeneralizedLvalue::postmutate( MemberExpr * memExpr ) { 442 return applyTransformation( memExpr, memExpr-> get_aggregate(), [=]( Expression * aggr ) { return new MemberExpr( memExpr->get_member(), aggr ); } );499 return applyTransformation( memExpr, memExpr->aggregate, [=]( Expression * aggr ) { return new MemberExpr( memExpr->member, aggr ); } ); 443 500 } 444 501 445 502 Expression * GeneralizedLvalue::postmutate( AddressExpr * addrExpr ) { 446 return applyTransformation( addrExpr, addrExpr-> get_arg(), []( Expression * arg ) { return new AddressExpr( arg ); } );503 return applyTransformation( addrExpr, addrExpr->arg, []( Expression * arg ) { return new AddressExpr( arg ); } ); 447 504 } 448 505 449 506 Expression * CollapseAddrDeref::postmutate( AddressExpr * addrExpr ) { 450 Expression * arg = addrExpr-> get_arg();507 Expression * arg = addrExpr->arg; 451 508 if ( isIntrinsicReference( arg ) ) { 452 509 std::string fname = InitTweak::getFunctionName( arg ); … … 454 511 Expression *& arg0 = InitTweak::getCallArg( arg, 0 ); 455 512 Expression * ret = arg0; 456 ret->set_env( addrExpr-> get_env());513 ret->set_env( addrExpr->env ); 457 514 arg0 = nullptr; 458 addrExpr-> set_env( nullptr );515 addrExpr->env = nullptr; 459 516 delete addrExpr; 460 517 return ret; 518 } 519 } else if ( CastExpr * castExpr = dynamic_cast< CastExpr * > ( arg ) ) { 520 // need to move cast to pointer type out a level since address of pointer 521 // is not valid C code (can be introduced in prior passes, e.g., InstantiateGeneric) 522 if ( InitTweak::getPointerBase( castExpr->result ) ) { 523 addrExpr->arg = castExpr->arg; 524 castExpr->arg = addrExpr; 525 castExpr->result = new PointerType( Type::Qualifiers(), castExpr->result ); 526 return castExpr; 461 527 } 462 528 } … … 474 540 // } 475 541 if ( AddressExpr * addrExpr = dynamic_cast< AddressExpr * >( arg ) ) { 476 Expression * ret = addrExpr-> get_arg();477 ret-> set_env( appExpr->get_env() );478 addrExpr-> set_arg( nullptr );479 appExpr-> set_env( nullptr );542 Expression * ret = addrExpr->arg; 543 ret->env = appExpr->env; 544 addrExpr->arg = nullptr; 545 appExpr->env = nullptr; 480 546 delete appExpr; 481 547 return ret; -
src/GenPoly/ScrubTyVars.cc
rf9feab8 r90152a4 25 25 26 26 namespace GenPoly { 27 Type * ScrubTyVars:: mutate( TypeInstType *typeInst ) {27 Type * ScrubTyVars::postmutate( TypeInstType * typeInst ) { 28 28 if ( ! tyVars ) { 29 29 if ( typeInst->get_isFtype() ) { … … 31 31 return new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) ); 32 32 } else { 33 PointerType * ret = new PointerType( Type::Qualifiers(), new VoidType( typeInst->get_qualifiers() ) );33 PointerType * ret = new PointerType( Type::Qualifiers(), new VoidType( typeInst->get_qualifiers() ) ); 34 34 delete typeInst; 35 35 return ret; … … 37 37 } 38 38 39 TyVarMap::const_iterator tyVar = tyVars->find( typeInst-> get_name());39 TyVarMap::const_iterator tyVar = tyVars->find( typeInst->name ); 40 40 if ( tyVar != tyVars->end() ) { 41 41 switch ( tyVar->second.kind ) { … … 43 43 case TypeDecl::Ttype: 44 44 { 45 PointerType * ret = new PointerType( Type::Qualifiers(), new VoidType( typeInst->get_qualifiers() ) );45 PointerType * ret = new PointerType( Type::Qualifiers(), new VoidType( typeInst->get_qualifiers() ) ); 46 46 delete typeInst; 47 47 return ret; … … 50 50 delete typeInst; 51 51 return new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) ); 52 default: 53 assertf(false, "Unhandled tyvar kind: %d", tyVar->second.kind); 52 54 } // switch 53 55 } // if … … 55 57 } 56 58 57 Type * ScrubTyVars::mutateAggregateType( Type * ty ) {59 Type * ScrubTyVars::mutateAggregateType( Type * ty ) { 58 60 if ( shouldScrub( ty ) ) { 59 PointerType * ret = new PointerType( Type::Qualifiers(), new VoidType( ty->get_qualifiers() ) );61 PointerType * ret = new PointerType( Type::Qualifiers(), new VoidType( ty->get_qualifiers() ) ); 60 62 delete ty; 61 63 return ret; … … 64 66 } 65 67 66 Type * ScrubTyVars:: mutate( StructInstType *structInst ) {68 Type * ScrubTyVars::postmutate( StructInstType * structInst ) { 67 69 return mutateAggregateType( structInst ); 68 70 } 69 71 70 Type * ScrubTyVars:: mutate( UnionInstType *unionInst ) {72 Type * ScrubTyVars::postmutate( UnionInstType * unionInst ) { 71 73 return mutateAggregateType( unionInst ); 72 74 } 73 75 74 Expression * ScrubTyVars::mutate( SizeofExpr *szeof ) { 76 void ScrubTyVars::primeBaseScrub( Type * type ) { 77 // need to determine whether type needs to be scrubbed to determine whether 78 // automatic recursion is necessary 79 if ( Type * t = shouldScrub( type ) ) { 80 visit_children = false; 81 GuardValue( dynType ); 82 dynType = t; 83 } 84 } 85 86 Expression * ScrubTyVars::postmutate( SizeofExpr * szeof ) { 75 87 // sizeof( T ) => _sizeof_T parameter, which is the size of T 76 if ( Type *dynType = shouldScrub( szeof->get_type() )) {88 if ( dynType ) { 77 89 Expression *expr = new NameExpr( sizeofName( mangleType( dynType ) ) ); 78 90 return expr; 79 } else {80 return Mutator::mutate( szeof );81 91 } // if 92 return szeof; 82 93 } 83 94 84 Expression * ScrubTyVars:: mutate( AlignofExpr *algnof ) {95 Expression * ScrubTyVars::postmutate( AlignofExpr * algnof ) { 85 96 // alignof( T ) => _alignof_T parameter, which is the alignment of T 86 if ( Type *dynType = shouldScrub( algnof->get_type() )) {97 if ( dynType ) { 87 98 Expression *expr = new NameExpr( alignofName( mangleType( dynType ) ) ); 88 99 return expr; 89 } else {90 return Mutator::mutate( algnof );91 100 } // if 101 return algnof; 92 102 } 93 103 94 Type * ScrubTyVars::mutate( PointerType *pointer ) { 95 // // special case of shouldScrub that takes all TypeInstType pointer bases, even if they're not dynamic 96 // Type *base = pointer->get_base(); 97 // Type *dynType = 0; 98 // if ( dynamicOnly ) { 99 // if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( base ) ) { 100 // if ( tyVars.find( typeInst->get_name() ) != tyVars.end() ) { dynType = typeInst; } 101 // } else { 102 // dynType = isDynType( base, tyVars ); 103 // } 104 // } else { 105 // dynType = isPolyType( base, tyVars ); 106 // } 107 // if ( dynType ) { 108 if ( Type *dynType = shouldScrub( pointer->get_base() ) ) { 109 Type *ret = dynType->acceptMutator( *this ); 104 Type * ScrubTyVars::postmutate( PointerType * pointer ) { 105 if ( dynType ) { 106 Type * ret = dynType->acceptMutator( *visitor ); 110 107 ret->get_qualifiers() |= pointer->get_qualifiers(); 111 pointer-> set_base( 0 );108 pointer->base = nullptr; 112 109 delete pointer; 113 110 return ret; 114 111 } 115 return Mutator::mutate( pointer );112 return pointer; 116 113 } 117 114 } // namespace GenPoly -
src/GenPoly/ScrubTyVars.h
rf9feab8 r90152a4 18 18 #include <cassert> // for assert 19 19 20 #include "Common/PassVisitor.h" 20 21 #include "GenPoly.h" // for TyVarMap, isPolyType, isDynType 21 22 #include "SynTree/Mutator.h" // for Mutator … … 27 28 28 29 namespace GenPoly { 29 class ScrubTyVars : public Mutator{30 struct ScrubTyVars : public WithVisitorRef<ScrubTyVars>, public WithShortCircuiting, public WithGuards { 30 31 /// Whether to scrub all type variables from the provided map, dynamic type variables from the provided map, or all type variables 31 32 enum ScrubMode { FromMap, DynamicFromMap, All }; … … 51 52 static SynTreeClass *scrubAll( SynTreeClass *target ); 52 53 53 virtual Type* mutate( TypeInstType *typeInst ); 54 virtual Type* mutate( StructInstType *structInst ); 55 virtual Type* mutate( UnionInstType *unionInst ); 56 virtual Expression* mutate( SizeofExpr *szeof ); 57 virtual Expression* mutate( AlignofExpr *algnof ); 58 virtual Type* mutate( PointerType *pointer ); 54 /// determine if children should be visited based on whether base type should be scrubbed. 55 void primeBaseScrub( Type * ); 56 57 void premutate( TypeInstType * ) { visit_children = false; } 58 void premutate( StructInstType * ) { visit_children = false; } 59 void premutate( UnionInstType * ) { visit_children = false; } 60 void premutate( SizeofExpr * szeof ) { primeBaseScrub( szeof->type ); } 61 void premutate( AlignofExpr * algnof ) { primeBaseScrub( algnof->type ); } 62 void premutate( PointerType * pointer ) { primeBaseScrub( pointer->base ); } 63 64 Type * postmutate( TypeInstType * typeInst ); 65 Type * postmutate( StructInstType * structInst ); 66 Type * postmutate( UnionInstType * unionInst ); 67 Expression * postmutate( SizeofExpr * szeof ); 68 Expression * postmutate( AlignofExpr * algnof ); 69 Type * postmutate( PointerType * pointer ); 59 70 60 71 private: … … 75 86 const TyVarMap *tyVars; ///< Type variables to scrub 76 87 ScrubMode mode; ///< which type variables to scrub? [FromMap] 88 89 Type * dynType = nullptr; ///< result of shouldScrub 77 90 }; 78 91 79 92 template< typename SynTreeClass > 80 93 SynTreeClass * ScrubTyVars::scrub( SynTreeClass *target, const TyVarMap &tyVars ) { 81 ScrubTyVarsscrubber( tyVars );94 PassVisitor<ScrubTyVars> scrubber( tyVars ); 82 95 return static_cast< SynTreeClass * >( target->acceptMutator( scrubber ) ); 83 96 } … … 85 98 template< typename SynTreeClass > 86 99 SynTreeClass * ScrubTyVars::scrubDynamic( SynTreeClass *target, const TyVarMap &tyVars ) { 87 ScrubTyVarsscrubber( tyVars, ScrubTyVars::DynamicFromMap );100 PassVisitor<ScrubTyVars> scrubber( tyVars, ScrubTyVars::DynamicFromMap ); 88 101 return static_cast< SynTreeClass * >( target->acceptMutator( scrubber ) ); 89 102 } … … 91 104 template< typename SynTreeClass > 92 105 SynTreeClass * ScrubTyVars::scrubAll( SynTreeClass *target ) { 93 ScrubTyVarsscrubber;106 PassVisitor<ScrubTyVars> scrubber; 94 107 return static_cast< SynTreeClass * >( target->acceptMutator( scrubber ) ); 95 108 } -
src/GenPoly/Specialize.cc
rf9feab8 r90152a4 23 23 24 24 #include "Common/PassVisitor.h" 25 #include "Common/SemanticError.h" // for SemanticError26 25 #include "Common/UniqueName.h" // for UniqueName 27 26 #include "Common/utility.h" // for group_iterate … … 201 200 } 202 201 203 struct EnvTrimmer {204 TypeSubstitution * env, * newEnv;205 EnvTrimmer( TypeSubstitution * env, TypeSubstitution * newEnv ) : env( env ), newEnv( newEnv ){}206 void previsit( TypeDecl * tyDecl ) {207 // transfer known bindings for seen type variables208 if ( Type * t = env->lookup( tyDecl->name ) ) {209 newEnv->add( tyDecl->name, t );210 }211 }212 };213 214 /// reduce environment to just the parts that are referenced in a given expression215 TypeSubstitution * trimEnv( ApplicationExpr * expr, TypeSubstitution * env ) {216 if ( env ) {217 TypeSubstitution * newEnv = new TypeSubstitution();218 PassVisitor<EnvTrimmer> trimmer( env, newEnv );219 expr->accept( trimmer );220 return newEnv;221 }222 return nullptr;223 }224 225 202 /// Generates a thunk that calls `actual` with type `funType` and returns its address 226 203 Expression * Specialize::createThunkFunction( FunctionType *funType, Expression *actual, InferredParams *inferParams ) { … … 266 243 } 267 244 268 appExpr-> set_env( trimEnv( appExpr, env ));245 appExpr->env = TypeSubstitution::newFromExpr( appExpr, env ); 269 246 if ( inferParams ) { 270 247 appExpr->get_inferParams() = *inferParams; -
src/InitTweak/FixGlobalInit.cc
rf9feab8 r90152a4 21 21 22 22 #include "Common/PassVisitor.h" 23 #include "Common/SemanticError.h" // for SemanticError24 23 #include "Common/UniqueName.h" // for UniqueName 25 24 #include "InitTweak.h" // for isIntrinsicSingleArgCallStmt … … 38 37 class GlobalFixer : public WithShortCircuiting { 39 38 public: 40 GlobalFixer( const std::string & name,bool inLibrary );39 GlobalFixer( bool inLibrary ); 41 40 42 41 void previsit( ObjectDecl *objDecl ); … … 53 52 }; 54 53 55 void fixGlobalInit( std::list< Declaration * > & translationUnit, const std::string & name,bool inLibrary ) {56 PassVisitor<GlobalFixer> visitor( name,inLibrary );54 void fixGlobalInit( std::list< Declaration * > & translationUnit, bool inLibrary ) { 55 PassVisitor<GlobalFixer> visitor( inLibrary ); 57 56 acceptAll( translationUnit, visitor ); 58 57 GlobalFixer & fixer = visitor.pass; … … 71 70 } 72 71 73 std::string globalFunctionName( const std::string & name ) { 74 // get basename 75 std::string ret = name.substr( 0, name.find( '.' ) ); 76 // replace invalid characters with _ 77 static std::string invalid = "/-"; 78 replace_if( ret.begin(), ret.end(), []( char c ) { return invalid.find(c) != std::string::npos; }, '_' ); 79 return ret; 80 } 81 82 GlobalFixer::GlobalFixer( const std::string & name, bool inLibrary ) : tempNamer( "_global_init" ) { 83 std::string fixedName = globalFunctionName( name ); 72 GlobalFixer::GlobalFixer( bool inLibrary ) : tempNamer( "_global_init" ) { 84 73 std::list< Expression * > ctorParameters; 85 74 std::list< Expression * > dtorParameters; … … 91 80 // for library code are run before constructors and destructors for user code, 92 81 // specify a priority when building the library. Priorities 0-100 are reserved by gcc. 93 ctorParameters.push_back( new ConstantExpr( Constant::from_int( 102 ) ) ); 94 dtorParameters.push_back( new ConstantExpr( Constant::from_int( 102 ) ) ); 82 // Priorities 101-200 are reserved by cfa, so use priority 200 for CFA library globals, 83 // allowing room for overriding with a higher priority. 84 ctorParameters.push_back( new ConstantExpr( Constant::from_int( 200 ) ) ); 85 dtorParameters.push_back( new ConstantExpr( Constant::from_int( 200 ) ) ); 95 86 } 96 initFunction = new FunctionDecl( "_ init_" + fixedName, Type::StorageClasses( Type::Static ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt() );87 initFunction = new FunctionDecl( "__global_init__", Type::StorageClasses( Type::Static ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt() ); 97 88 initFunction->get_attributes().push_back( new Attribute( "constructor", ctorParameters ) ); 98 destroyFunction = new FunctionDecl( "_ destroy_" + fixedName, Type::StorageClasses( Type::Static ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt() );89 destroyFunction = new FunctionDecl( "__global_destroy__", Type::StorageClasses( Type::Static ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt() ); 99 90 destroyFunction->get_attributes().push_back( new Attribute( "destructor", dtorParameters ) ); 100 91 } … … 111 102 if ( ConstructorInit * ctorInit = dynamic_cast< ConstructorInit * >( objDecl->get_init() ) ) { 112 103 // a decision should have been made by the resolver, so ctor and init are not both non-NULL 113 assert( ! ctorInit-> get_ctor() || ! ctorInit->get_init());104 assert( ! ctorInit->ctor || ! ctorInit->init ); 114 105 115 Statement * dtor = ctorInit-> get_dtor();106 Statement * dtor = ctorInit->dtor; 116 107 if ( dtor && ! isIntrinsicSingleArgCallStmt( dtor ) ) { 117 108 // don't need to call intrinsic dtor, because it does nothing, but 118 109 // non-intrinsic dtors must be called 119 110 destroyStatements.push_front( dtor ); 120 ctorInit-> set_dtor( NULL );111 ctorInit->dtor = nullptr; 121 112 } // if 122 if ( Statement * ctor = ctorInit-> get_ctor()) {113 if ( Statement * ctor = ctorInit->ctor ) { 123 114 initStatements.push_back( ctor ); 124 objDecl-> set_init( NULL );125 ctorInit-> set_ctor( NULL );126 } else if ( Initializer * init = ctorInit-> get_init()) {127 objDecl-> set_init( init );128 ctorInit-> set_init( NULL );115 objDecl->init = nullptr; 116 ctorInit->ctor = nullptr; 117 } else if ( Initializer * init = ctorInit->init ) { 118 objDecl->init = init; 119 ctorInit->init = nullptr; 129 120 } else { 130 121 // no constructor and no initializer, which is okay 131 objDecl-> set_init( NULL );122 objDecl->init = nullptr; 132 123 } // if 133 124 delete ctorInit; -
src/InitTweak/FixGlobalInit.h
rf9feab8 r90152a4 22 22 23 23 namespace InitTweak { 24 /// Moves global initialization into an _init function that is unique to the translation unit. 25 /// Sets the priority of the initialization function depending on whether the initialization 26 /// function is for library code. 27 void fixGlobalInit( std::list< Declaration * > & translationUnit, const std::string & name, bool inLibrary ); 28 29 /// Apply transformations to a file name to get a valid C identifier which will be used as 30 /// the name of the generated initializer function. 31 std::string globalFunctionName( const std::string & name ); 24 /// Moves global initialization into an _init function that is unique to the translation unit. 25 /// Sets the priority of the initialization function depending on whether the initialization 26 /// function is for library code. 27 void fixGlobalInit( std::list< Declaration * > & translationUnit, bool inLibrary ); 32 28 } // namespace 33 29 -
src/InitTweak/FixInit.cc
rf9feab8 r90152a4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // FixInit. h--7 // FixInit.cc -- 8 8 // 9 9 // Author : Rob Schluntz … … 54 54 #include "SynTree/Type.h" // for Type, Type::StorageClasses 55 55 #include "SynTree/TypeSubstitution.h" // for TypeSubstitution, operator<< 56 #include "SynTree/ VarExprReplacer.h" // for VarExprReplacer56 #include "SynTree/DeclReplacer.h" // for DeclReplacer 57 57 #include "SynTree/Visitor.h" // for acceptAll, maybeAccept 58 58 … … 68 68 namespace { 69 69 typedef std::unordered_map< int, int > UnqCount; 70 71 struct SelfAssignChecker { 72 void previsit( ApplicationExpr * appExpr ); 73 }; 70 74 71 75 struct InsertImplicitCalls : public WithTypeSubstitution { … … 180 184 }; 181 185 182 class FixCopyCtors final : public WithStmtsToAdd, public WithShortCircuiting, public WithVisitorRef<FixCopyCtors> {186 class FixCopyCtors final : public WithStmtsToAdd, public WithShortCircuiting, public WithVisitorRef<FixCopyCtors>, public WithTypeSubstitution { 183 187 public: 184 188 FixCopyCtors( UnqCount & unqCount ) : unqCount( unqCount ){} … … 194 198 }; 195 199 196 struct GenStructMemberCalls final : public WithGuards, public WithShortCircuiting, public WithIndexer {200 struct GenStructMemberCalls final : public WithGuards, public WithShortCircuiting, public WithIndexer, public WithVisitorRef<GenStructMemberCalls> { 197 201 /// generate default/copy ctor and dtor calls for user-defined struct ctor/dtors 198 202 /// for any member that is missing a corresponding ctor/dtor call. … … 200 204 static void generate( std::list< Declaration * > & translationUnit ); 201 205 202 void previsit( StructDecl * structDecl ); 203 204 void previsit( FunctionDecl * funcDecl ); 205 void postvisit( FunctionDecl * funcDecl ); 206 207 void previsit( MemberExpr * memberExpr ); 208 void previsit( ApplicationExpr * appExpr ); 209 210 SemanticError errors; 206 void premutate( StructDecl * structDecl ); 207 208 void premutate( FunctionDecl * funcDecl ); 209 DeclarationWithType * postmutate( FunctionDecl * funcDecl ); 210 211 void premutate( MemberExpr * memberExpr ); 212 void premutate( ApplicationExpr * appExpr ); 213 214 /// Note: this post mutate used to be in a separate visitor. If this pass breaks, one place to examine is whether it is 215 /// okay for this part of the recursion to occur alongside the rest. 216 Expression * postmutate( UntypedExpr * expr ); 217 218 SemanticErrorException errors; 211 219 private: 212 220 template< typename... Params > … … 225 233 }; 226 234 227 // very simple resolver-like mutator class - used to228 // resolve UntypedExprs that are found within newly229 // generated constructor/destructor calls230 class MutatingResolver final : public Mutator {231 public:232 MutatingResolver( SymTab::Indexer & indexer ) : indexer( indexer ) {}233 234 using Mutator::mutate;235 virtual DeclarationWithType* mutate( ObjectDecl *objectDecl ) override;236 virtual Expression* mutate( UntypedExpr *untypedExpr ) override;237 238 private:239 SymTab::Indexer & indexer;240 };241 242 235 struct FixCtorExprs final : public WithDeclsToAdd, public WithIndexer { 243 236 /// expands ConstructorExpr nodes into comma expressions, using a temporary for the first argument … … 248 241 } // namespace 249 242 250 void fix( std::list< Declaration * > & translationUnit, const std::string & filename, bool inLibrary ) { 243 void fix( std::list< Declaration * > & translationUnit, bool inLibrary ) { 244 PassVisitor<SelfAssignChecker> checker; 245 acceptAll( translationUnit, checker ); 246 251 247 // fixes ConstructorInit for global variables. should happen before fixInitializers. 252 InitTweak::fixGlobalInit( translationUnit, filename,inLibrary );248 InitTweak::fixGlobalInit( translationUnit, inLibrary ); 253 249 254 250 UnqCount unqCount; … … 290 286 // can't use mutateAll, because need to insert declarations at top-level 291 287 // can't use DeclMutator, because sometimes need to insert IfStmt, etc. 292 SemanticError errors;288 SemanticErrorException errors; 293 289 for ( std::list< Declaration * >::iterator i = translationUnit.begin(); i != translationUnit.end(); ++i ) { 294 290 try { 295 291 maybeMutate( *i, fixer ); 296 292 translationUnit.splice( i, fixer.pass.staticDtorDecls ); 297 } catch( SemanticError &e ) { 298 e.set_location( (*i)->location ); 293 } catch( SemanticErrorException &e ) { 299 294 errors.append( e ); 300 295 } // try … … 318 313 void GenStructMemberCalls::generate( std::list< Declaration * > & translationUnit ) { 319 314 PassVisitor<GenStructMemberCalls> warner; 320 acceptAll( translationUnit, warner );315 mutateAll( translationUnit, warner ); 321 316 } 322 317 … … 324 319 PassVisitor<FixCtorExprs> fixer; 325 320 mutateAll( translationUnit, fixer ); 321 } 322 323 namespace { 324 // Relatively simple structural comparison for expressions, needed to determine 325 // if two expressions are "the same" (used to determine if self assignment occurs) 326 struct StructuralChecker { 327 Expression * stripCasts( Expression * expr ) { 328 // this might be too permissive. It's possible that only particular casts are relevant. 329 while ( CastExpr * cast = dynamic_cast< CastExpr * >( expr ) ) { 330 expr = cast->arg; 331 } 332 return expr; 333 } 334 335 void previsit( Expression * ) { 336 // anything else does not qualify 337 isSimilar = false; 338 } 339 340 template<typename T> 341 T * cast( Expression * node ) { 342 // all expressions need to ignore casts, so this bit has been factored out 343 return dynamic_cast< T * >( stripCasts( node ) ); 344 } 345 346 // ignore casts 347 void previsit( CastExpr * ) {} 348 349 void previsit( MemberExpr * memExpr ) { 350 if ( MemberExpr * otherMember = cast< MemberExpr >( other ) ) { 351 if ( otherMember->member == memExpr->member ) { 352 other = otherMember->aggregate; 353 return; 354 } 355 } 356 isSimilar = false; 357 } 358 359 void previsit( VariableExpr * varExpr ) { 360 if ( VariableExpr * otherVar = cast< VariableExpr >( other ) ) { 361 if ( otherVar->var == varExpr->var ) { 362 return; 363 } 364 } 365 isSimilar = false; 366 } 367 368 void previsit( AddressExpr * ) { 369 if ( AddressExpr * addrExpr = cast< AddressExpr >( other ) ) { 370 other = addrExpr->arg; 371 return; 372 } 373 isSimilar = false; 374 } 375 376 Expression * other = nullptr; 377 bool isSimilar = true; 378 }; 379 380 bool structurallySimilar( Expression * e1, Expression * e2 ) { 381 PassVisitor<StructuralChecker> checker; 382 checker.pass.other = e2; 383 e1->accept( checker ); 384 return checker.pass.isSimilar; 385 } 386 } 387 388 void SelfAssignChecker::previsit( ApplicationExpr * appExpr ) { 389 DeclarationWithType * function = getFunction( appExpr ); 390 if ( function->name == "?=?" ) { // doesn't use isAssignment, because ?+=?, etc. should not count as self-assignment 391 if ( appExpr->args.size() == 2 ) { 392 // check for structural similarity (same variable use, ignore casts, etc. - but does not look too deeply, anything looking like a function is off limits) 393 if ( structurallySimilar( appExpr->args.front(), appExpr->args.back() ) ) { 394 SemanticWarning( appExpr->location, Warning::SelfAssignment, toCString( appExpr->args.front() ) ); 395 } 396 } 397 } 326 398 } 327 399 … … 368 440 // arrays are not copy constructed, so this should always be an ExprStmt 369 441 ImplicitCtorDtorStmt * stmt = genCtorDtor( fname, var, cpArg ); 370 ExprStmt * exprStmt = strict_dynamic_cast< ExprStmt * >( stmt->get_callStmt() ); 442 assertf( stmt, "ResolveCopyCtors: genCtorDtor returned nullptr: %s / %s / %s", fname.c_str(), toString( var ).c_str(), toString( cpArg ).c_str() ); 443 ExprStmt * exprStmt = strict_dynamic_cast< ExprStmt * >( stmt->callStmt ); 371 444 Expression * resolved = exprStmt->expr; 372 445 exprStmt->expr = nullptr; // take ownership of expr … … 378 451 ResolvExpr::findVoidExpression( resolved, indexer ); 379 452 assert( resolved ); 380 if ( resolved-> get_env()) {453 if ( resolved->env ) { 381 454 // Extract useful information and discard new environments. Keeping them causes problems in PolyMutator passes. 382 env->add( *resolved-> get_env());383 delete resolved-> get_env();384 resolved-> set_env( nullptr );455 env->add( *resolved->env ); 456 delete resolved->env; 457 resolved->env = nullptr; 385 458 } // if 386 459 delete stmt; 460 if ( TupleAssignExpr * assign = dynamic_cast< TupleAssignExpr * >( resolved ) ) { 461 // fix newly generated StmtExpr 462 postvisit( assign->stmtExpr ); 463 } 387 464 return resolved; 388 465 } … … 478 555 static UniqueName retNamer("_tmp_stmtexpr_ret"); 479 556 480 // create variable that will hold the result of the stmt expr481 557 result = result->clone(); 482 558 env->apply( result ); 559 if ( ! InitTweak::isConstructable( result ) ) { 560 delete result; 561 return; 562 } 563 564 // create variable that will hold the result of the stmt expr 483 565 ObjectDecl * ret = ObjectDecl::newObject( retNamer.newName(), result, nullptr ); 484 ret-> get_type()->set_const( false );485 stmtExpr-> get_returnDecls().push_front( ret );566 ret->type->set_const( false ); 567 stmtExpr->returnDecls.push_front( ret ); 486 568 487 569 // must have a non-empty body, otherwise it wouldn't have a result 488 CompoundStmt * body = stmtExpr-> get_statements();570 CompoundStmt * body = stmtExpr->statements; 489 571 assert( ! body->get_kids().empty() ); 490 572 // must be an ExprStmt, otherwise it wouldn't have a result 491 573 ExprStmt * last = strict_dynamic_cast< ExprStmt * >( body->get_kids().back() ); 492 last-> set_expr( makeCtorDtor( "?{}", ret, last->get_expr()) );493 494 stmtExpr-> get_dtors().push_front( makeCtorDtor( "^?{}", ret ) );574 last->expr = makeCtorDtor( "?{}", ret, last->get_expr() ); 575 576 stmtExpr->dtors.push_front( makeCtorDtor( "^?{}", ret ) ); 495 577 } // if 496 578 } … … 555 637 // add destructors after current statement 556 638 for ( Expression * dtor : dtors ) { 639 // take relevant bindings from environment 640 assert( ! dtor->env ); 641 dtor->env = maybeClone( env ); 557 642 stmtsToAddAfter.push_back( new ExprStmt( dtor ) ); 558 643 } // for … … 593 678 // to the outer context, rather than inside of the statement expression. 594 679 visit_children = false; 595 std::list< Statement * > & stmts = stmtExpr-> get_statements()->get_kids();680 std::list< Statement * > & stmts = stmtExpr->statements->get_kids(); 596 681 for ( Statement *& stmt : stmts ) { 597 682 stmt = stmt->acceptMutator( *visitor ); 598 683 } // for 599 assert( stmtExpr-> get_result());600 Type * result = stmtExpr-> get_result();684 assert( stmtExpr->result ); 685 Type * result = stmtExpr->result; 601 686 if ( ! result->isVoid() ) { 602 for ( ObjectDecl * obj : stmtExpr-> get_returnDecls()) {687 for ( ObjectDecl * obj : stmtExpr->returnDecls ) { 603 688 stmtsToAddBefore.push_back( new DeclStmt( obj ) ); 604 689 } // for 605 690 // add destructors after current statement 606 for ( Expression * dtor : stmtExpr-> get_dtors()) {691 for ( Expression * dtor : stmtExpr->dtors ) { 607 692 stmtsToAddAfter.push_back( new ExprStmt( dtor ) ); 608 693 } // for 609 694 // must have a non-empty body, otherwise it wouldn't have a result 610 695 assert( ! stmts.empty() ); 611 assert( ! stmtExpr->get_returnDecls().empty() ); 612 stmts.push_back( new ExprStmt( new VariableExpr( stmtExpr->get_returnDecls().front() ) ) ); 613 stmtExpr->get_returnDecls().clear(); 614 stmtExpr->get_dtors().clear(); 615 } 616 assert( stmtExpr->get_returnDecls().empty() ); 617 assert( stmtExpr->get_dtors().empty() ); 696 assertf( ! stmtExpr->returnDecls.empty() || stmtExpr->dtors.empty(), "StmtExpr returns non-void, but no return decls: %s", toString( stmtExpr ).c_str() ); 697 // if there is a return decl, add a use as the last statement; will not have return decl on non-constructable returns 698 if ( ! stmtExpr->returnDecls.empty() ) { 699 stmts.push_back( new ExprStmt( new VariableExpr( stmtExpr->returnDecls.front() ) ) ); 700 } 701 stmtExpr->returnDecls.clear(); 702 stmtExpr->dtors.clear(); 703 } 704 assert( stmtExpr->returnDecls.empty() ); 705 assert( stmtExpr->dtors.empty() ); 618 706 } 619 707 … … 692 780 replacement = new CastExpr( replacement, base->clone() ); 693 781 } 694 VarExprReplacer::replace( dtor, { std::make_pair( objDecl, replacement ) } );695 dtorFunc->statements->push_back( dtor);782 DeclReplacer::replace( dtor, { std::make_pair( objDecl, replacement ) } ); 783 dtorFunc->statements->push_back( strict_dynamic_cast<Statement *>( dtor ) ); 696 784 697 785 return dtorFunc; … … 905 993 ) 906 994 if ( ! diff.empty() ) { 907 throw SemanticError( std::string("jump to label '") + stmt->get_target().get_name() + "' crosses initialization of " + (*diff.begin())->get_name() + " ", stmt);995 SemanticError( stmt, std::string("jump to label '") + stmt->get_target().get_name() + "' crosses initialization of " + (*diff.begin())->get_name() + " " ); 908 996 } // if 909 997 } … … 931 1019 } 932 1020 933 void GenStructMemberCalls::pre visit( StructDecl * structDecl ) {1021 void GenStructMemberCalls::premutate( StructDecl * structDecl ) { 934 1022 if ( ! dtorStruct && structDecl->name == "__Destructor" ) { 935 1023 dtorStruct = structDecl; … … 937 1025 } 938 1026 939 void GenStructMemberCalls::pre visit( FunctionDecl * funcDecl ) {1027 void GenStructMemberCalls::premutate( FunctionDecl * funcDecl ) { 940 1028 GuardValue( function ); 941 1029 GuardValue( unhandled ); … … 944 1032 GuardValue( isCtor ); 945 1033 GuardValue( structDecl ); 946 errors = SemanticError (); // clear previous errors1034 errors = SemanticErrorException(); // clear previous errors 947 1035 948 1036 // need to start with fresh sets … … 977 1065 } 978 1066 979 void GenStructMemberCalls::postvisit( FunctionDecl * funcDecl ) {1067 DeclarationWithType * GenStructMemberCalls::postmutate( FunctionDecl * funcDecl ) { 980 1068 // remove the unhandled objects from usedUninit, because a call is inserted 981 1069 // to handle them - only objects that are later constructed are used uninitialized. … … 1031 1119 Statement * callStmt = stmt.front(); 1032 1120 1033 MutatingResolver resolver( indexer );1034 1121 try { 1035 callStmt->acceptMutator( resolver );1122 callStmt->acceptMutator( *visitor ); 1036 1123 if ( isCtor ) { 1037 1124 function->statements->push_front( callStmt ); … … 1061 1148 function->statements->kids.splice( function->statements->kids.begin(), stmtsToAdd ); 1062 1149 } 1063 } catch ( SemanticError & error ) {1150 } catch ( SemanticErrorException & error ) { 1064 1151 emit( funcDecl->location, "in ", CodeGen::genPrettyType( function->get_functionType(), function->get_name() ), ", field ", field->get_name(), " not explicitly ", isCtor ? "constructed" : "destructed", " and no ", isCtor ? "default constructor" : "destructor", " found" ); 1065 1152 } … … 1070 1157 throw errors; 1071 1158 } 1159 return funcDecl; 1072 1160 } 1073 1161 … … 1095 1183 } 1096 1184 1097 void GenStructMemberCalls::pre visit( ApplicationExpr * appExpr ) {1185 void GenStructMemberCalls::premutate( ApplicationExpr * appExpr ) { 1098 1186 if ( ! checkWarnings( function ) ) { 1099 1187 visit_children = false; … … 1102 1190 1103 1191 std::string fname = getFunctionName( appExpr ); 1104 if ( fname == function-> get_name()) {1192 if ( fname == function->name ) { 1105 1193 // call to same kind of function 1106 Expression * firstParam = appExpr-> get_args().front();1194 Expression * firstParam = appExpr->args.front(); 1107 1195 1108 1196 if ( isThisExpression( firstParam, thisParam ) ) { … … 1113 1201 // if first parameter is a member expression on the this parameter, 1114 1202 // then remove the member from unhandled set. 1115 if ( isThisExpression( memberExpr-> get_aggregate(), thisParam ) ) {1116 unhandled.erase( memberExpr-> get_member());1203 if ( isThisExpression( memberExpr->aggregate, thisParam ) ) { 1204 unhandled.erase( memberExpr->member ); 1117 1205 } 1118 1206 } … … 1120 1208 } 1121 1209 1122 void GenStructMemberCalls::pre visit( MemberExpr * memberExpr ) {1210 void GenStructMemberCalls::premutate( MemberExpr * memberExpr ) { 1123 1211 if ( ! checkWarnings( function ) || ! isCtor ) { 1124 1212 visit_children = false; … … 1136 1224 template< typename Visitor, typename... Params > 1137 1225 void error( Visitor & v, CodeLocation loc, const Params &... params ) { 1138 SemanticError err( toString( params... ) ); 1139 err.set_location( loc ); 1226 SemanticErrorException err( loc, toString( params... ) ); 1140 1227 v.errors.append( err ); 1141 1228 } … … 1148 1235 } 1149 1236 1150 DeclarationWithType * MutatingResolver::mutate( ObjectDecl * objectDecl ) { 1151 // add object to the indexer assumes that there will be no name collisions 1152 // in generated code. If this changes, add mutate methods for entities with 1153 // scope and call {enter,leave}Scope explicitly. 1154 indexer.addId( objectDecl ); 1155 return objectDecl; 1156 } 1157 1158 Expression * MutatingResolver::mutate( UntypedExpr * untypedExpr ) { 1237 Expression * GenStructMemberCalls::postmutate( UntypedExpr * untypedExpr ) { 1159 1238 Expression * newExpr = untypedExpr; 1160 1239 ResolvExpr::findVoidExpression( newExpr, indexer ); -
src/InitTweak/FixInit.h
rf9feab8 r90152a4 24 24 /// replace constructor initializers with expression statements 25 25 /// and unwrap basic C-style initializers 26 void fix( std::list< Declaration * > & translationUnit, const std::string & name,bool inLibrary );26 void fix( std::list< Declaration * > & translationUnit, bool inLibrary ); 27 27 } // namespace 28 28 -
src/InitTweak/GenInit.cc
rf9feab8 r90152a4 30 30 #include "InitTweak.h" // for isConstExpr, InitExpander, checkIn... 31 31 #include "Parser/LinkageSpec.h" // for isOverridable, C 32 #include "ResolvExpr/Resolver.h" 32 33 #include "SymTab/Autogen.h" // for genImplicitCall, SizeType 33 34 #include "SymTab/Mangler.h" // for Mangler … … 40 41 #include "SynTree/Type.h" // for Type, ArrayType, Type::Qualifiers 41 42 #include "SynTree/Visitor.h" // for acceptAll, maybeAccept 43 #include "Tuples/Tuples.h" // for maybeImpure 42 44 43 45 namespace InitTweak { … … 89 91 }; 90 92 91 struct HoistArrayDimension final : public WithDeclsToAdd, public WithShortCircuiting, public WithGuards {93 struct HoistArrayDimension final : public WithDeclsToAdd, public WithShortCircuiting, public WithGuards, public WithIndexer { 92 94 /// hoist dimension from array types in object declaration so that it uses a single 93 95 /// const variable of type size_t, so that side effecting array dimensions are only … … 104 106 void premutate( FunctionType * ) { visit_children = false; } 105 107 108 // need this so that enumerators are added to the indexer, due to premutate(AggregateDecl *) 109 void premutate( EnumDecl * ) {} 110 106 111 void hoist( Type * type ); 107 112 … … 135 140 if ( varExpr->var == retVal ) return; 136 141 } 137 stmtsToAddBefore.push_back( genCtorDtor( "?{}", retVal, returnStmt->get_expr() ) ); 142 Statement * stmt = genCtorDtor( "?{}", retVal, returnStmt->expr ); 143 assertf( stmt, "ReturnFixer: genCtorDtor returned nullptr: %s / %s", toString( retVal ).c_str(), toString( returnStmt->expr ).c_str() ); 144 stmtsToAddBefore.push_back( stmt ); 138 145 139 146 // return the retVal object … … 178 185 if ( ! arrayType->get_dimension() ) return; // xxx - recursive call to hoist? 179 186 180 // don't need to hoist dimension if it's a constexpr - only need to if there's potential for side effects. 181 if ( isConstExpr( arrayType->get_dimension() ) ) return; 187 // need to resolve array dimensions in order to accurately determine if constexpr 188 ResolvExpr::findSingleExpression( arrayType->dimension, SymTab::SizeType->clone(), indexer ); 189 // array is variable-length when the dimension is not constexpr 190 arrayType->isVarLen = ! isConstExpr( arrayType->dimension ); 191 // don't need to hoist dimension if it's definitely pure - only need to if there's potential for side effects. 192 if ( ! Tuples::maybeImpure( arrayType->dimension ) ) return; 182 193 183 194 ObjectDecl * arrayDimension = new ObjectDecl( dimensionName.newName(), storageClasses, LinkageSpec::C, 0, SymTab::SizeType->clone(), new SingleInit( arrayType->get_dimension() ) ); … … 194 205 void HoistArrayDimension::premutate( FunctionDecl * ) { 195 206 GuardValue( inFunction ); 207 inFunction = true; 196 208 } 197 209 … … 220 232 Type * type = objDecl->get_type(); 221 233 while ( ArrayType * at = dynamic_cast< ArrayType * >( type ) ) { 234 // must always construct VLAs with an initializer, since this is an error in C 235 if ( at->isVarLen && objDecl->init ) return true; 222 236 type = at->get_base(); 223 237 } … … 303 317 if ( tryConstruct( objDecl ) && ( managedTypes.isManaged( objDecl ) || ((! inFunction || objDecl->get_storageClasses().is_static ) && ! isConstExpr( objDecl->get_init() ) ) ) ) { 304 318 // constructed objects cannot be designated 305 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 @=.\n", objDecl);319 if ( isDesignated( objDecl->get_init() ) ) SemanticError( objDecl, "Cannot include designations in the initializer for a managed Object. If this is really what you want, then initialize with @=.\n" ); 306 320 // constructed objects should not have initializers nested too deeply 307 if ( ! checkInitDepth( objDecl ) ) throw SemanticError( "Managed object's initializer is too deep ", objDecl);321 if ( ! checkInitDepth( objDecl ) ) SemanticError( objDecl, "Managed object's initializer is too deep " ); 308 322 309 323 objDecl->set_init( genCtorInit( objDecl ) ); -
src/InitTweak/InitTweak.cc
rf9feab8 r90152a4 225 225 // xxx - this shouldn't be an error, but need a way to 226 226 // terminate without creating output, so should catch this error 227 throw SemanticError("unbalanced list initializers" );227 SemanticError( init->location, "unbalanced list initializers" ); 228 228 } 229 229 … … 296 296 ObjectDecl * objDecl = dynamic_cast< ObjectDecl * >( dwt ); 297 297 if ( ! objDecl ) return false; 298 return ! LinkageSpec::isBuiltin( objDecl->get_linkage() ) && 299 (objDecl->get_init() == nullptr || 298 return (objDecl->get_init() == nullptr || 300 299 ( objDecl->get_init() != nullptr && objDecl->get_init()->get_maybeConstructed() )) 301 300 && ! objDecl->get_storageClasses().is_extern … … 409 408 return allofCtorDtor( stmt, []( Expression * callExpr ){ 410 409 if ( ApplicationExpr * appExpr = isIntrinsicCallExpr( callExpr ) ) { 411 FunctionType *funcType = GenPoly::getFunctionType( appExpr-> get_function()->get_result());410 FunctionType *funcType = GenPoly::getFunctionType( appExpr->function->result ); 412 411 assert( funcType ); 413 412 return funcType->get_parameters().size() == 1; … … 529 528 } 530 529 if ( dynamic_cast< ReferenceType * >( dst->result ) ) { 531 dst = new AddressExpr( dst ); 530 for (int depth = dst->result->referenceDepth(); depth > 0; depth--) { 531 dst = new AddressExpr( dst ); 532 } 532 533 } else { 533 534 dst = new CastExpr( dst, new ReferenceType( noQualifiers, dst->result->clone() ) ); 534 535 } 535 536 if ( dynamic_cast< ReferenceType * >( src->result ) ) { 536 src = new CastExpr( src, new ReferenceType( noQualifiers, src->result->stripReferences()->clone() ) ); 537 for (int depth = src->result->referenceDepth(); depth > 0; depth--) { 538 src = new AddressExpr( src ); 539 } 540 // src = new CastExpr( src, new ReferenceType( noQualifiers, src->result->stripReferences()->clone() ) ); 537 541 } 538 542 return new ApplicationExpr( VariableExpr::functionPointer( assign ), { dst, src } ); … … 564 568 void previsit( ConstantExpr * ) {} 565 569 570 void previsit( VariableExpr * varExpr ) { 571 visit_children = false; 572 573 if ( EnumInstType * inst = dynamic_cast< EnumInstType * >( varExpr->result ) ) { 574 long long int value; 575 if ( inst->baseEnum->valueOf( varExpr->var, value ) ) { 576 // enumerators are const expr 577 return; 578 } 579 } 580 isConstExpr = false; 581 } 582 566 583 bool isConstExpr = true; 567 584 }; -
src/Makefile.am
rf9feab8 r90152a4 16 16 17 17 # create object files in directory with source files 18 AUTOMAKE_OPTIONS = subdir-objects18 AUTOMAKE_OPTIONS = foreign subdir-objects 19 19 20 20 SRC = main.cc \ 21 MakeLibCfa.cc 21 MakeLibCfa.cc \ 22 CompilationState.cc 22 23 23 24 MAINTAINERCLEANFILES = 25 MOSTLYCLEANFILES = 24 26 25 27 # Is there a way to use a variable for the directory names? … … 37 39 include SynTree/module.mk 38 40 include Tuples/module.mk 41 include Validate/module.mk 39 42 include Virtual/module.mk 40 43 41 44 # put into lib for now 42 cfa_cpplibdir = ${CFA_LIBDIR} 43 cfa_cpplib_PROGRAMS = driver/cfa-cpp 44 driver_cfa_cpp_SOURCES = ${SRC} 45 driver_cfa_cpp_LDADD = -ldl # yywrap 46 driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -Wextra -DDEBUG_ALL -I${abs_top_srcdir}/src/include -DYY_NO_INPUT -O2 -g -std=c++14 47 driver_cfa_cpp_LDFLAGS = -Xlinker -export-dynamic 45 cfa_cpplibdir = $(CFA_LIBDIR) 46 cfa_cpplib_PROGRAMS = ../driver/cfa-cpp demangler 47 ___driver_cfa_cpp_SOURCES = $(SRC) 48 ___driver_cfa_cpp_LDADD = -ldl # yywrap 49 50 AM_CXXFLAGS = @HOST_FLAGS@ -Wno-deprecated -Wall -Wextra -DDEBUG_ALL -I./Parser -I$(srcdir)/Parser -I$(srcdir)/include -DYY_NO_INPUT -O2 -g -std=c++14 51 AM_LDFLAGS = @HOST_FLAGS@ -Xlinker -export-dynamic 52 53 demangler_SOURCES = SymTab/demangler.cc 54 55 demangler_LDADD = libdemangle.a # yywrap 56 57 noinst_LIBRARIES = libdemangle.a 58 libdemangle_a_SOURCES = SymTab/Demangle.cc SymTab/ManglerCommon.cc \ 59 SynTree/Type.cc \ 60 SynTree/VoidType.cc \ 61 SynTree/BasicType.cc \ 62 SynTree/PointerType.cc \ 63 SynTree/ArrayType.cc \ 64 SynTree/ReferenceType.cc \ 65 SynTree/FunctionType.cc \ 66 SynTree/ReferenceToType.cc \ 67 SynTree/TupleType.cc \ 68 SynTree/TypeofType.cc \ 69 SynTree/AttrType.cc \ 70 SynTree/VarArgsType.cc \ 71 SynTree/ZeroOneType.cc \ 72 SynTree/Constant.cc \ 73 SynTree/Expression.cc \ 74 SynTree/TupleExpr.cc \ 75 SynTree/CommaExpr.cc \ 76 SynTree/TypeExpr.cc \ 77 SynTree/ApplicationExpr.cc \ 78 SynTree/AddressExpr.cc \ 79 SynTree/Statement.cc \ 80 SynTree/CompoundStmt.cc \ 81 SynTree/DeclStmt.cc \ 82 SynTree/Declaration.cc \ 83 SynTree/DeclarationWithType.cc \ 84 SynTree/ObjectDecl.cc \ 85 SynTree/FunctionDecl.cc \ 86 SynTree/AggregateDecl.cc \ 87 SynTree/NamedTypeDecl.cc \ 88 SynTree/TypeDecl.cc \ 89 SynTree/Initializer.cc \ 90 SynTree/TypeSubstitution.cc \ 91 SynTree/Attribute.cc \ 92 SynTree/DeclReplacer.cc \ 93 CompilationState.cc \ 94 CodeGen/CodeGenerator.cc \ 95 CodeGen/FixMain.cc \ 96 CodeGen/GenType.cc \ 97 CodeGen/OperatorTable.cc \ 98 Common/Assert.cc \ 99 Common/Eval.cc \ 100 Common/SemanticError.cc \ 101 Common/UniqueName.cc \ 102 Concurrency/Keywords.cc \ 103 ControlStruct/ForExprMutator.cc \ 104 ControlStruct/LabelFixer.cc \ 105 ControlStruct/LabelGenerator.cc \ 106 ControlStruct/MLEMutator.cc \ 107 ControlStruct/Mutate.cc \ 108 GenPoly/GenPoly.cc \ 109 GenPoly/Lvalue.cc \ 110 InitTweak/GenInit.cc \ 111 InitTweak/InitTweak.cc \ 112 Parser/LinkageSpec.cc \ 113 ResolvExpr/AdjustExprType.cc \ 114 ResolvExpr/Alternative.cc \ 115 ResolvExpr/AlternativeFinder.cc \ 116 ResolvExpr/ExplodedActual.cc \ 117 ResolvExpr/CastCost.cc \ 118 ResolvExpr/CommonType.cc \ 119 ResolvExpr/ConversionCost.cc \ 120 ResolvExpr/CurrentObject.cc \ 121 ResolvExpr/FindOpenVars.cc \ 122 ResolvExpr/Occurs.cc \ 123 ResolvExpr/PolyCost.cc \ 124 ResolvExpr/PtrsAssignable.cc \ 125 ResolvExpr/PtrsCastable.cc \ 126 ResolvExpr/RenameVars.cc \ 127 ResolvExpr/Resolver.cc \ 128 ResolvExpr/ResolveTypeof.cc \ 129 ResolvExpr/TypeEnvironment.cc \ 130 ResolvExpr/Unify.cc \ 131 SymTab/Autogen.cc \ 132 SymTab/FixFunction.cc \ 133 SymTab/Indexer.cc \ 134 SymTab/Mangler.cc \ 135 SymTab/Validate.cc \ 136 Tuples/Explode.cc \ 137 Tuples/TupleAssignment.cc \ 138 Tuples/TupleExpansion.cc \ 139 Validate/HandleAttributes.cc 48 140 49 141 MAINTAINERCLEANFILES += ${libdir}/${notdir ${cfa_cpplib_PROGRAMS}} -
src/Makefile.in
rf9feab8 r90152a4 59 59 ######################### -*- Mode: Makefile-Gmake -*- ######################## 60 60 ############################################################################### 61 62 ######################### -*- Mode: Makefile-Gmake -*- ######################## 63 ############################################################################### 64 61 65 62 66 VPATH = @srcdir@ … … 134 138 build_triplet = @build@ 135 139 host_triplet = @host@ 136 cfa_cpplib_PROGRAMS = driver/cfa-cpp$(EXEEXT)140 cfa_cpplib_PROGRAMS = ../driver/cfa-cpp$(EXEEXT) demangler$(EXEEXT) 137 141 subdir = src 138 142 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 139 am__aclocal_m4_deps = $(top_srcdir)/configure.ac 143 am__aclocal_m4_deps = $(top_srcdir)/automake/cfa.m4 \ 144 $(top_srcdir)/configure.ac 140 145 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 141 146 $(ACLOCAL_M4) … … 145 150 CONFIG_CLEAN_FILES = 146 151 CONFIG_CLEAN_VPATH_FILES = 152 LIBRARIES = $(noinst_LIBRARIES) 153 AR = ar 154 ARFLAGS = cru 155 AM_V_AR = $(am__v_AR_@AM_V@) 156 am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) 157 am__v_AR_0 = @echo " AR " $@; 158 am__v_AR_1 = 159 libdemangle_a_AR = $(AR) $(ARFLAGS) 160 libdemangle_a_LIBADD = 161 am__dirstamp = $(am__leading_dot)dirstamp 162 am_libdemangle_a_OBJECTS = SymTab/Demangle.$(OBJEXT) \ 163 SymTab/ManglerCommon.$(OBJEXT) SynTree/Type.$(OBJEXT) \ 164 SynTree/VoidType.$(OBJEXT) SynTree/BasicType.$(OBJEXT) \ 165 SynTree/PointerType.$(OBJEXT) SynTree/ArrayType.$(OBJEXT) \ 166 SynTree/ReferenceType.$(OBJEXT) SynTree/FunctionType.$(OBJEXT) \ 167 SynTree/ReferenceToType.$(OBJEXT) SynTree/TupleType.$(OBJEXT) \ 168 SynTree/TypeofType.$(OBJEXT) SynTree/AttrType.$(OBJEXT) \ 169 SynTree/VarArgsType.$(OBJEXT) SynTree/ZeroOneType.$(OBJEXT) \ 170 SynTree/Constant.$(OBJEXT) SynTree/Expression.$(OBJEXT) \ 171 SynTree/TupleExpr.$(OBJEXT) SynTree/CommaExpr.$(OBJEXT) \ 172 SynTree/TypeExpr.$(OBJEXT) SynTree/ApplicationExpr.$(OBJEXT) \ 173 SynTree/AddressExpr.$(OBJEXT) SynTree/Statement.$(OBJEXT) \ 174 SynTree/CompoundStmt.$(OBJEXT) SynTree/DeclStmt.$(OBJEXT) \ 175 SynTree/Declaration.$(OBJEXT) \ 176 SynTree/DeclarationWithType.$(OBJEXT) \ 177 SynTree/ObjectDecl.$(OBJEXT) SynTree/FunctionDecl.$(OBJEXT) \ 178 SynTree/AggregateDecl.$(OBJEXT) \ 179 SynTree/NamedTypeDecl.$(OBJEXT) SynTree/TypeDecl.$(OBJEXT) \ 180 SynTree/Initializer.$(OBJEXT) \ 181 SynTree/TypeSubstitution.$(OBJEXT) SynTree/Attribute.$(OBJEXT) \ 182 SynTree/DeclReplacer.$(OBJEXT) CompilationState.$(OBJEXT) \ 183 CodeGen/CodeGenerator.$(OBJEXT) CodeGen/FixMain.$(OBJEXT) \ 184 CodeGen/GenType.$(OBJEXT) CodeGen/OperatorTable.$(OBJEXT) \ 185 Common/Assert.$(OBJEXT) Common/Eval.$(OBJEXT) \ 186 Common/SemanticError.$(OBJEXT) Common/UniqueName.$(OBJEXT) \ 187 Concurrency/Keywords.$(OBJEXT) \ 188 ControlStruct/ForExprMutator.$(OBJEXT) \ 189 ControlStruct/LabelFixer.$(OBJEXT) \ 190 ControlStruct/LabelGenerator.$(OBJEXT) \ 191 ControlStruct/MLEMutator.$(OBJEXT) \ 192 ControlStruct/Mutate.$(OBJEXT) GenPoly/GenPoly.$(OBJEXT) \ 193 GenPoly/Lvalue.$(OBJEXT) InitTweak/GenInit.$(OBJEXT) \ 194 InitTweak/InitTweak.$(OBJEXT) Parser/LinkageSpec.$(OBJEXT) \ 195 ResolvExpr/AdjustExprType.$(OBJEXT) \ 196 ResolvExpr/Alternative.$(OBJEXT) \ 197 ResolvExpr/AlternativeFinder.$(OBJEXT) \ 198 ResolvExpr/ExplodedActual.$(OBJEXT) \ 199 ResolvExpr/CastCost.$(OBJEXT) ResolvExpr/CommonType.$(OBJEXT) \ 200 ResolvExpr/ConversionCost.$(OBJEXT) \ 201 ResolvExpr/CurrentObject.$(OBJEXT) \ 202 ResolvExpr/FindOpenVars.$(OBJEXT) ResolvExpr/Occurs.$(OBJEXT) \ 203 ResolvExpr/PolyCost.$(OBJEXT) \ 204 ResolvExpr/PtrsAssignable.$(OBJEXT) \ 205 ResolvExpr/PtrsCastable.$(OBJEXT) \ 206 ResolvExpr/RenameVars.$(OBJEXT) ResolvExpr/Resolver.$(OBJEXT) \ 207 ResolvExpr/ResolveTypeof.$(OBJEXT) \ 208 ResolvExpr/TypeEnvironment.$(OBJEXT) \ 209 ResolvExpr/Unify.$(OBJEXT) SymTab/Autogen.$(OBJEXT) \ 210 SymTab/FixFunction.$(OBJEXT) SymTab/Indexer.$(OBJEXT) \ 211 SymTab/Mangler.$(OBJEXT) SymTab/Validate.$(OBJEXT) \ 212 Tuples/Explode.$(OBJEXT) Tuples/TupleAssignment.$(OBJEXT) \ 213 Tuples/TupleExpansion.$(OBJEXT) \ 214 Validate/HandleAttributes.$(OBJEXT) 215 libdemangle_a_OBJECTS = $(am_libdemangle_a_OBJECTS) 147 216 am__installdirs = "$(DESTDIR)$(cfa_cpplibdir)" 148 217 PROGRAMS = $(cfa_cpplib_PROGRAMS) 149 am__dirstamp = $(am__leading_dot)dirstamp 150 am__objects_1 = driver_cfa_cpp-main.$(OBJEXT) \ 151 driver_cfa_cpp-MakeLibCfa.$(OBJEXT) \ 152 CodeGen/driver_cfa_cpp-Generate.$(OBJEXT) \ 153 CodeGen/driver_cfa_cpp-CodeGenerator.$(OBJEXT) \ 154 CodeGen/driver_cfa_cpp-GenType.$(OBJEXT) \ 155 CodeGen/driver_cfa_cpp-FixNames.$(OBJEXT) \ 156 CodeGen/driver_cfa_cpp-FixMain.$(OBJEXT) \ 157 CodeGen/driver_cfa_cpp-OperatorTable.$(OBJEXT) \ 158 CodeTools/driver_cfa_cpp-DeclStats.$(OBJEXT) \ 159 CodeTools/driver_cfa_cpp-TrackLoc.$(OBJEXT) \ 160 Concurrency/driver_cfa_cpp-Keywords.$(OBJEXT) \ 161 Concurrency/driver_cfa_cpp-Waitfor.$(OBJEXT) \ 162 Common/driver_cfa_cpp-SemanticError.$(OBJEXT) \ 163 Common/driver_cfa_cpp-UniqueName.$(OBJEXT) \ 164 Common/driver_cfa_cpp-DebugMalloc.$(OBJEXT) \ 165 Common/driver_cfa_cpp-Assert.$(OBJEXT) \ 166 ControlStruct/driver_cfa_cpp-LabelGenerator.$(OBJEXT) \ 167 ControlStruct/driver_cfa_cpp-LabelFixer.$(OBJEXT) \ 168 ControlStruct/driver_cfa_cpp-MLEMutator.$(OBJEXT) \ 169 ControlStruct/driver_cfa_cpp-Mutate.$(OBJEXT) \ 170 ControlStruct/driver_cfa_cpp-ForExprMutator.$(OBJEXT) \ 171 ControlStruct/driver_cfa_cpp-ExceptTranslate.$(OBJEXT) \ 172 GenPoly/driver_cfa_cpp-Box.$(OBJEXT) \ 173 GenPoly/driver_cfa_cpp-GenPoly.$(OBJEXT) \ 174 GenPoly/driver_cfa_cpp-ScrubTyVars.$(OBJEXT) \ 175 GenPoly/driver_cfa_cpp-Lvalue.$(OBJEXT) \ 176 GenPoly/driver_cfa_cpp-Specialize.$(OBJEXT) \ 177 GenPoly/driver_cfa_cpp-FindFunction.$(OBJEXT) \ 178 GenPoly/driver_cfa_cpp-InstantiateGeneric.$(OBJEXT) \ 179 InitTweak/driver_cfa_cpp-GenInit.$(OBJEXT) \ 180 InitTweak/driver_cfa_cpp-FixInit.$(OBJEXT) \ 181 InitTweak/driver_cfa_cpp-FixGlobalInit.$(OBJEXT) \ 182 InitTweak/driver_cfa_cpp-InitTweak.$(OBJEXT) \ 183 Parser/driver_cfa_cpp-parser.$(OBJEXT) \ 184 Parser/driver_cfa_cpp-lex.$(OBJEXT) \ 185 Parser/driver_cfa_cpp-TypedefTable.$(OBJEXT) \ 186 Parser/driver_cfa_cpp-ParseNode.$(OBJEXT) \ 187 Parser/driver_cfa_cpp-DeclarationNode.$(OBJEXT) \ 188 Parser/driver_cfa_cpp-ExpressionNode.$(OBJEXT) \ 189 Parser/driver_cfa_cpp-StatementNode.$(OBJEXT) \ 190 Parser/driver_cfa_cpp-InitializerNode.$(OBJEXT) \ 191 Parser/driver_cfa_cpp-TypeData.$(OBJEXT) \ 192 Parser/driver_cfa_cpp-LinkageSpec.$(OBJEXT) \ 193 Parser/driver_cfa_cpp-parserutility.$(OBJEXT) \ 194 ResolvExpr/driver_cfa_cpp-AlternativeFinder.$(OBJEXT) \ 195 ResolvExpr/driver_cfa_cpp-Alternative.$(OBJEXT) \ 196 ResolvExpr/driver_cfa_cpp-Unify.$(OBJEXT) \ 197 ResolvExpr/driver_cfa_cpp-PtrsAssignable.$(OBJEXT) \ 198 ResolvExpr/driver_cfa_cpp-CommonType.$(OBJEXT) \ 199 ResolvExpr/driver_cfa_cpp-ConversionCost.$(OBJEXT) \ 200 ResolvExpr/driver_cfa_cpp-CastCost.$(OBJEXT) \ 201 ResolvExpr/driver_cfa_cpp-PtrsCastable.$(OBJEXT) \ 202 ResolvExpr/driver_cfa_cpp-AdjustExprType.$(OBJEXT) \ 203 ResolvExpr/driver_cfa_cpp-AlternativePrinter.$(OBJEXT) \ 204 ResolvExpr/driver_cfa_cpp-Resolver.$(OBJEXT) \ 205 ResolvExpr/driver_cfa_cpp-ResolveTypeof.$(OBJEXT) \ 206 ResolvExpr/driver_cfa_cpp-RenameVars.$(OBJEXT) \ 207 ResolvExpr/driver_cfa_cpp-FindOpenVars.$(OBJEXT) \ 208 ResolvExpr/driver_cfa_cpp-PolyCost.$(OBJEXT) \ 209 ResolvExpr/driver_cfa_cpp-Occurs.$(OBJEXT) \ 210 ResolvExpr/driver_cfa_cpp-TypeEnvironment.$(OBJEXT) \ 211 ResolvExpr/driver_cfa_cpp-CurrentObject.$(OBJEXT) \ 212 ResolvExpr/driver_cfa_cpp-ExplodedActual.$(OBJEXT) \ 213 SymTab/driver_cfa_cpp-Indexer.$(OBJEXT) \ 214 SymTab/driver_cfa_cpp-Mangler.$(OBJEXT) \ 215 SymTab/driver_cfa_cpp-Validate.$(OBJEXT) \ 216 SymTab/driver_cfa_cpp-FixFunction.$(OBJEXT) \ 217 SymTab/driver_cfa_cpp-Autogen.$(OBJEXT) \ 218 SynTree/driver_cfa_cpp-Type.$(OBJEXT) \ 219 SynTree/driver_cfa_cpp-VoidType.$(OBJEXT) \ 220 SynTree/driver_cfa_cpp-BasicType.$(OBJEXT) \ 221 SynTree/driver_cfa_cpp-PointerType.$(OBJEXT) \ 222 SynTree/driver_cfa_cpp-ArrayType.$(OBJEXT) \ 223 SynTree/driver_cfa_cpp-ReferenceType.$(OBJEXT) \ 224 SynTree/driver_cfa_cpp-FunctionType.$(OBJEXT) \ 225 SynTree/driver_cfa_cpp-ReferenceToType.$(OBJEXT) \ 226 SynTree/driver_cfa_cpp-TupleType.$(OBJEXT) \ 227 SynTree/driver_cfa_cpp-TypeofType.$(OBJEXT) \ 228 SynTree/driver_cfa_cpp-AttrType.$(OBJEXT) \ 229 SynTree/driver_cfa_cpp-VarArgsType.$(OBJEXT) \ 230 SynTree/driver_cfa_cpp-ZeroOneType.$(OBJEXT) \ 231 SynTree/driver_cfa_cpp-Constant.$(OBJEXT) \ 232 SynTree/driver_cfa_cpp-Expression.$(OBJEXT) \ 233 SynTree/driver_cfa_cpp-TupleExpr.$(OBJEXT) \ 234 SynTree/driver_cfa_cpp-CommaExpr.$(OBJEXT) \ 235 SynTree/driver_cfa_cpp-TypeExpr.$(OBJEXT) \ 236 SynTree/driver_cfa_cpp-ApplicationExpr.$(OBJEXT) \ 237 SynTree/driver_cfa_cpp-AddressExpr.$(OBJEXT) \ 238 SynTree/driver_cfa_cpp-Statement.$(OBJEXT) \ 239 SynTree/driver_cfa_cpp-CompoundStmt.$(OBJEXT) \ 240 SynTree/driver_cfa_cpp-DeclStmt.$(OBJEXT) \ 241 SynTree/driver_cfa_cpp-Declaration.$(OBJEXT) \ 242 SynTree/driver_cfa_cpp-DeclarationWithType.$(OBJEXT) \ 243 SynTree/driver_cfa_cpp-ObjectDecl.$(OBJEXT) \ 244 SynTree/driver_cfa_cpp-FunctionDecl.$(OBJEXT) \ 245 SynTree/driver_cfa_cpp-AggregateDecl.$(OBJEXT) \ 246 SynTree/driver_cfa_cpp-NamedTypeDecl.$(OBJEXT) \ 247 SynTree/driver_cfa_cpp-TypeDecl.$(OBJEXT) \ 248 SynTree/driver_cfa_cpp-Initializer.$(OBJEXT) \ 249 SynTree/driver_cfa_cpp-Visitor.$(OBJEXT) \ 250 SynTree/driver_cfa_cpp-Mutator.$(OBJEXT) \ 251 SynTree/driver_cfa_cpp-TypeSubstitution.$(OBJEXT) \ 252 SynTree/driver_cfa_cpp-Attribute.$(OBJEXT) \ 253 SynTree/driver_cfa_cpp-VarExprReplacer.$(OBJEXT) \ 254 Tuples/driver_cfa_cpp-TupleAssignment.$(OBJEXT) \ 255 Tuples/driver_cfa_cpp-TupleExpansion.$(OBJEXT) \ 256 Tuples/driver_cfa_cpp-Explode.$(OBJEXT) \ 257 Virtual/driver_cfa_cpp-ExpandCasts.$(OBJEXT) 258 am_driver_cfa_cpp_OBJECTS = $(am__objects_1) 259 driver_cfa_cpp_OBJECTS = $(am_driver_cfa_cpp_OBJECTS) 260 driver_cfa_cpp_DEPENDENCIES = 261 driver_cfa_cpp_LINK = $(CXXLD) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) \ 262 $(driver_cfa_cpp_LDFLAGS) $(LDFLAGS) -o $@ 218 am__objects_1 = main.$(OBJEXT) MakeLibCfa.$(OBJEXT) \ 219 CompilationState.$(OBJEXT) CodeGen/Generate.$(OBJEXT) \ 220 CodeGen/CodeGenerator.$(OBJEXT) CodeGen/GenType.$(OBJEXT) \ 221 CodeGen/FixNames.$(OBJEXT) CodeGen/FixMain.$(OBJEXT) \ 222 CodeGen/OperatorTable.$(OBJEXT) CodeTools/DeclStats.$(OBJEXT) \ 223 CodeTools/TrackLoc.$(OBJEXT) Concurrency/Keywords.$(OBJEXT) \ 224 Concurrency/Waitfor.$(OBJEXT) Common/SemanticError.$(OBJEXT) \ 225 Common/UniqueName.$(OBJEXT) Common/DebugMalloc.$(OBJEXT) \ 226 Common/Assert.$(OBJEXT) Common/Heap.$(OBJEXT) \ 227 Common/Eval.$(OBJEXT) ControlStruct/LabelGenerator.$(OBJEXT) \ 228 ControlStruct/LabelFixer.$(OBJEXT) \ 229 ControlStruct/MLEMutator.$(OBJEXT) \ 230 ControlStruct/Mutate.$(OBJEXT) \ 231 ControlStruct/ForExprMutator.$(OBJEXT) \ 232 ControlStruct/ExceptTranslate.$(OBJEXT) GenPoly/Box.$(OBJEXT) \ 233 GenPoly/GenPoly.$(OBJEXT) GenPoly/ScrubTyVars.$(OBJEXT) \ 234 GenPoly/Lvalue.$(OBJEXT) GenPoly/Specialize.$(OBJEXT) \ 235 GenPoly/FindFunction.$(OBJEXT) \ 236 GenPoly/InstantiateGeneric.$(OBJEXT) \ 237 InitTweak/GenInit.$(OBJEXT) InitTweak/FixInit.$(OBJEXT) \ 238 InitTweak/FixGlobalInit.$(OBJEXT) \ 239 InitTweak/InitTweak.$(OBJEXT) Parser/parser.$(OBJEXT) \ 240 Parser/lex.$(OBJEXT) Parser/TypedefTable.$(OBJEXT) \ 241 Parser/ParseNode.$(OBJEXT) Parser/DeclarationNode.$(OBJEXT) \ 242 Parser/ExpressionNode.$(OBJEXT) Parser/StatementNode.$(OBJEXT) \ 243 Parser/InitializerNode.$(OBJEXT) Parser/TypeData.$(OBJEXT) \ 244 Parser/LinkageSpec.$(OBJEXT) Parser/parserutility.$(OBJEXT) \ 245 ResolvExpr/AlternativeFinder.$(OBJEXT) \ 246 ResolvExpr/Alternative.$(OBJEXT) ResolvExpr/Unify.$(OBJEXT) \ 247 ResolvExpr/PtrsAssignable.$(OBJEXT) \ 248 ResolvExpr/CommonType.$(OBJEXT) \ 249 ResolvExpr/ConversionCost.$(OBJEXT) \ 250 ResolvExpr/CastCost.$(OBJEXT) \ 251 ResolvExpr/PtrsCastable.$(OBJEXT) \ 252 ResolvExpr/AdjustExprType.$(OBJEXT) \ 253 ResolvExpr/AlternativePrinter.$(OBJEXT) \ 254 ResolvExpr/Resolver.$(OBJEXT) \ 255 ResolvExpr/ResolveTypeof.$(OBJEXT) \ 256 ResolvExpr/RenameVars.$(OBJEXT) \ 257 ResolvExpr/FindOpenVars.$(OBJEXT) \ 258 ResolvExpr/PolyCost.$(OBJEXT) ResolvExpr/Occurs.$(OBJEXT) \ 259 ResolvExpr/TypeEnvironment.$(OBJEXT) \ 260 ResolvExpr/CurrentObject.$(OBJEXT) \ 261 ResolvExpr/ExplodedActual.$(OBJEXT) SymTab/Indexer.$(OBJEXT) \ 262 SymTab/Mangler.$(OBJEXT) SymTab/ManglerCommon.$(OBJEXT) \ 263 SymTab/Validate.$(OBJEXT) SymTab/FixFunction.$(OBJEXT) \ 264 SymTab/Autogen.$(OBJEXT) SynTree/Type.$(OBJEXT) \ 265 SynTree/VoidType.$(OBJEXT) SynTree/BasicType.$(OBJEXT) \ 266 SynTree/PointerType.$(OBJEXT) SynTree/ArrayType.$(OBJEXT) \ 267 SynTree/ReferenceType.$(OBJEXT) SynTree/FunctionType.$(OBJEXT) \ 268 SynTree/ReferenceToType.$(OBJEXT) SynTree/TupleType.$(OBJEXT) \ 269 SynTree/TypeofType.$(OBJEXT) SynTree/AttrType.$(OBJEXT) \ 270 SynTree/VarArgsType.$(OBJEXT) SynTree/ZeroOneType.$(OBJEXT) \ 271 SynTree/Constant.$(OBJEXT) SynTree/Expression.$(OBJEXT) \ 272 SynTree/TupleExpr.$(OBJEXT) SynTree/CommaExpr.$(OBJEXT) \ 273 SynTree/TypeExpr.$(OBJEXT) SynTree/ApplicationExpr.$(OBJEXT) \ 274 SynTree/AddressExpr.$(OBJEXT) SynTree/Statement.$(OBJEXT) \ 275 SynTree/CompoundStmt.$(OBJEXT) SynTree/DeclStmt.$(OBJEXT) \ 276 SynTree/Declaration.$(OBJEXT) \ 277 SynTree/DeclarationWithType.$(OBJEXT) \ 278 SynTree/ObjectDecl.$(OBJEXT) SynTree/FunctionDecl.$(OBJEXT) \ 279 SynTree/AggregateDecl.$(OBJEXT) \ 280 SynTree/NamedTypeDecl.$(OBJEXT) SynTree/TypeDecl.$(OBJEXT) \ 281 SynTree/Initializer.$(OBJEXT) \ 282 SynTree/TypeSubstitution.$(OBJEXT) SynTree/Attribute.$(OBJEXT) \ 283 SynTree/DeclReplacer.$(OBJEXT) \ 284 Tuples/TupleAssignment.$(OBJEXT) \ 285 Tuples/TupleExpansion.$(OBJEXT) Tuples/Explode.$(OBJEXT) \ 286 Validate/HandleAttributes.$(OBJEXT) \ 287 Virtual/ExpandCasts.$(OBJEXT) 288 am____driver_cfa_cpp_OBJECTS = $(am__objects_1) 289 ___driver_cfa_cpp_OBJECTS = $(am____driver_cfa_cpp_OBJECTS) 290 ___driver_cfa_cpp_DEPENDENCIES = 291 am_demangler_OBJECTS = SymTab/demangler.$(OBJEXT) 292 demangler_OBJECTS = $(am_demangler_OBJECTS) 293 demangler_DEPENDENCIES = libdemangle.a 263 294 AM_V_P = $(am__v_P_@AM_V@) 264 295 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) … … 277 308 am__depfiles_maybe = depfiles 278 309 am__mv = mv -f 279 AM_V_lt = $(am__v_lt_@AM_V@)280 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)281 am__v_lt_0 = --silent282 am__v_lt_1 =283 310 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 284 311 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) … … 294 321 am__v_CXXLD_0 = @echo " CXXLD " $@; 295 322 am__v_CXXLD_1 = 296 @MAINTAINER_MODE_FALSE@am__skiplex = test -f $@ ||297 323 LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) 298 324 AM_V_LEX = $(am__v_LEX_@AM_V@) … … 301 327 am__v_LEX_1 = 302 328 YLWRAP = $(top_srcdir)/automake/ylwrap 303 @MAINTAINER_MODE_FALSE@am__skipyacc = test -f $@ ||304 329 am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ 305 330 -e s/c++$$/h++/ -e s/c$$/h/ … … 321 346 am__v_CCLD_0 = @echo " CCLD " $@; 322 347 am__v_CCLD_1 = 323 SOURCES = $(driver_cfa_cpp_SOURCES) 324 DIST_SOURCES = $(driver_cfa_cpp_SOURCES) 348 SOURCES = $(libdemangle_a_SOURCES) $(___driver_cfa_cpp_SOURCES) \ 349 $(demangler_SOURCES) 350 DIST_SOURCES = $(libdemangle_a_SOURCES) $(___driver_cfa_cpp_SOURCES) \ 351 $(demangler_SOURCES) 325 352 am__can_run_installinfo = \ 326 353 case $$AM_UPDATE_INFO_DIR in \ … … 328 355 *) (install-info --version) >/dev/null 2>&1;; \ 329 356 esac 330 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 357 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ 358 $(LISP)config.h.in 331 359 # Read a list of newline-separated strings from the standard input, 332 360 # and print each of them once, without duplicates. Input order is … … 354 382 $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk \ 355 383 $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk \ 356 $(srcdir)/Tuples/module.mk $(srcdir)/Virtual/module.mk \ 357 $(top_srcdir)/automake/depcomp $(top_srcdir)/automake/ylwrap \ 358 Parser/lex.cc Parser/parser.cc Parser/parser.hh 384 $(srcdir)/Tuples/module.mk $(srcdir)/Validate/module.mk \ 385 $(srcdir)/Virtual/module.mk $(top_srcdir)/automake/depcomp \ 386 $(top_srcdir)/automake/ylwrap Parser/lex.cc Parser/parser.cc \ 387 Parser/parser.hh 359 388 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 360 389 ACLOCAL = @ACLOCAL@ … … 367 396 AWK = @AWK@ 368 397 BACKEND_CC = @BACKEND_CC@ 398 BUILD_IN_TREE_FLAGS = @BUILD_IN_TREE_FLAGS@ 369 399 CC = @CC@ 370 400 CCAS = @CCAS@ … … 372 402 CCASFLAGS = @CCASFLAGS@ 373 403 CCDEPMODE = @CCDEPMODE@ 404 CFACC = @CFACC@ 405 CFACPP = @CFACPP@ 374 406 CFA_BACKEND_CC = @CFA_BACKEND_CC@ 375 407 CFA_BINDIR = @CFA_BINDIR@ … … 388 420 DEFS = @DEFS@ 389 421 DEPDIR = @DEPDIR@ 422 DRIVER_DIR = @DRIVER_DIR@ 390 423 ECHO_C = @ECHO_C@ 391 424 ECHO_N = @ECHO_N@ … … 394 427 EXEEXT = @EXEEXT@ 395 428 GREP = @GREP@ 429 HOST_FLAGS = @HOST_FLAGS@ 396 430 INSTALL = @INSTALL@ 397 431 INSTALL_DATA = @INSTALL_DATA@ … … 403 437 LEXLIB = @LEXLIB@ 404 438 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ 439 LIBCFA_TARGET_DIRS = @LIBCFA_TARGET_DIRS@ 440 LIBCFA_TARGET_MAKEFILES = @LIBCFA_TARGET_MAKEFILES@ 405 441 LIBOBJS = @LIBOBJS@ 406 442 LIBS = @LIBS@ 407 443 LTLIBOBJS = @LTLIBOBJS@ 408 MACHINE_TYPE = @MACHINE_TYPE@409 MAINT = @MAINT@410 444 MAKEINFO = @MAKEINFO@ 411 445 MKDIR_P = @MKDIR_P@ … … 423 457 SHELL = @SHELL@ 424 458 STRIP = @STRIP@ 459 TARGET_HOSTS = @TARGET_HOSTS@ 425 460 VERSION = @VERSION@ 426 461 YACC = @YACC@ … … 480 515 481 516 # create object files in directory with source files 482 AUTOMAKE_OPTIONS = subdir-objects483 SRC = main.cc MakeLibCfa.cc Co deGen/Generate.cc \517 AUTOMAKE_OPTIONS = foreign subdir-objects 518 SRC = main.cc MakeLibCfa.cc CompilationState.cc CodeGen/Generate.cc \ 484 519 CodeGen/CodeGenerator.cc CodeGen/GenType.cc \ 485 520 CodeGen/FixNames.cc CodeGen/FixMain.cc \ … … 488 523 Concurrency/Waitfor.cc Common/SemanticError.cc \ 489 524 Common/UniqueName.cc Common/DebugMalloc.cc Common/Assert.cc \ 490 Co ntrolStruct/LabelGenerator.cc ControlStruct/LabelFixer.cc \491 ControlStruct/ MLEMutator.cc ControlStruct/Mutate.cc \492 ControlStruct/ ForExprMutator.cc \525 Common/Heap.cc Common/Eval.cc ControlStruct/LabelGenerator.cc \ 526 ControlStruct/LabelFixer.cc ControlStruct/MLEMutator.cc \ 527 ControlStruct/Mutate.cc ControlStruct/ForExprMutator.cc \ 493 528 ControlStruct/ExceptTranslate.cc GenPoly/Box.cc \ 494 529 GenPoly/GenPoly.cc GenPoly/ScrubTyVars.cc GenPoly/Lvalue.cc \ … … 511 546 ResolvExpr/Occurs.cc ResolvExpr/TypeEnvironment.cc \ 512 547 ResolvExpr/CurrentObject.cc ResolvExpr/ExplodedActual.cc \ 513 SymTab/Indexer.cc SymTab/Mangler.cc SymTab/ Validate.cc \514 SymTab/ FixFunction.cc SymTab/Autogen.cc SynTree/Type.cc \515 SynTree/ VoidType.cc SynTree/BasicType.cc \548 SymTab/Indexer.cc SymTab/Mangler.cc SymTab/ManglerCommon.cc \ 549 SymTab/Validate.cc SymTab/FixFunction.cc SymTab/Autogen.cc \ 550 SynTree/Type.cc SynTree/VoidType.cc SynTree/BasicType.cc \ 516 551 SynTree/PointerType.cc SynTree/ArrayType.cc \ 517 552 SynTree/ReferenceType.cc SynTree/FunctionType.cc \ … … 527 562 SynTree/FunctionDecl.cc SynTree/AggregateDecl.cc \ 528 563 SynTree/NamedTypeDecl.cc SynTree/TypeDecl.cc \ 529 SynTree/Initializer.cc SynTree/ Visitor.cc SynTree/Mutator.cc \530 SynTree/ TypeSubstitution.cc SynTree/Attribute.cc \531 SynTree/VarExprReplacer.cc Tuples/TupleAssignment.cc \532 Tuples/ TupleExpansion.cc Tuples/Explode.cc \564 SynTree/Initializer.cc SynTree/TypeSubstitution.cc \ 565 SynTree/Attribute.cc SynTree/DeclReplacer.cc \ 566 Tuples/TupleAssignment.cc Tuples/TupleExpansion.cc \ 567 Tuples/Explode.cc Validate/HandleAttributes.cc \ 533 568 Virtual/ExpandCasts.cc 534 MAINTAINERCLEANFILES = Parser/parser.output ${libdir}/${notdir \535 ${cfa_cpplib_PROGRAMS}} 569 MAINTAINERCLEANFILES = ${libdir}/${notdir ${cfa_cpplib_PROGRAMS}} 570 MOSTLYCLEANFILES = Parser/parser.hh Parser/parser.output 536 571 BUILT_SOURCES = Parser/parser.hh 537 572 AM_YFLAGS = -d -t -v … … 540 575 541 576 # put into lib for now 542 cfa_cpplibdir = ${CFA_LIBDIR} 543 driver_cfa_cpp_SOURCES = ${SRC} 544 driver_cfa_cpp_LDADD = -ldl # yywrap 545 driver_cfa_cpp_CXXFLAGS = -Wno-deprecated -Wall -Wextra -DDEBUG_ALL -I${abs_top_srcdir}/src/include -DYY_NO_INPUT -O2 -g -std=c++14 546 driver_cfa_cpp_LDFLAGS = -Xlinker -export-dynamic 577 cfa_cpplibdir = $(CFA_LIBDIR) 578 ___driver_cfa_cpp_SOURCES = $(SRC) 579 ___driver_cfa_cpp_LDADD = -ldl # yywrap 580 AM_CXXFLAGS = @HOST_FLAGS@ -Wno-deprecated -Wall -Wextra -DDEBUG_ALL -I./Parser -I$(srcdir)/Parser -I$(srcdir)/include -DYY_NO_INPUT -O2 -g -std=c++14 581 AM_LDFLAGS = @HOST_FLAGS@ -Xlinker -export-dynamic 582 demangler_SOURCES = SymTab/demangler.cc 583 demangler_LDADD = libdemangle.a # yywrap 584 noinst_LIBRARIES = libdemangle.a 585 libdemangle_a_SOURCES = SymTab/Demangle.cc SymTab/ManglerCommon.cc \ 586 SynTree/Type.cc \ 587 SynTree/VoidType.cc \ 588 SynTree/BasicType.cc \ 589 SynTree/PointerType.cc \ 590 SynTree/ArrayType.cc \ 591 SynTree/ReferenceType.cc \ 592 SynTree/FunctionType.cc \ 593 SynTree/ReferenceToType.cc \ 594 SynTree/TupleType.cc \ 595 SynTree/TypeofType.cc \ 596 SynTree/AttrType.cc \ 597 SynTree/VarArgsType.cc \ 598 SynTree/ZeroOneType.cc \ 599 SynTree/Constant.cc \ 600 SynTree/Expression.cc \ 601 SynTree/TupleExpr.cc \ 602 SynTree/CommaExpr.cc \ 603 SynTree/TypeExpr.cc \ 604 SynTree/ApplicationExpr.cc \ 605 SynTree/AddressExpr.cc \ 606 SynTree/Statement.cc \ 607 SynTree/CompoundStmt.cc \ 608 SynTree/DeclStmt.cc \ 609 SynTree/Declaration.cc \ 610 SynTree/DeclarationWithType.cc \ 611 SynTree/ObjectDecl.cc \ 612 SynTree/FunctionDecl.cc \ 613 SynTree/AggregateDecl.cc \ 614 SynTree/NamedTypeDecl.cc \ 615 SynTree/TypeDecl.cc \ 616 SynTree/Initializer.cc \ 617 SynTree/TypeSubstitution.cc \ 618 SynTree/Attribute.cc \ 619 SynTree/DeclReplacer.cc \ 620 CompilationState.cc \ 621 CodeGen/CodeGenerator.cc \ 622 CodeGen/FixMain.cc \ 623 CodeGen/GenType.cc \ 624 CodeGen/OperatorTable.cc \ 625 Common/Assert.cc \ 626 Common/Eval.cc \ 627 Common/SemanticError.cc \ 628 Common/UniqueName.cc \ 629 Concurrency/Keywords.cc \ 630 ControlStruct/ForExprMutator.cc \ 631 ControlStruct/LabelFixer.cc \ 632 ControlStruct/LabelGenerator.cc \ 633 ControlStruct/MLEMutator.cc \ 634 ControlStruct/Mutate.cc \ 635 GenPoly/GenPoly.cc \ 636 GenPoly/Lvalue.cc \ 637 InitTweak/GenInit.cc \ 638 InitTweak/InitTweak.cc \ 639 Parser/LinkageSpec.cc \ 640 ResolvExpr/AdjustExprType.cc \ 641 ResolvExpr/Alternative.cc \ 642 ResolvExpr/AlternativeFinder.cc \ 643 ResolvExpr/ExplodedActual.cc \ 644 ResolvExpr/CastCost.cc \ 645 ResolvExpr/CommonType.cc \ 646 ResolvExpr/ConversionCost.cc \ 647 ResolvExpr/CurrentObject.cc \ 648 ResolvExpr/FindOpenVars.cc \ 649 ResolvExpr/Occurs.cc \ 650 ResolvExpr/PolyCost.cc \ 651 ResolvExpr/PtrsAssignable.cc \ 652 ResolvExpr/PtrsCastable.cc \ 653 ResolvExpr/RenameVars.cc \ 654 ResolvExpr/Resolver.cc \ 655 ResolvExpr/ResolveTypeof.cc \ 656 ResolvExpr/TypeEnvironment.cc \ 657 ResolvExpr/Unify.cc \ 658 SymTab/Autogen.cc \ 659 SymTab/FixFunction.cc \ 660 SymTab/Indexer.cc \ 661 SymTab/Mangler.cc \ 662 SymTab/Validate.cc \ 663 Tuples/Explode.cc \ 664 Tuples/TupleAssignment.cc \ 665 Tuples/TupleExpansion.cc \ 666 Validate/HandleAttributes.cc 667 547 668 all: $(BUILT_SOURCES) 548 669 $(MAKE) $(AM_MAKEFLAGS) all-am … … 550 671 .SUFFIXES: 551 672 .SUFFIXES: .cc .ll .o .obj .yy 552 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/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 $(srcdir)/Virtual/module.mk $(am__configure_deps)673 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/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 $(srcdir)/Validate/module.mk $(srcdir)/Virtual/module.mk $(am__configure_deps) 553 674 @for dep in $?; do \ 554 675 case '$(am__configure_deps)' in \ … … 570 691 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 571 692 esac; 572 $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/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 $(srcdir)/V irtual/module.mk $(am__empty):693 $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/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 $(srcdir)/Validate/module.mk $(srcdir)/Virtual/module.mk $(am__empty): 573 694 574 695 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 575 696 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 576 697 577 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@$(am__configure_deps)698 $(top_srcdir)/configure: $(am__configure_deps) 578 699 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 579 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@$(am__aclocal_m4_deps)700 $(ACLOCAL_M4): $(am__aclocal_m4_deps) 580 701 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 581 702 $(am__aclocal_m4_deps): 703 704 clean-noinstLIBRARIES: 705 -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) 706 SymTab/$(am__dirstamp): 707 @$(MKDIR_P) SymTab 708 @: > SymTab/$(am__dirstamp) 709 SymTab/$(DEPDIR)/$(am__dirstamp): 710 @$(MKDIR_P) SymTab/$(DEPDIR) 711 @: > SymTab/$(DEPDIR)/$(am__dirstamp) 712 SymTab/Demangle.$(OBJEXT): SymTab/$(am__dirstamp) \ 713 SymTab/$(DEPDIR)/$(am__dirstamp) 714 SymTab/ManglerCommon.$(OBJEXT): SymTab/$(am__dirstamp) \ 715 SymTab/$(DEPDIR)/$(am__dirstamp) 716 SynTree/$(am__dirstamp): 717 @$(MKDIR_P) SynTree 718 @: > SynTree/$(am__dirstamp) 719 SynTree/$(DEPDIR)/$(am__dirstamp): 720 @$(MKDIR_P) SynTree/$(DEPDIR) 721 @: > SynTree/$(DEPDIR)/$(am__dirstamp) 722 SynTree/Type.$(OBJEXT): SynTree/$(am__dirstamp) \ 723 SynTree/$(DEPDIR)/$(am__dirstamp) 724 SynTree/VoidType.$(OBJEXT): SynTree/$(am__dirstamp) \ 725 SynTree/$(DEPDIR)/$(am__dirstamp) 726 SynTree/BasicType.$(OBJEXT): SynTree/$(am__dirstamp) \ 727 SynTree/$(DEPDIR)/$(am__dirstamp) 728 SynTree/PointerType.$(OBJEXT): SynTree/$(am__dirstamp) \ 729 SynTree/$(DEPDIR)/$(am__dirstamp) 730 SynTree/ArrayType.$(OBJEXT): SynTree/$(am__dirstamp) \ 731 SynTree/$(DEPDIR)/$(am__dirstamp) 732 SynTree/ReferenceType.$(OBJEXT): SynTree/$(am__dirstamp) \ 733 SynTree/$(DEPDIR)/$(am__dirstamp) 734 SynTree/FunctionType.$(OBJEXT): SynTree/$(am__dirstamp) \ 735 SynTree/$(DEPDIR)/$(am__dirstamp) 736 SynTree/ReferenceToType.$(OBJEXT): SynTree/$(am__dirstamp) \ 737 SynTree/$(DEPDIR)/$(am__dirstamp) 738 SynTree/TupleType.$(OBJEXT): SynTree/$(am__dirstamp) \ 739 SynTree/$(DEPDIR)/$(am__dirstamp) 740 SynTree/TypeofType.$(OBJEXT): SynTree/$(am__dirstamp) \ 741 SynTree/$(DEPDIR)/$(am__dirstamp) 742 SynTree/AttrType.$(OBJEXT): SynTree/$(am__dirstamp) \ 743 SynTree/$(DEPDIR)/$(am__dirstamp) 744 SynTree/VarArgsType.$(OBJEXT): SynTree/$(am__dirstamp) \ 745 SynTree/$(DEPDIR)/$(am__dirstamp) 746 SynTree/ZeroOneType.$(OBJEXT): SynTree/$(am__dirstamp) \ 747 SynTree/$(DEPDIR)/$(am__dirstamp) 748 SynTree/Constant.$(OBJEXT): SynTree/$(am__dirstamp) \ 749 SynTree/$(DEPDIR)/$(am__dirstamp) 750 SynTree/Expression.$(OBJEXT): SynTree/$(am__dirstamp) \ 751 SynTree/$(DEPDIR)/$(am__dirstamp) 752 SynTree/TupleExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 753 SynTree/$(DEPDIR)/$(am__dirstamp) 754 SynTree/CommaExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 755 SynTree/$(DEPDIR)/$(am__dirstamp) 756 SynTree/TypeExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 757 SynTree/$(DEPDIR)/$(am__dirstamp) 758 SynTree/ApplicationExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 759 SynTree/$(DEPDIR)/$(am__dirstamp) 760 SynTree/AddressExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 761 SynTree/$(DEPDIR)/$(am__dirstamp) 762 SynTree/Statement.$(OBJEXT): SynTree/$(am__dirstamp) \ 763 SynTree/$(DEPDIR)/$(am__dirstamp) 764 SynTree/CompoundStmt.$(OBJEXT): SynTree/$(am__dirstamp) \ 765 SynTree/$(DEPDIR)/$(am__dirstamp) 766 SynTree/DeclStmt.$(OBJEXT): SynTree/$(am__dirstamp) \ 767 SynTree/$(DEPDIR)/$(am__dirstamp) 768 SynTree/Declaration.$(OBJEXT): SynTree/$(am__dirstamp) \ 769 SynTree/$(DEPDIR)/$(am__dirstamp) 770 SynTree/DeclarationWithType.$(OBJEXT): SynTree/$(am__dirstamp) \ 771 SynTree/$(DEPDIR)/$(am__dirstamp) 772 SynTree/ObjectDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 773 SynTree/$(DEPDIR)/$(am__dirstamp) 774 SynTree/FunctionDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 775 SynTree/$(DEPDIR)/$(am__dirstamp) 776 SynTree/AggregateDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 777 SynTree/$(DEPDIR)/$(am__dirstamp) 778 SynTree/NamedTypeDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 779 SynTree/$(DEPDIR)/$(am__dirstamp) 780 SynTree/TypeDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 781 SynTree/$(DEPDIR)/$(am__dirstamp) 782 SynTree/Initializer.$(OBJEXT): SynTree/$(am__dirstamp) \ 783 SynTree/$(DEPDIR)/$(am__dirstamp) 784 SynTree/TypeSubstitution.$(OBJEXT): SynTree/$(am__dirstamp) \ 785 SynTree/$(DEPDIR)/$(am__dirstamp) 786 SynTree/Attribute.$(OBJEXT): SynTree/$(am__dirstamp) \ 787 SynTree/$(DEPDIR)/$(am__dirstamp) 788 SynTree/DeclReplacer.$(OBJEXT): SynTree/$(am__dirstamp) \ 789 SynTree/$(DEPDIR)/$(am__dirstamp) 790 CodeGen/$(am__dirstamp): 791 @$(MKDIR_P) CodeGen 792 @: > CodeGen/$(am__dirstamp) 793 CodeGen/$(DEPDIR)/$(am__dirstamp): 794 @$(MKDIR_P) CodeGen/$(DEPDIR) 795 @: > CodeGen/$(DEPDIR)/$(am__dirstamp) 796 CodeGen/CodeGenerator.$(OBJEXT): CodeGen/$(am__dirstamp) \ 797 CodeGen/$(DEPDIR)/$(am__dirstamp) 798 CodeGen/FixMain.$(OBJEXT): CodeGen/$(am__dirstamp) \ 799 CodeGen/$(DEPDIR)/$(am__dirstamp) 800 CodeGen/GenType.$(OBJEXT): CodeGen/$(am__dirstamp) \ 801 CodeGen/$(DEPDIR)/$(am__dirstamp) 802 CodeGen/OperatorTable.$(OBJEXT): CodeGen/$(am__dirstamp) \ 803 CodeGen/$(DEPDIR)/$(am__dirstamp) 804 Common/$(am__dirstamp): 805 @$(MKDIR_P) Common 806 @: > Common/$(am__dirstamp) 807 Common/$(DEPDIR)/$(am__dirstamp): 808 @$(MKDIR_P) Common/$(DEPDIR) 809 @: > Common/$(DEPDIR)/$(am__dirstamp) 810 Common/Assert.$(OBJEXT): Common/$(am__dirstamp) \ 811 Common/$(DEPDIR)/$(am__dirstamp) 812 Common/Eval.$(OBJEXT): Common/$(am__dirstamp) \ 813 Common/$(DEPDIR)/$(am__dirstamp) 814 Common/SemanticError.$(OBJEXT): Common/$(am__dirstamp) \ 815 Common/$(DEPDIR)/$(am__dirstamp) 816 Common/UniqueName.$(OBJEXT): Common/$(am__dirstamp) \ 817 Common/$(DEPDIR)/$(am__dirstamp) 818 Concurrency/$(am__dirstamp): 819 @$(MKDIR_P) Concurrency 820 @: > Concurrency/$(am__dirstamp) 821 Concurrency/$(DEPDIR)/$(am__dirstamp): 822 @$(MKDIR_P) Concurrency/$(DEPDIR) 823 @: > Concurrency/$(DEPDIR)/$(am__dirstamp) 824 Concurrency/Keywords.$(OBJEXT): Concurrency/$(am__dirstamp) \ 825 Concurrency/$(DEPDIR)/$(am__dirstamp) 826 ControlStruct/$(am__dirstamp): 827 @$(MKDIR_P) ControlStruct 828 @: > ControlStruct/$(am__dirstamp) 829 ControlStruct/$(DEPDIR)/$(am__dirstamp): 830 @$(MKDIR_P) ControlStruct/$(DEPDIR) 831 @: > ControlStruct/$(DEPDIR)/$(am__dirstamp) 832 ControlStruct/ForExprMutator.$(OBJEXT): ControlStruct/$(am__dirstamp) \ 833 ControlStruct/$(DEPDIR)/$(am__dirstamp) 834 ControlStruct/LabelFixer.$(OBJEXT): ControlStruct/$(am__dirstamp) \ 835 ControlStruct/$(DEPDIR)/$(am__dirstamp) 836 ControlStruct/LabelGenerator.$(OBJEXT): ControlStruct/$(am__dirstamp) \ 837 ControlStruct/$(DEPDIR)/$(am__dirstamp) 838 ControlStruct/MLEMutator.$(OBJEXT): ControlStruct/$(am__dirstamp) \ 839 ControlStruct/$(DEPDIR)/$(am__dirstamp) 840 ControlStruct/Mutate.$(OBJEXT): ControlStruct/$(am__dirstamp) \ 841 ControlStruct/$(DEPDIR)/$(am__dirstamp) 842 GenPoly/$(am__dirstamp): 843 @$(MKDIR_P) GenPoly 844 @: > GenPoly/$(am__dirstamp) 845 GenPoly/$(DEPDIR)/$(am__dirstamp): 846 @$(MKDIR_P) GenPoly/$(DEPDIR) 847 @: > GenPoly/$(DEPDIR)/$(am__dirstamp) 848 GenPoly/GenPoly.$(OBJEXT): GenPoly/$(am__dirstamp) \ 849 GenPoly/$(DEPDIR)/$(am__dirstamp) 850 GenPoly/Lvalue.$(OBJEXT): GenPoly/$(am__dirstamp) \ 851 GenPoly/$(DEPDIR)/$(am__dirstamp) 852 InitTweak/$(am__dirstamp): 853 @$(MKDIR_P) InitTweak 854 @: > InitTweak/$(am__dirstamp) 855 InitTweak/$(DEPDIR)/$(am__dirstamp): 856 @$(MKDIR_P) InitTweak/$(DEPDIR) 857 @: > InitTweak/$(DEPDIR)/$(am__dirstamp) 858 InitTweak/GenInit.$(OBJEXT): InitTweak/$(am__dirstamp) \ 859 InitTweak/$(DEPDIR)/$(am__dirstamp) 860 InitTweak/InitTweak.$(OBJEXT): InitTweak/$(am__dirstamp) \ 861 InitTweak/$(DEPDIR)/$(am__dirstamp) 862 Parser/$(am__dirstamp): 863 @$(MKDIR_P) Parser 864 @: > Parser/$(am__dirstamp) 865 Parser/$(DEPDIR)/$(am__dirstamp): 866 @$(MKDIR_P) Parser/$(DEPDIR) 867 @: > Parser/$(DEPDIR)/$(am__dirstamp) 868 Parser/LinkageSpec.$(OBJEXT): Parser/$(am__dirstamp) \ 869 Parser/$(DEPDIR)/$(am__dirstamp) 870 ResolvExpr/$(am__dirstamp): 871 @$(MKDIR_P) ResolvExpr 872 @: > ResolvExpr/$(am__dirstamp) 873 ResolvExpr/$(DEPDIR)/$(am__dirstamp): 874 @$(MKDIR_P) ResolvExpr/$(DEPDIR) 875 @: > ResolvExpr/$(DEPDIR)/$(am__dirstamp) 876 ResolvExpr/AdjustExprType.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 877 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 878 ResolvExpr/Alternative.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 879 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 880 ResolvExpr/AlternativeFinder.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 881 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 882 ResolvExpr/ExplodedActual.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 883 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 884 ResolvExpr/CastCost.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 885 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 886 ResolvExpr/CommonType.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 887 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 888 ResolvExpr/ConversionCost.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 889 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 890 ResolvExpr/CurrentObject.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 891 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 892 ResolvExpr/FindOpenVars.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 893 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 894 ResolvExpr/Occurs.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 895 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 896 ResolvExpr/PolyCost.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 897 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 898 ResolvExpr/PtrsAssignable.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 899 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 900 ResolvExpr/PtrsCastable.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 901 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 902 ResolvExpr/RenameVars.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 903 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 904 ResolvExpr/Resolver.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 905 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 906 ResolvExpr/ResolveTypeof.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 907 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 908 ResolvExpr/TypeEnvironment.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 909 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 910 ResolvExpr/Unify.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 911 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 912 SymTab/Autogen.$(OBJEXT): SymTab/$(am__dirstamp) \ 913 SymTab/$(DEPDIR)/$(am__dirstamp) 914 SymTab/FixFunction.$(OBJEXT): SymTab/$(am__dirstamp) \ 915 SymTab/$(DEPDIR)/$(am__dirstamp) 916 SymTab/Indexer.$(OBJEXT): SymTab/$(am__dirstamp) \ 917 SymTab/$(DEPDIR)/$(am__dirstamp) 918 SymTab/Mangler.$(OBJEXT): SymTab/$(am__dirstamp) \ 919 SymTab/$(DEPDIR)/$(am__dirstamp) 920 SymTab/Validate.$(OBJEXT): SymTab/$(am__dirstamp) \ 921 SymTab/$(DEPDIR)/$(am__dirstamp) 922 Tuples/$(am__dirstamp): 923 @$(MKDIR_P) Tuples 924 @: > Tuples/$(am__dirstamp) 925 Tuples/$(DEPDIR)/$(am__dirstamp): 926 @$(MKDIR_P) Tuples/$(DEPDIR) 927 @: > Tuples/$(DEPDIR)/$(am__dirstamp) 928 Tuples/Explode.$(OBJEXT): Tuples/$(am__dirstamp) \ 929 Tuples/$(DEPDIR)/$(am__dirstamp) 930 Tuples/TupleAssignment.$(OBJEXT): Tuples/$(am__dirstamp) \ 931 Tuples/$(DEPDIR)/$(am__dirstamp) 932 Tuples/TupleExpansion.$(OBJEXT): Tuples/$(am__dirstamp) \ 933 Tuples/$(DEPDIR)/$(am__dirstamp) 934 Validate/$(am__dirstamp): 935 @$(MKDIR_P) Validate 936 @: > Validate/$(am__dirstamp) 937 Validate/$(DEPDIR)/$(am__dirstamp): 938 @$(MKDIR_P) Validate/$(DEPDIR) 939 @: > Validate/$(DEPDIR)/$(am__dirstamp) 940 Validate/HandleAttributes.$(OBJEXT): Validate/$(am__dirstamp) \ 941 Validate/$(DEPDIR)/$(am__dirstamp) 942 943 libdemangle.a: $(libdemangle_a_OBJECTS) $(libdemangle_a_DEPENDENCIES) $(EXTRA_libdemangle_a_DEPENDENCIES) 944 $(AM_V_at)-rm -f libdemangle.a 945 $(AM_V_AR)$(libdemangle_a_AR) libdemangle.a $(libdemangle_a_OBJECTS) $(libdemangle_a_LIBADD) 946 $(AM_V_at)$(RANLIB) libdemangle.a 582 947 install-cfa_cpplibPROGRAMS: $(cfa_cpplib_PROGRAMS) 583 948 @$(NORMAL_INSTALL) … … 622 987 clean-cfa_cpplibPROGRAMS: 623 988 -test -z "$(cfa_cpplib_PROGRAMS)" || rm -f $(cfa_cpplib_PROGRAMS) 624 CodeGen/$(am__dirstamp): 625 @$(MKDIR_P) CodeGen 626 @: > CodeGen/$(am__dirstamp) 627 CodeGen/$(DEPDIR)/$(am__dirstamp): 628 @$(MKDIR_P) CodeGen/$(DEPDIR) 629 @: > CodeGen/$(DEPDIR)/$(am__dirstamp) 630 CodeGen/driver_cfa_cpp-Generate.$(OBJEXT): CodeGen/$(am__dirstamp) \ 989 CodeGen/Generate.$(OBJEXT): CodeGen/$(am__dirstamp) \ 631 990 CodeGen/$(DEPDIR)/$(am__dirstamp) 632 CodeGen/driver_cfa_cpp-CodeGenerator.$(OBJEXT): \ 633 CodeGen/$(am__dirstamp) CodeGen/$(DEPDIR)/$(am__dirstamp) 634 CodeGen/driver_cfa_cpp-GenType.$(OBJEXT): CodeGen/$(am__dirstamp) \ 991 CodeGen/FixNames.$(OBJEXT): CodeGen/$(am__dirstamp) \ 635 992 CodeGen/$(DEPDIR)/$(am__dirstamp) 636 CodeGen/driver_cfa_cpp-FixNames.$(OBJEXT): CodeGen/$(am__dirstamp) \637 CodeGen/$(DEPDIR)/$(am__dirstamp)638 CodeGen/driver_cfa_cpp-FixMain.$(OBJEXT): CodeGen/$(am__dirstamp) \639 CodeGen/$(DEPDIR)/$(am__dirstamp)640 CodeGen/driver_cfa_cpp-OperatorTable.$(OBJEXT): \641 CodeGen/$(am__dirstamp) CodeGen/$(DEPDIR)/$(am__dirstamp)642 993 CodeTools/$(am__dirstamp): 643 994 @$(MKDIR_P) CodeTools … … 646 997 @$(MKDIR_P) CodeTools/$(DEPDIR) 647 998 @: > CodeTools/$(DEPDIR)/$(am__dirstamp) 648 CodeTools/driver_cfa_cpp-DeclStats.$(OBJEXT): \ 649 CodeTools/$(am__dirstamp) CodeTools/$(DEPDIR)/$(am__dirstamp) 650 CodeTools/driver_cfa_cpp-TrackLoc.$(OBJEXT): \ 651 CodeTools/$(am__dirstamp) CodeTools/$(DEPDIR)/$(am__dirstamp) 652 Concurrency/$(am__dirstamp): 653 @$(MKDIR_P) Concurrency 654 @: > Concurrency/$(am__dirstamp) 655 Concurrency/$(DEPDIR)/$(am__dirstamp): 656 @$(MKDIR_P) Concurrency/$(DEPDIR) 657 @: > Concurrency/$(DEPDIR)/$(am__dirstamp) 658 Concurrency/driver_cfa_cpp-Keywords.$(OBJEXT): \ 659 Concurrency/$(am__dirstamp) \ 999 CodeTools/DeclStats.$(OBJEXT): CodeTools/$(am__dirstamp) \ 1000 CodeTools/$(DEPDIR)/$(am__dirstamp) 1001 CodeTools/TrackLoc.$(OBJEXT): CodeTools/$(am__dirstamp) \ 1002 CodeTools/$(DEPDIR)/$(am__dirstamp) 1003 Concurrency/Waitfor.$(OBJEXT): Concurrency/$(am__dirstamp) \ 660 1004 Concurrency/$(DEPDIR)/$(am__dirstamp) 661 Concurrency/driver_cfa_cpp-Waitfor.$(OBJEXT): \ 662 Concurrency/$(am__dirstamp) \ 663 Concurrency/$(DEPDIR)/$(am__dirstamp) 664 Common/$(am__dirstamp): 665 @$(MKDIR_P) Common 666 @: > Common/$(am__dirstamp) 667 Common/$(DEPDIR)/$(am__dirstamp): 668 @$(MKDIR_P) Common/$(DEPDIR) 669 @: > Common/$(DEPDIR)/$(am__dirstamp) 670 Common/driver_cfa_cpp-SemanticError.$(OBJEXT): Common/$(am__dirstamp) \ 1005 Common/DebugMalloc.$(OBJEXT): Common/$(am__dirstamp) \ 671 1006 Common/$(DEPDIR)/$(am__dirstamp) 672 Common/ driver_cfa_cpp-UniqueName.$(OBJEXT): Common/$(am__dirstamp) \1007 Common/Heap.$(OBJEXT): Common/$(am__dirstamp) \ 673 1008 Common/$(DEPDIR)/$(am__dirstamp) 674 Common/driver_cfa_cpp-DebugMalloc.$(OBJEXT): Common/$(am__dirstamp) \ 675 Common/$(DEPDIR)/$(am__dirstamp) 676 Common/driver_cfa_cpp-Assert.$(OBJEXT): Common/$(am__dirstamp) \ 677 Common/$(DEPDIR)/$(am__dirstamp) 678 ControlStruct/$(am__dirstamp): 679 @$(MKDIR_P) ControlStruct 680 @: > ControlStruct/$(am__dirstamp) 681 ControlStruct/$(DEPDIR)/$(am__dirstamp): 682 @$(MKDIR_P) ControlStruct/$(DEPDIR) 683 @: > ControlStruct/$(DEPDIR)/$(am__dirstamp) 684 ControlStruct/driver_cfa_cpp-LabelGenerator.$(OBJEXT): \ 1009 ControlStruct/ExceptTranslate.$(OBJEXT): \ 685 1010 ControlStruct/$(am__dirstamp) \ 686 1011 ControlStruct/$(DEPDIR)/$(am__dirstamp) 687 ControlStruct/driver_cfa_cpp-LabelFixer.$(OBJEXT): \ 688 ControlStruct/$(am__dirstamp) \ 689 ControlStruct/$(DEPDIR)/$(am__dirstamp) 690 ControlStruct/driver_cfa_cpp-MLEMutator.$(OBJEXT): \ 691 ControlStruct/$(am__dirstamp) \ 692 ControlStruct/$(DEPDIR)/$(am__dirstamp) 693 ControlStruct/driver_cfa_cpp-Mutate.$(OBJEXT): \ 694 ControlStruct/$(am__dirstamp) \ 695 ControlStruct/$(DEPDIR)/$(am__dirstamp) 696 ControlStruct/driver_cfa_cpp-ForExprMutator.$(OBJEXT): \ 697 ControlStruct/$(am__dirstamp) \ 698 ControlStruct/$(DEPDIR)/$(am__dirstamp) 699 ControlStruct/driver_cfa_cpp-ExceptTranslate.$(OBJEXT): \ 700 ControlStruct/$(am__dirstamp) \ 701 ControlStruct/$(DEPDIR)/$(am__dirstamp) 702 GenPoly/$(am__dirstamp): 703 @$(MKDIR_P) GenPoly 704 @: > GenPoly/$(am__dirstamp) 705 GenPoly/$(DEPDIR)/$(am__dirstamp): 706 @$(MKDIR_P) GenPoly/$(DEPDIR) 707 @: > GenPoly/$(DEPDIR)/$(am__dirstamp) 708 GenPoly/driver_cfa_cpp-Box.$(OBJEXT): GenPoly/$(am__dirstamp) \ 1012 GenPoly/Box.$(OBJEXT): GenPoly/$(am__dirstamp) \ 709 1013 GenPoly/$(DEPDIR)/$(am__dirstamp) 710 GenPoly/ driver_cfa_cpp-GenPoly.$(OBJEXT): GenPoly/$(am__dirstamp) \1014 GenPoly/ScrubTyVars.$(OBJEXT): GenPoly/$(am__dirstamp) \ 711 1015 GenPoly/$(DEPDIR)/$(am__dirstamp) 712 GenPoly/ driver_cfa_cpp-ScrubTyVars.$(OBJEXT): GenPoly/$(am__dirstamp) \1016 GenPoly/Specialize.$(OBJEXT): GenPoly/$(am__dirstamp) \ 713 1017 GenPoly/$(DEPDIR)/$(am__dirstamp) 714 GenPoly/ driver_cfa_cpp-Lvalue.$(OBJEXT): GenPoly/$(am__dirstamp) \1018 GenPoly/FindFunction.$(OBJEXT): GenPoly/$(am__dirstamp) \ 715 1019 GenPoly/$(DEPDIR)/$(am__dirstamp) 716 GenPoly/ driver_cfa_cpp-Specialize.$(OBJEXT): GenPoly/$(am__dirstamp) \1020 GenPoly/InstantiateGeneric.$(OBJEXT): GenPoly/$(am__dirstamp) \ 717 1021 GenPoly/$(DEPDIR)/$(am__dirstamp) 718 GenPoly/driver_cfa_cpp-FindFunction.$(OBJEXT): \ 719 GenPoly/$(am__dirstamp) GenPoly/$(DEPDIR)/$(am__dirstamp) 720 GenPoly/driver_cfa_cpp-InstantiateGeneric.$(OBJEXT): \ 721 GenPoly/$(am__dirstamp) GenPoly/$(DEPDIR)/$(am__dirstamp) 722 InitTweak/$(am__dirstamp): 723 @$(MKDIR_P) InitTweak 724 @: > InitTweak/$(am__dirstamp) 725 InitTweak/$(DEPDIR)/$(am__dirstamp): 726 @$(MKDIR_P) InitTweak/$(DEPDIR) 727 @: > InitTweak/$(DEPDIR)/$(am__dirstamp) 728 InitTweak/driver_cfa_cpp-GenInit.$(OBJEXT): InitTweak/$(am__dirstamp) \ 1022 InitTweak/FixInit.$(OBJEXT): InitTweak/$(am__dirstamp) \ 729 1023 InitTweak/$(DEPDIR)/$(am__dirstamp) 730 InitTweak/ driver_cfa_cpp-FixInit.$(OBJEXT): InitTweak/$(am__dirstamp) \1024 InitTweak/FixGlobalInit.$(OBJEXT): InitTweak/$(am__dirstamp) \ 731 1025 InitTweak/$(DEPDIR)/$(am__dirstamp) 732 InitTweak/driver_cfa_cpp-FixGlobalInit.$(OBJEXT): \733 InitTweak/$(am__dirstamp) InitTweak/$(DEPDIR)/$(am__dirstamp)734 InitTweak/driver_cfa_cpp-InitTweak.$(OBJEXT): \735 InitTweak/$(am__dirstamp) InitTweak/$(DEPDIR)/$(am__dirstamp)736 1026 Parser/parser.hh: Parser/parser.cc 737 1027 @if test ! -f $@; then rm -f Parser/parser.cc; else :; fi 738 1028 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) Parser/parser.cc; else :; fi 739 Parser/$(am__dirstamp): 740 @$(MKDIR_P) Parser 741 @: > Parser/$(am__dirstamp) 742 Parser/$(DEPDIR)/$(am__dirstamp): 743 @$(MKDIR_P) Parser/$(DEPDIR) 744 @: > Parser/$(DEPDIR)/$(am__dirstamp) 745 Parser/driver_cfa_cpp-parser.$(OBJEXT): Parser/$(am__dirstamp) \ 1029 Parser/parser.$(OBJEXT): Parser/$(am__dirstamp) \ 746 1030 Parser/$(DEPDIR)/$(am__dirstamp) 747 Parser/ driver_cfa_cpp-lex.$(OBJEXT): Parser/$(am__dirstamp) \1031 Parser/lex.$(OBJEXT): Parser/$(am__dirstamp) \ 748 1032 Parser/$(DEPDIR)/$(am__dirstamp) 749 Parser/ driver_cfa_cpp-TypedefTable.$(OBJEXT): Parser/$(am__dirstamp) \1033 Parser/TypedefTable.$(OBJEXT): Parser/$(am__dirstamp) \ 750 1034 Parser/$(DEPDIR)/$(am__dirstamp) 751 Parser/ driver_cfa_cpp-ParseNode.$(OBJEXT): Parser/$(am__dirstamp) \1035 Parser/ParseNode.$(OBJEXT): Parser/$(am__dirstamp) \ 752 1036 Parser/$(DEPDIR)/$(am__dirstamp) 753 Parser/driver_cfa_cpp-DeclarationNode.$(OBJEXT): \ 754 Parser/$(am__dirstamp) Parser/$(DEPDIR)/$(am__dirstamp) 755 Parser/driver_cfa_cpp-ExpressionNode.$(OBJEXT): \ 756 Parser/$(am__dirstamp) Parser/$(DEPDIR)/$(am__dirstamp) 757 Parser/driver_cfa_cpp-StatementNode.$(OBJEXT): Parser/$(am__dirstamp) \ 1037 Parser/DeclarationNode.$(OBJEXT): Parser/$(am__dirstamp) \ 758 1038 Parser/$(DEPDIR)/$(am__dirstamp) 759 Parser/driver_cfa_cpp-InitializerNode.$(OBJEXT): \ 760 Parser/$(am__dirstamp) Parser/$(DEPDIR)/$(am__dirstamp) 761 Parser/driver_cfa_cpp-TypeData.$(OBJEXT): Parser/$(am__dirstamp) \ 1039 Parser/ExpressionNode.$(OBJEXT): Parser/$(am__dirstamp) \ 762 1040 Parser/$(DEPDIR)/$(am__dirstamp) 763 Parser/ driver_cfa_cpp-LinkageSpec.$(OBJEXT): Parser/$(am__dirstamp) \1041 Parser/StatementNode.$(OBJEXT): Parser/$(am__dirstamp) \ 764 1042 Parser/$(DEPDIR)/$(am__dirstamp) 765 Parser/ driver_cfa_cpp-parserutility.$(OBJEXT): Parser/$(am__dirstamp) \1043 Parser/InitializerNode.$(OBJEXT): Parser/$(am__dirstamp) \ 766 1044 Parser/$(DEPDIR)/$(am__dirstamp) 767 ResolvExpr/$(am__dirstamp): 768 @$(MKDIR_P) ResolvExpr 769 @: > ResolvExpr/$(am__dirstamp) 770 ResolvExpr/$(DEPDIR)/$(am__dirstamp): 771 @$(MKDIR_P) ResolvExpr/$(DEPDIR) 772 @: > ResolvExpr/$(DEPDIR)/$(am__dirstamp) 773 ResolvExpr/driver_cfa_cpp-AlternativeFinder.$(OBJEXT): \ 774 ResolvExpr/$(am__dirstamp) \ 775 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 776 ResolvExpr/driver_cfa_cpp-Alternative.$(OBJEXT): \ 777 ResolvExpr/$(am__dirstamp) \ 778 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 779 ResolvExpr/driver_cfa_cpp-Unify.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 780 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 781 ResolvExpr/driver_cfa_cpp-PtrsAssignable.$(OBJEXT): \ 782 ResolvExpr/$(am__dirstamp) \ 783 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 784 ResolvExpr/driver_cfa_cpp-CommonType.$(OBJEXT): \ 785 ResolvExpr/$(am__dirstamp) \ 786 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 787 ResolvExpr/driver_cfa_cpp-ConversionCost.$(OBJEXT): \ 788 ResolvExpr/$(am__dirstamp) \ 789 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 790 ResolvExpr/driver_cfa_cpp-CastCost.$(OBJEXT): \ 791 ResolvExpr/$(am__dirstamp) \ 792 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 793 ResolvExpr/driver_cfa_cpp-PtrsCastable.$(OBJEXT): \ 794 ResolvExpr/$(am__dirstamp) \ 795 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 796 ResolvExpr/driver_cfa_cpp-AdjustExprType.$(OBJEXT): \ 797 ResolvExpr/$(am__dirstamp) \ 798 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 799 ResolvExpr/driver_cfa_cpp-AlternativePrinter.$(OBJEXT): \ 800 ResolvExpr/$(am__dirstamp) \ 801 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 802 ResolvExpr/driver_cfa_cpp-Resolver.$(OBJEXT): \ 803 ResolvExpr/$(am__dirstamp) \ 804 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 805 ResolvExpr/driver_cfa_cpp-ResolveTypeof.$(OBJEXT): \ 806 ResolvExpr/$(am__dirstamp) \ 807 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 808 ResolvExpr/driver_cfa_cpp-RenameVars.$(OBJEXT): \ 809 ResolvExpr/$(am__dirstamp) \ 810 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 811 ResolvExpr/driver_cfa_cpp-FindOpenVars.$(OBJEXT): \ 812 ResolvExpr/$(am__dirstamp) \ 813 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 814 ResolvExpr/driver_cfa_cpp-PolyCost.$(OBJEXT): \ 815 ResolvExpr/$(am__dirstamp) \ 816 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 817 ResolvExpr/driver_cfa_cpp-Occurs.$(OBJEXT): \ 818 ResolvExpr/$(am__dirstamp) \ 819 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 820 ResolvExpr/driver_cfa_cpp-TypeEnvironment.$(OBJEXT): \ 821 ResolvExpr/$(am__dirstamp) \ 822 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 823 ResolvExpr/driver_cfa_cpp-CurrentObject.$(OBJEXT): \ 824 ResolvExpr/$(am__dirstamp) \ 825 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 826 ResolvExpr/driver_cfa_cpp-ExplodedActual.$(OBJEXT): \ 827 ResolvExpr/$(am__dirstamp) \ 828 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 829 SymTab/$(am__dirstamp): 830 @$(MKDIR_P) SymTab 831 @: > SymTab/$(am__dirstamp) 832 SymTab/$(DEPDIR)/$(am__dirstamp): 833 @$(MKDIR_P) SymTab/$(DEPDIR) 834 @: > SymTab/$(DEPDIR)/$(am__dirstamp) 835 SymTab/driver_cfa_cpp-Indexer.$(OBJEXT): SymTab/$(am__dirstamp) \ 836 SymTab/$(DEPDIR)/$(am__dirstamp) 837 SymTab/driver_cfa_cpp-Mangler.$(OBJEXT): SymTab/$(am__dirstamp) \ 838 SymTab/$(DEPDIR)/$(am__dirstamp) 839 SymTab/driver_cfa_cpp-Validate.$(OBJEXT): SymTab/$(am__dirstamp) \ 840 SymTab/$(DEPDIR)/$(am__dirstamp) 841 SymTab/driver_cfa_cpp-FixFunction.$(OBJEXT): SymTab/$(am__dirstamp) \ 842 SymTab/$(DEPDIR)/$(am__dirstamp) 843 SymTab/driver_cfa_cpp-Autogen.$(OBJEXT): SymTab/$(am__dirstamp) \ 844 SymTab/$(DEPDIR)/$(am__dirstamp) 845 SynTree/$(am__dirstamp): 846 @$(MKDIR_P) SynTree 847 @: > SynTree/$(am__dirstamp) 848 SynTree/$(DEPDIR)/$(am__dirstamp): 849 @$(MKDIR_P) SynTree/$(DEPDIR) 850 @: > SynTree/$(DEPDIR)/$(am__dirstamp) 851 SynTree/driver_cfa_cpp-Type.$(OBJEXT): SynTree/$(am__dirstamp) \ 852 SynTree/$(DEPDIR)/$(am__dirstamp) 853 SynTree/driver_cfa_cpp-VoidType.$(OBJEXT): SynTree/$(am__dirstamp) \ 854 SynTree/$(DEPDIR)/$(am__dirstamp) 855 SynTree/driver_cfa_cpp-BasicType.$(OBJEXT): SynTree/$(am__dirstamp) \ 856 SynTree/$(DEPDIR)/$(am__dirstamp) 857 SynTree/driver_cfa_cpp-PointerType.$(OBJEXT): SynTree/$(am__dirstamp) \ 858 SynTree/$(DEPDIR)/$(am__dirstamp) 859 SynTree/driver_cfa_cpp-ArrayType.$(OBJEXT): SynTree/$(am__dirstamp) \ 860 SynTree/$(DEPDIR)/$(am__dirstamp) 861 SynTree/driver_cfa_cpp-ReferenceType.$(OBJEXT): \ 862 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 863 SynTree/driver_cfa_cpp-FunctionType.$(OBJEXT): \ 864 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 865 SynTree/driver_cfa_cpp-ReferenceToType.$(OBJEXT): \ 866 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 867 SynTree/driver_cfa_cpp-TupleType.$(OBJEXT): SynTree/$(am__dirstamp) \ 868 SynTree/$(DEPDIR)/$(am__dirstamp) 869 SynTree/driver_cfa_cpp-TypeofType.$(OBJEXT): SynTree/$(am__dirstamp) \ 870 SynTree/$(DEPDIR)/$(am__dirstamp) 871 SynTree/driver_cfa_cpp-AttrType.$(OBJEXT): SynTree/$(am__dirstamp) \ 872 SynTree/$(DEPDIR)/$(am__dirstamp) 873 SynTree/driver_cfa_cpp-VarArgsType.$(OBJEXT): SynTree/$(am__dirstamp) \ 874 SynTree/$(DEPDIR)/$(am__dirstamp) 875 SynTree/driver_cfa_cpp-ZeroOneType.$(OBJEXT): SynTree/$(am__dirstamp) \ 876 SynTree/$(DEPDIR)/$(am__dirstamp) 877 SynTree/driver_cfa_cpp-Constant.$(OBJEXT): SynTree/$(am__dirstamp) \ 878 SynTree/$(DEPDIR)/$(am__dirstamp) 879 SynTree/driver_cfa_cpp-Expression.$(OBJEXT): SynTree/$(am__dirstamp) \ 880 SynTree/$(DEPDIR)/$(am__dirstamp) 881 SynTree/driver_cfa_cpp-TupleExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 882 SynTree/$(DEPDIR)/$(am__dirstamp) 883 SynTree/driver_cfa_cpp-CommaExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 884 SynTree/$(DEPDIR)/$(am__dirstamp) 885 SynTree/driver_cfa_cpp-TypeExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 886 SynTree/$(DEPDIR)/$(am__dirstamp) 887 SynTree/driver_cfa_cpp-ApplicationExpr.$(OBJEXT): \ 888 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 889 SynTree/driver_cfa_cpp-AddressExpr.$(OBJEXT): SynTree/$(am__dirstamp) \ 890 SynTree/$(DEPDIR)/$(am__dirstamp) 891 SynTree/driver_cfa_cpp-Statement.$(OBJEXT): SynTree/$(am__dirstamp) \ 892 SynTree/$(DEPDIR)/$(am__dirstamp) 893 SynTree/driver_cfa_cpp-CompoundStmt.$(OBJEXT): \ 894 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 895 SynTree/driver_cfa_cpp-DeclStmt.$(OBJEXT): SynTree/$(am__dirstamp) \ 896 SynTree/$(DEPDIR)/$(am__dirstamp) 897 SynTree/driver_cfa_cpp-Declaration.$(OBJEXT): SynTree/$(am__dirstamp) \ 898 SynTree/$(DEPDIR)/$(am__dirstamp) 899 SynTree/driver_cfa_cpp-DeclarationWithType.$(OBJEXT): \ 900 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 901 SynTree/driver_cfa_cpp-ObjectDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 902 SynTree/$(DEPDIR)/$(am__dirstamp) 903 SynTree/driver_cfa_cpp-FunctionDecl.$(OBJEXT): \ 904 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 905 SynTree/driver_cfa_cpp-AggregateDecl.$(OBJEXT): \ 906 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 907 SynTree/driver_cfa_cpp-NamedTypeDecl.$(OBJEXT): \ 908 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 909 SynTree/driver_cfa_cpp-TypeDecl.$(OBJEXT): SynTree/$(am__dirstamp) \ 910 SynTree/$(DEPDIR)/$(am__dirstamp) 911 SynTree/driver_cfa_cpp-Initializer.$(OBJEXT): SynTree/$(am__dirstamp) \ 912 SynTree/$(DEPDIR)/$(am__dirstamp) 913 SynTree/driver_cfa_cpp-Visitor.$(OBJEXT): SynTree/$(am__dirstamp) \ 914 SynTree/$(DEPDIR)/$(am__dirstamp) 915 SynTree/driver_cfa_cpp-Mutator.$(OBJEXT): SynTree/$(am__dirstamp) \ 916 SynTree/$(DEPDIR)/$(am__dirstamp) 917 SynTree/driver_cfa_cpp-TypeSubstitution.$(OBJEXT): \ 918 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 919 SynTree/driver_cfa_cpp-Attribute.$(OBJEXT): SynTree/$(am__dirstamp) \ 920 SynTree/$(DEPDIR)/$(am__dirstamp) 921 SynTree/driver_cfa_cpp-VarExprReplacer.$(OBJEXT): \ 922 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 923 Tuples/$(am__dirstamp): 924 @$(MKDIR_P) Tuples 925 @: > Tuples/$(am__dirstamp) 926 Tuples/$(DEPDIR)/$(am__dirstamp): 927 @$(MKDIR_P) Tuples/$(DEPDIR) 928 @: > Tuples/$(DEPDIR)/$(am__dirstamp) 929 Tuples/driver_cfa_cpp-TupleAssignment.$(OBJEXT): \ 930 Tuples/$(am__dirstamp) Tuples/$(DEPDIR)/$(am__dirstamp) 931 Tuples/driver_cfa_cpp-TupleExpansion.$(OBJEXT): \ 932 Tuples/$(am__dirstamp) Tuples/$(DEPDIR)/$(am__dirstamp) 933 Tuples/driver_cfa_cpp-Explode.$(OBJEXT): Tuples/$(am__dirstamp) \ 934 Tuples/$(DEPDIR)/$(am__dirstamp) 1045 Parser/TypeData.$(OBJEXT): Parser/$(am__dirstamp) \ 1046 Parser/$(DEPDIR)/$(am__dirstamp) 1047 Parser/parserutility.$(OBJEXT): Parser/$(am__dirstamp) \ 1048 Parser/$(DEPDIR)/$(am__dirstamp) 1049 ResolvExpr/AlternativePrinter.$(OBJEXT): ResolvExpr/$(am__dirstamp) \ 1050 ResolvExpr/$(DEPDIR)/$(am__dirstamp) 935 1051 Virtual/$(am__dirstamp): 936 1052 @$(MKDIR_P) Virtual … … 939 1055 @$(MKDIR_P) Virtual/$(DEPDIR) 940 1056 @: > Virtual/$(DEPDIR)/$(am__dirstamp) 941 Virtual/ driver_cfa_cpp-ExpandCasts.$(OBJEXT): Virtual/$(am__dirstamp) \1057 Virtual/ExpandCasts.$(OBJEXT): Virtual/$(am__dirstamp) \ 942 1058 Virtual/$(DEPDIR)/$(am__dirstamp) 943 driver/$(am__dirstamp): 944 @$(MKDIR_P) driver 945 @: > driver/$(am__dirstamp) 946 947 driver/cfa-cpp$(EXEEXT): $(driver_cfa_cpp_OBJECTS) $(driver_cfa_cpp_DEPENDENCIES) $(EXTRA_driver_cfa_cpp_DEPENDENCIES) driver/$(am__dirstamp) 948 @rm -f driver/cfa-cpp$(EXEEXT) 949 $(AM_V_CXXLD)$(driver_cfa_cpp_LINK) $(driver_cfa_cpp_OBJECTS) $(driver_cfa_cpp_LDADD) $(LIBS) 1059 ../driver/$(am__dirstamp): 1060 @$(MKDIR_P) ../driver 1061 @: > ../driver/$(am__dirstamp) 1062 1063 ../driver/cfa-cpp$(EXEEXT): $(___driver_cfa_cpp_OBJECTS) $(___driver_cfa_cpp_DEPENDENCIES) $(EXTRA____driver_cfa_cpp_DEPENDENCIES) ../driver/$(am__dirstamp) 1064 @rm -f ../driver/cfa-cpp$(EXEEXT) 1065 $(AM_V_CXXLD)$(CXXLINK) $(___driver_cfa_cpp_OBJECTS) $(___driver_cfa_cpp_LDADD) $(LIBS) 1066 SymTab/demangler.$(OBJEXT): SymTab/$(am__dirstamp) \ 1067 SymTab/$(DEPDIR)/$(am__dirstamp) 1068 1069 demangler$(EXEEXT): $(demangler_OBJECTS) $(demangler_DEPENDENCIES) $(EXTRA_demangler_DEPENDENCIES) 1070 @rm -f demangler$(EXEEXT) 1071 $(AM_V_CXXLD)$(CXXLINK) $(demangler_OBJECTS) $(demangler_LDADD) $(LIBS) 950 1072 951 1073 mostlyclean-compile: … … 963 1085 -rm -f SynTree/*.$(OBJEXT) 964 1086 -rm -f Tuples/*.$(OBJEXT) 1087 -rm -f Validate/*.$(OBJEXT) 965 1088 -rm -f Virtual/*.$(OBJEXT) 966 1089 … … 968 1091 -rm -f *.tab.c 969 1092 970 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/driver_cfa_cpp-MakeLibCfa.Po@am__quote@ 971 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/driver_cfa_cpp-main.Po@am__quote@ 972 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/driver_cfa_cpp-CodeGenerator.Po@am__quote@ 973 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/driver_cfa_cpp-FixMain.Po@am__quote@ 974 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/driver_cfa_cpp-FixNames.Po@am__quote@ 975 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/driver_cfa_cpp-GenType.Po@am__quote@ 976 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/driver_cfa_cpp-Generate.Po@am__quote@ 977 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/driver_cfa_cpp-OperatorTable.Po@am__quote@ 978 @AMDEP_TRUE@@am__include@ @am__quote@CodeTools/$(DEPDIR)/driver_cfa_cpp-DeclStats.Po@am__quote@ 979 @AMDEP_TRUE@@am__include@ @am__quote@CodeTools/$(DEPDIR)/driver_cfa_cpp-TrackLoc.Po@am__quote@ 980 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-Assert.Po@am__quote@ 981 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Po@am__quote@ 982 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-SemanticError.Po@am__quote@ 983 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-UniqueName.Po@am__quote@ 984 @AMDEP_TRUE@@am__include@ @am__quote@Concurrency/$(DEPDIR)/driver_cfa_cpp-Keywords.Po@am__quote@ 985 @AMDEP_TRUE@@am__include@ @am__quote@Concurrency/$(DEPDIR)/driver_cfa_cpp-Waitfor.Po@am__quote@ 986 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-ExceptTranslate.Po@am__quote@ 987 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-ForExprMutator.Po@am__quote@ 988 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelFixer.Po@am__quote@ 989 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelGenerator.Po@am__quote@ 990 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-MLEMutator.Po@am__quote@ 991 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-Mutate.Po@am__quote@ 992 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-Box.Po@am__quote@ 993 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-FindFunction.Po@am__quote@ 994 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-GenPoly.Po@am__quote@ 995 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-InstantiateGeneric.Po@am__quote@ 996 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-Lvalue.Po@am__quote@ 997 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-ScrubTyVars.Po@am__quote@ 998 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/driver_cfa_cpp-Specialize.Po@am__quote@ 999 @AMDEP_TRUE@@am__include@ @am__quote@InitTweak/$(DEPDIR)/driver_cfa_cpp-FixGlobalInit.Po@am__quote@ 1000 @AMDEP_TRUE@@am__include@ @am__quote@InitTweak/$(DEPDIR)/driver_cfa_cpp-FixInit.Po@am__quote@ 1001 @AMDEP_TRUE@@am__include@ @am__quote@InitTweak/$(DEPDIR)/driver_cfa_cpp-GenInit.Po@am__quote@ 1002 @AMDEP_TRUE@@am__include@ @am__quote@InitTweak/$(DEPDIR)/driver_cfa_cpp-InitTweak.Po@am__quote@ 1003 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-DeclarationNode.Po@am__quote@ 1004 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-ExpressionNode.Po@am__quote@ 1005 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-InitializerNode.Po@am__quote@ 1006 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-LinkageSpec.Po@am__quote@ 1007 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-ParseNode.Po@am__quote@ 1008 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-StatementNode.Po@am__quote@ 1009 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-TypeData.Po@am__quote@ 1010 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-TypedefTable.Po@am__quote@ 1011 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-lex.Po@am__quote@ 1012 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-parser.Po@am__quote@ 1013 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/driver_cfa_cpp-parserutility.Po@am__quote@ 1014 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AdjustExprType.Po@am__quote@ 1015 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Alternative.Po@am__quote@ 1016 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativeFinder.Po@am__quote@ 1017 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativePrinter.Po@am__quote@ 1018 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CastCost.Po@am__quote@ 1019 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CommonType.Po@am__quote@ 1020 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ConversionCost.Po@am__quote@ 1021 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CurrentObject.Po@am__quote@ 1022 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ExplodedActual.Po@am__quote@ 1023 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-FindOpenVars.Po@am__quote@ 1024 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Occurs.Po@am__quote@ 1025 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PolyCost.Po@am__quote@ 1026 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsAssignable.Po@am__quote@ 1027 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsCastable.Po@am__quote@ 1028 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-RenameVars.Po@am__quote@ 1029 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ResolveTypeof.Po@am__quote@ 1030 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Resolver.Po@am__quote@ 1031 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-TypeEnvironment.Po@am__quote@ 1032 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Unify.Po@am__quote@ 1033 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-Autogen.Po@am__quote@ 1034 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-FixFunction.Po@am__quote@ 1035 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-Indexer.Po@am__quote@ 1036 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-Mangler.Po@am__quote@ 1037 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-Validate.Po@am__quote@ 1038 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-AddressExpr.Po@am__quote@ 1039 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-AggregateDecl.Po@am__quote@ 1040 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-ApplicationExpr.Po@am__quote@ 1041 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-ArrayType.Po@am__quote@ 1042 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-AttrType.Po@am__quote@ 1043 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Attribute.Po@am__quote@ 1044 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-BasicType.Po@am__quote@ 1045 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-CommaExpr.Po@am__quote@ 1046 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-CompoundStmt.Po@am__quote@ 1047 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Constant.Po@am__quote@ 1048 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-DeclStmt.Po@am__quote@ 1049 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Declaration.Po@am__quote@ 1050 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-DeclarationWithType.Po@am__quote@ 1051 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Expression.Po@am__quote@ 1052 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionDecl.Po@am__quote@ 1053 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionType.Po@am__quote@ 1054 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Initializer.Po@am__quote@ 1055 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Mutator.Po@am__quote@ 1056 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-NamedTypeDecl.Po@am__quote@ 1057 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-ObjectDecl.Po@am__quote@ 1058 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-PointerType.Po@am__quote@ 1059 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceToType.Po@am__quote@ 1060 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Po@am__quote@ 1061 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Statement.Po@am__quote@ 1062 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-TupleExpr.Po@am__quote@ 1063 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-TupleType.Po@am__quote@ 1064 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Type.Po@am__quote@ 1065 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-TypeDecl.Po@am__quote@ 1066 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-TypeExpr.Po@am__quote@ 1067 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-TypeSubstitution.Po@am__quote@ 1068 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-TypeofType.Po@am__quote@ 1069 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-VarArgsType.Po@am__quote@ 1070 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-VarExprReplacer.Po@am__quote@ 1071 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Visitor.Po@am__quote@ 1072 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-VoidType.Po@am__quote@ 1073 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Po@am__quote@ 1074 @AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-Explode.Po@am__quote@ 1075 @AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-TupleAssignment.Po@am__quote@ 1076 @AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/driver_cfa_cpp-TupleExpansion.Po@am__quote@ 1077 @AMDEP_TRUE@@am__include@ @am__quote@Virtual/$(DEPDIR)/driver_cfa_cpp-ExpandCasts.Po@am__quote@ 1093 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CompilationState.Po@am__quote@ 1094 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MakeLibCfa.Po@am__quote@ 1095 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ 1096 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/CodeGenerator.Po@am__quote@ 1097 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/FixMain.Po@am__quote@ 1098 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/FixNames.Po@am__quote@ 1099 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/GenType.Po@am__quote@ 1100 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/Generate.Po@am__quote@ 1101 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/OperatorTable.Po@am__quote@ 1102 @AMDEP_TRUE@@am__include@ @am__quote@CodeTools/$(DEPDIR)/DeclStats.Po@am__quote@ 1103 @AMDEP_TRUE@@am__include@ @am__quote@CodeTools/$(DEPDIR)/TrackLoc.Po@am__quote@ 1104 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/Assert.Po@am__quote@ 1105 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/DebugMalloc.Po@am__quote@ 1106 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/Eval.Po@am__quote@ 1107 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/Heap.Po@am__quote@ 1108 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/SemanticError.Po@am__quote@ 1109 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/UniqueName.Po@am__quote@ 1110 @AMDEP_TRUE@@am__include@ @am__quote@Concurrency/$(DEPDIR)/Keywords.Po@am__quote@ 1111 @AMDEP_TRUE@@am__include@ @am__quote@Concurrency/$(DEPDIR)/Waitfor.Po@am__quote@ 1112 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/ExceptTranslate.Po@am__quote@ 1113 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/ForExprMutator.Po@am__quote@ 1114 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/LabelFixer.Po@am__quote@ 1115 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/LabelGenerator.Po@am__quote@ 1116 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/MLEMutator.Po@am__quote@ 1117 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/Mutate.Po@am__quote@ 1118 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/Box.Po@am__quote@ 1119 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/FindFunction.Po@am__quote@ 1120 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/GenPoly.Po@am__quote@ 1121 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/InstantiateGeneric.Po@am__quote@ 1122 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/Lvalue.Po@am__quote@ 1123 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/ScrubTyVars.Po@am__quote@ 1124 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/Specialize.Po@am__quote@ 1125 @AMDEP_TRUE@@am__include@ @am__quote@InitTweak/$(DEPDIR)/FixGlobalInit.Po@am__quote@ 1126 @AMDEP_TRUE@@am__include@ @am__quote@InitTweak/$(DEPDIR)/FixInit.Po@am__quote@ 1127 @AMDEP_TRUE@@am__include@ @am__quote@InitTweak/$(DEPDIR)/GenInit.Po@am__quote@ 1128 @AMDEP_TRUE@@am__include@ @am__quote@InitTweak/$(DEPDIR)/InitTweak.Po@am__quote@ 1129 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/DeclarationNode.Po@am__quote@ 1130 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/ExpressionNode.Po@am__quote@ 1131 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/InitializerNode.Po@am__quote@ 1132 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/LinkageSpec.Po@am__quote@ 1133 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/ParseNode.Po@am__quote@ 1134 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/StatementNode.Po@am__quote@ 1135 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/TypeData.Po@am__quote@ 1136 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/TypedefTable.Po@am__quote@ 1137 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/lex.Po@am__quote@ 1138 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/parser.Po@am__quote@ 1139 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/parserutility.Po@am__quote@ 1140 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/AdjustExprType.Po@am__quote@ 1141 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/Alternative.Po@am__quote@ 1142 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/AlternativeFinder.Po@am__quote@ 1143 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/AlternativePrinter.Po@am__quote@ 1144 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/CastCost.Po@am__quote@ 1145 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/CommonType.Po@am__quote@ 1146 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/ConversionCost.Po@am__quote@ 1147 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/CurrentObject.Po@am__quote@ 1148 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/ExplodedActual.Po@am__quote@ 1149 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/FindOpenVars.Po@am__quote@ 1150 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/Occurs.Po@am__quote@ 1151 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/PolyCost.Po@am__quote@ 1152 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/PtrsAssignable.Po@am__quote@ 1153 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/PtrsCastable.Po@am__quote@ 1154 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/RenameVars.Po@am__quote@ 1155 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/ResolveTypeof.Po@am__quote@ 1156 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/Resolver.Po@am__quote@ 1157 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/TypeEnvironment.Po@am__quote@ 1158 @AMDEP_TRUE@@am__include@ @am__quote@ResolvExpr/$(DEPDIR)/Unify.Po@am__quote@ 1159 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/Autogen.Po@am__quote@ 1160 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/Demangle.Po@am__quote@ 1161 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/FixFunction.Po@am__quote@ 1162 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/Indexer.Po@am__quote@ 1163 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/Mangler.Po@am__quote@ 1164 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/ManglerCommon.Po@am__quote@ 1165 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/Validate.Po@am__quote@ 1166 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/demangler.Po@am__quote@ 1167 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/AddressExpr.Po@am__quote@ 1168 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/AggregateDecl.Po@am__quote@ 1169 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/ApplicationExpr.Po@am__quote@ 1170 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/ArrayType.Po@am__quote@ 1171 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/AttrType.Po@am__quote@ 1172 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/Attribute.Po@am__quote@ 1173 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/BasicType.Po@am__quote@ 1174 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/CommaExpr.Po@am__quote@ 1175 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/CompoundStmt.Po@am__quote@ 1176 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/Constant.Po@am__quote@ 1177 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/DeclReplacer.Po@am__quote@ 1178 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/DeclStmt.Po@am__quote@ 1179 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/Declaration.Po@am__quote@ 1180 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/DeclarationWithType.Po@am__quote@ 1181 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/Expression.Po@am__quote@ 1182 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/FunctionDecl.Po@am__quote@ 1183 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/FunctionType.Po@am__quote@ 1184 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/Initializer.Po@am__quote@ 1185 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/NamedTypeDecl.Po@am__quote@ 1186 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/ObjectDecl.Po@am__quote@ 1187 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/PointerType.Po@am__quote@ 1188 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/ReferenceToType.Po@am__quote@ 1189 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/ReferenceType.Po@am__quote@ 1190 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/Statement.Po@am__quote@ 1191 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TupleExpr.Po@am__quote@ 1192 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TupleType.Po@am__quote@ 1193 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/Type.Po@am__quote@ 1194 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TypeDecl.Po@am__quote@ 1195 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TypeExpr.Po@am__quote@ 1196 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TypeSubstitution.Po@am__quote@ 1197 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/TypeofType.Po@am__quote@ 1198 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/VarArgsType.Po@am__quote@ 1199 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/VoidType.Po@am__quote@ 1200 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/ZeroOneType.Po@am__quote@ 1201 @AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/Explode.Po@am__quote@ 1202 @AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/TupleAssignment.Po@am__quote@ 1203 @AMDEP_TRUE@@am__include@ @am__quote@Tuples/$(DEPDIR)/TupleExpansion.Po@am__quote@ 1204 @AMDEP_TRUE@@am__include@ @am__quote@Validate/$(DEPDIR)/HandleAttributes.Po@am__quote@ 1205 @AMDEP_TRUE@@am__include@ @am__quote@Virtual/$(DEPDIR)/ExpandCasts.Po@am__quote@ 1078 1206 1079 1207 .cc.o: … … 1092 1220 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1093 1221 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` 1094 1095 driver_cfa_cpp-main.o: main.cc1096 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT driver_cfa_cpp-main.o -MD -MP -MF $(DEPDIR)/driver_cfa_cpp-main.Tpo -c -o driver_cfa_cpp-main.o `test -f 'main.cc' || echo '$(srcdir)/'`main.cc1097 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/driver_cfa_cpp-main.Tpo $(DEPDIR)/driver_cfa_cpp-main.Po1098 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='main.cc' object='driver_cfa_cpp-main.o' libtool=no @AMDEPBACKSLASH@1099 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1100 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o driver_cfa_cpp-main.o `test -f 'main.cc' || echo '$(srcdir)/'`main.cc1101 1102 driver_cfa_cpp-main.obj: main.cc1103 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT driver_cfa_cpp-main.obj -MD -MP -MF $(DEPDIR)/driver_cfa_cpp-main.Tpo -c -o driver_cfa_cpp-main.obj `if test -f 'main.cc'; then $(CYGPATH_W) 'main.cc'; else $(CYGPATH_W) '$(srcdir)/main.cc'; fi`1104 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/driver_cfa_cpp-main.Tpo $(DEPDIR)/driver_cfa_cpp-main.Po1105 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='main.cc' object='driver_cfa_cpp-main.obj' libtool=no @AMDEPBACKSLASH@1106 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1107 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o driver_cfa_cpp-main.obj `if test -f 'main.cc'; then $(CYGPATH_W) 'main.cc'; else $(CYGPATH_W) '$(srcdir)/main.cc'; fi`1108 1109 driver_cfa_cpp-MakeLibCfa.o: MakeLibCfa.cc1110 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT driver_cfa_cpp-MakeLibCfa.o -MD -MP -MF $(DEPDIR)/driver_cfa_cpp-MakeLibCfa.Tpo -c -o driver_cfa_cpp-MakeLibCfa.o `test -f 'MakeLibCfa.cc' || echo '$(srcdir)/'`MakeLibCfa.cc1111 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/driver_cfa_cpp-MakeLibCfa.Tpo $(DEPDIR)/driver_cfa_cpp-MakeLibCfa.Po1112 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='MakeLibCfa.cc' object='driver_cfa_cpp-MakeLibCfa.o' libtool=no @AMDEPBACKSLASH@1113 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1114 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o driver_cfa_cpp-MakeLibCfa.o `test -f 'MakeLibCfa.cc' || echo '$(srcdir)/'`MakeLibCfa.cc1115 1116 driver_cfa_cpp-MakeLibCfa.obj: MakeLibCfa.cc1117 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT driver_cfa_cpp-MakeLibCfa.obj -MD -MP -MF $(DEPDIR)/driver_cfa_cpp-MakeLibCfa.Tpo -c -o driver_cfa_cpp-MakeLibCfa.obj `if test -f 'MakeLibCfa.cc'; then $(CYGPATH_W) 'MakeLibCfa.cc'; else $(CYGPATH_W) '$(srcdir)/MakeLibCfa.cc'; fi`1118 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/driver_cfa_cpp-MakeLibCfa.Tpo $(DEPDIR)/driver_cfa_cpp-MakeLibCfa.Po1119 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='MakeLibCfa.cc' object='driver_cfa_cpp-MakeLibCfa.obj' libtool=no @AMDEPBACKSLASH@1120 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1121 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o driver_cfa_cpp-MakeLibCfa.obj `if test -f 'MakeLibCfa.cc'; then $(CYGPATH_W) 'MakeLibCfa.cc'; else $(CYGPATH_W) '$(srcdir)/MakeLibCfa.cc'; fi`1122 1123 CodeGen/driver_cfa_cpp-Generate.o: CodeGen/Generate.cc1124 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-Generate.o -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-Generate.Tpo -c -o CodeGen/driver_cfa_cpp-Generate.o `test -f 'CodeGen/Generate.cc' || echo '$(srcdir)/'`CodeGen/Generate.cc1125 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-Generate.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-Generate.Po1126 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/Generate.cc' object='CodeGen/driver_cfa_cpp-Generate.o' libtool=no @AMDEPBACKSLASH@1127 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1128 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-Generate.o `test -f 'CodeGen/Generate.cc' || echo '$(srcdir)/'`CodeGen/Generate.cc1129 1130 CodeGen/driver_cfa_cpp-Generate.obj: CodeGen/Generate.cc1131 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-Generate.obj -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-Generate.Tpo -c -o CodeGen/driver_cfa_cpp-Generate.obj `if test -f 'CodeGen/Generate.cc'; then $(CYGPATH_W) 'CodeGen/Generate.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/Generate.cc'; fi`1132 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-Generate.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-Generate.Po1133 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/Generate.cc' object='CodeGen/driver_cfa_cpp-Generate.obj' libtool=no @AMDEPBACKSLASH@1134 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1135 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-Generate.obj `if test -f 'CodeGen/Generate.cc'; then $(CYGPATH_W) 'CodeGen/Generate.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/Generate.cc'; fi`1136 1137 CodeGen/driver_cfa_cpp-CodeGenerator.o: CodeGen/CodeGenerator.cc1138 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-CodeGenerator.o -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-CodeGenerator.Tpo -c -o CodeGen/driver_cfa_cpp-CodeGenerator.o `test -f 'CodeGen/CodeGenerator.cc' || echo '$(srcdir)/'`CodeGen/CodeGenerator.cc1139 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-CodeGenerator.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-CodeGenerator.Po1140 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/CodeGenerator.cc' object='CodeGen/driver_cfa_cpp-CodeGenerator.o' libtool=no @AMDEPBACKSLASH@1141 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1142 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-CodeGenerator.o `test -f 'CodeGen/CodeGenerator.cc' || echo '$(srcdir)/'`CodeGen/CodeGenerator.cc1143 1144 CodeGen/driver_cfa_cpp-CodeGenerator.obj: CodeGen/CodeGenerator.cc1145 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-CodeGenerator.obj -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-CodeGenerator.Tpo -c -o CodeGen/driver_cfa_cpp-CodeGenerator.obj `if test -f 'CodeGen/CodeGenerator.cc'; then $(CYGPATH_W) 'CodeGen/CodeGenerator.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/CodeGenerator.cc'; fi`1146 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-CodeGenerator.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-CodeGenerator.Po1147 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/CodeGenerator.cc' object='CodeGen/driver_cfa_cpp-CodeGenerator.obj' libtool=no @AMDEPBACKSLASH@1148 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1149 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-CodeGenerator.obj `if test -f 'CodeGen/CodeGenerator.cc'; then $(CYGPATH_W) 'CodeGen/CodeGenerator.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/CodeGenerator.cc'; fi`1150 1151 CodeGen/driver_cfa_cpp-GenType.o: CodeGen/GenType.cc1152 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-GenType.o -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-GenType.Tpo -c -o CodeGen/driver_cfa_cpp-GenType.o `test -f 'CodeGen/GenType.cc' || echo '$(srcdir)/'`CodeGen/GenType.cc1153 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-GenType.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-GenType.Po1154 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/GenType.cc' object='CodeGen/driver_cfa_cpp-GenType.o' libtool=no @AMDEPBACKSLASH@1155 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1156 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-GenType.o `test -f 'CodeGen/GenType.cc' || echo '$(srcdir)/'`CodeGen/GenType.cc1157 1158 CodeGen/driver_cfa_cpp-GenType.obj: CodeGen/GenType.cc1159 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-GenType.obj -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-GenType.Tpo -c -o CodeGen/driver_cfa_cpp-GenType.obj `if test -f 'CodeGen/GenType.cc'; then $(CYGPATH_W) 'CodeGen/GenType.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/GenType.cc'; fi`1160 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-GenType.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-GenType.Po1161 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/GenType.cc' object='CodeGen/driver_cfa_cpp-GenType.obj' libtool=no @AMDEPBACKSLASH@1162 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1163 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-GenType.obj `if test -f 'CodeGen/GenType.cc'; then $(CYGPATH_W) 'CodeGen/GenType.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/GenType.cc'; fi`1164 1165 CodeGen/driver_cfa_cpp-FixNames.o: CodeGen/FixNames.cc1166 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-FixNames.o -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-FixNames.Tpo -c -o CodeGen/driver_cfa_cpp-FixNames.o `test -f 'CodeGen/FixNames.cc' || echo '$(srcdir)/'`CodeGen/FixNames.cc1167 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-FixNames.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-FixNames.Po1168 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/FixNames.cc' object='CodeGen/driver_cfa_cpp-FixNames.o' libtool=no @AMDEPBACKSLASH@1169 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1170 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-FixNames.o `test -f 'CodeGen/FixNames.cc' || echo '$(srcdir)/'`CodeGen/FixNames.cc1171 1172 CodeGen/driver_cfa_cpp-FixNames.obj: CodeGen/FixNames.cc1173 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-FixNames.obj -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-FixNames.Tpo -c -o CodeGen/driver_cfa_cpp-FixNames.obj `if test -f 'CodeGen/FixNames.cc'; then $(CYGPATH_W) 'CodeGen/FixNames.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/FixNames.cc'; fi`1174 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-FixNames.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-FixNames.Po1175 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/FixNames.cc' object='CodeGen/driver_cfa_cpp-FixNames.obj' libtool=no @AMDEPBACKSLASH@1176 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1177 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-FixNames.obj `if test -f 'CodeGen/FixNames.cc'; then $(CYGPATH_W) 'CodeGen/FixNames.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/FixNames.cc'; fi`1178 1179 CodeGen/driver_cfa_cpp-FixMain.o: CodeGen/FixMain.cc1180 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-FixMain.o -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-FixMain.Tpo -c -o CodeGen/driver_cfa_cpp-FixMain.o `test -f 'CodeGen/FixMain.cc' || echo '$(srcdir)/'`CodeGen/FixMain.cc1181 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-FixMain.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-FixMain.Po1182 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/FixMain.cc' object='CodeGen/driver_cfa_cpp-FixMain.o' libtool=no @AMDEPBACKSLASH@1183 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1184 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-FixMain.o `test -f 'CodeGen/FixMain.cc' || echo '$(srcdir)/'`CodeGen/FixMain.cc1185 1186 CodeGen/driver_cfa_cpp-FixMain.obj: CodeGen/FixMain.cc1187 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-FixMain.obj -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-FixMain.Tpo -c -o CodeGen/driver_cfa_cpp-FixMain.obj `if test -f 'CodeGen/FixMain.cc'; then $(CYGPATH_W) 'CodeGen/FixMain.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/FixMain.cc'; fi`1188 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-FixMain.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-FixMain.Po1189 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/FixMain.cc' object='CodeGen/driver_cfa_cpp-FixMain.obj' libtool=no @AMDEPBACKSLASH@1190 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1191 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-FixMain.obj `if test -f 'CodeGen/FixMain.cc'; then $(CYGPATH_W) 'CodeGen/FixMain.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/FixMain.cc'; fi`1192 1193 CodeGen/driver_cfa_cpp-OperatorTable.o: CodeGen/OperatorTable.cc1194 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-OperatorTable.o -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-OperatorTable.Tpo -c -o CodeGen/driver_cfa_cpp-OperatorTable.o `test -f 'CodeGen/OperatorTable.cc' || echo '$(srcdir)/'`CodeGen/OperatorTable.cc1195 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-OperatorTable.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-OperatorTable.Po1196 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/OperatorTable.cc' object='CodeGen/driver_cfa_cpp-OperatorTable.o' libtool=no @AMDEPBACKSLASH@1197 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1198 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-OperatorTable.o `test -f 'CodeGen/OperatorTable.cc' || echo '$(srcdir)/'`CodeGen/OperatorTable.cc1199 1200 CodeGen/driver_cfa_cpp-OperatorTable.obj: CodeGen/OperatorTable.cc1201 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeGen/driver_cfa_cpp-OperatorTable.obj -MD -MP -MF CodeGen/$(DEPDIR)/driver_cfa_cpp-OperatorTable.Tpo -c -o CodeGen/driver_cfa_cpp-OperatorTable.obj `if test -f 'CodeGen/OperatorTable.cc'; then $(CYGPATH_W) 'CodeGen/OperatorTable.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/OperatorTable.cc'; fi`1202 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeGen/$(DEPDIR)/driver_cfa_cpp-OperatorTable.Tpo CodeGen/$(DEPDIR)/driver_cfa_cpp-OperatorTable.Po1203 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeGen/OperatorTable.cc' object='CodeGen/driver_cfa_cpp-OperatorTable.obj' libtool=no @AMDEPBACKSLASH@1204 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1205 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-OperatorTable.obj `if test -f 'CodeGen/OperatorTable.cc'; then $(CYGPATH_W) 'CodeGen/OperatorTable.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/OperatorTable.cc'; fi`1206 1207 CodeTools/driver_cfa_cpp-DeclStats.o: CodeTools/DeclStats.cc1208 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeTools/driver_cfa_cpp-DeclStats.o -MD -MP -MF CodeTools/$(DEPDIR)/driver_cfa_cpp-DeclStats.Tpo -c -o CodeTools/driver_cfa_cpp-DeclStats.o `test -f 'CodeTools/DeclStats.cc' || echo '$(srcdir)/'`CodeTools/DeclStats.cc1209 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeTools/$(DEPDIR)/driver_cfa_cpp-DeclStats.Tpo CodeTools/$(DEPDIR)/driver_cfa_cpp-DeclStats.Po1210 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeTools/DeclStats.cc' object='CodeTools/driver_cfa_cpp-DeclStats.o' libtool=no @AMDEPBACKSLASH@1211 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1212 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeTools/driver_cfa_cpp-DeclStats.o `test -f 'CodeTools/DeclStats.cc' || echo '$(srcdir)/'`CodeTools/DeclStats.cc1213 1214 CodeTools/driver_cfa_cpp-DeclStats.obj: CodeTools/DeclStats.cc1215 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeTools/driver_cfa_cpp-DeclStats.obj -MD -MP -MF CodeTools/$(DEPDIR)/driver_cfa_cpp-DeclStats.Tpo -c -o CodeTools/driver_cfa_cpp-DeclStats.obj `if test -f 'CodeTools/DeclStats.cc'; then $(CYGPATH_W) 'CodeTools/DeclStats.cc'; else $(CYGPATH_W) '$(srcdir)/CodeTools/DeclStats.cc'; fi`1216 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeTools/$(DEPDIR)/driver_cfa_cpp-DeclStats.Tpo CodeTools/$(DEPDIR)/driver_cfa_cpp-DeclStats.Po1217 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeTools/DeclStats.cc' object='CodeTools/driver_cfa_cpp-DeclStats.obj' libtool=no @AMDEPBACKSLASH@1218 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1219 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeTools/driver_cfa_cpp-DeclStats.obj `if test -f 'CodeTools/DeclStats.cc'; then $(CYGPATH_W) 'CodeTools/DeclStats.cc'; else $(CYGPATH_W) '$(srcdir)/CodeTools/DeclStats.cc'; fi`1220 1221 CodeTools/driver_cfa_cpp-TrackLoc.o: CodeTools/TrackLoc.cc1222 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeTools/driver_cfa_cpp-TrackLoc.o -MD -MP -MF CodeTools/$(DEPDIR)/driver_cfa_cpp-TrackLoc.Tpo -c -o CodeTools/driver_cfa_cpp-TrackLoc.o `test -f 'CodeTools/TrackLoc.cc' || echo '$(srcdir)/'`CodeTools/TrackLoc.cc1223 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeTools/$(DEPDIR)/driver_cfa_cpp-TrackLoc.Tpo CodeTools/$(DEPDIR)/driver_cfa_cpp-TrackLoc.Po1224 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeTools/TrackLoc.cc' object='CodeTools/driver_cfa_cpp-TrackLoc.o' libtool=no @AMDEPBACKSLASH@1225 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1226 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeTools/driver_cfa_cpp-TrackLoc.o `test -f 'CodeTools/TrackLoc.cc' || echo '$(srcdir)/'`CodeTools/TrackLoc.cc1227 1228 CodeTools/driver_cfa_cpp-TrackLoc.obj: CodeTools/TrackLoc.cc1229 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeTools/driver_cfa_cpp-TrackLoc.obj -MD -MP -MF CodeTools/$(DEPDIR)/driver_cfa_cpp-TrackLoc.Tpo -c -o CodeTools/driver_cfa_cpp-TrackLoc.obj `if test -f 'CodeTools/TrackLoc.cc'; then $(CYGPATH_W) 'CodeTools/TrackLoc.cc'; else $(CYGPATH_W) '$(srcdir)/CodeTools/TrackLoc.cc'; fi`1230 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) CodeTools/$(DEPDIR)/driver_cfa_cpp-TrackLoc.Tpo CodeTools/$(DEPDIR)/driver_cfa_cpp-TrackLoc.Po1231 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CodeTools/TrackLoc.cc' object='CodeTools/driver_cfa_cpp-TrackLoc.obj' libtool=no @AMDEPBACKSLASH@1232 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1233 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeTools/driver_cfa_cpp-TrackLoc.obj `if test -f 'CodeTools/TrackLoc.cc'; then $(CYGPATH_W) 'CodeTools/TrackLoc.cc'; else $(CYGPATH_W) '$(srcdir)/CodeTools/TrackLoc.cc'; fi`1234 1235 Concurrency/driver_cfa_cpp-Keywords.o: Concurrency/Keywords.cc1236 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Concurrency/driver_cfa_cpp-Keywords.o -MD -MP -MF Concurrency/$(DEPDIR)/driver_cfa_cpp-Keywords.Tpo -c -o Concurrency/driver_cfa_cpp-Keywords.o `test -f 'Concurrency/Keywords.cc' || echo '$(srcdir)/'`Concurrency/Keywords.cc1237 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Concurrency/$(DEPDIR)/driver_cfa_cpp-Keywords.Tpo Concurrency/$(DEPDIR)/driver_cfa_cpp-Keywords.Po1238 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Concurrency/Keywords.cc' object='Concurrency/driver_cfa_cpp-Keywords.o' libtool=no @AMDEPBACKSLASH@1239 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1240 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Concurrency/driver_cfa_cpp-Keywords.o `test -f 'Concurrency/Keywords.cc' || echo '$(srcdir)/'`Concurrency/Keywords.cc1241 1242 Concurrency/driver_cfa_cpp-Keywords.obj: Concurrency/Keywords.cc1243 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Concurrency/driver_cfa_cpp-Keywords.obj -MD -MP -MF Concurrency/$(DEPDIR)/driver_cfa_cpp-Keywords.Tpo -c -o Concurrency/driver_cfa_cpp-Keywords.obj `if test -f 'Concurrency/Keywords.cc'; then $(CYGPATH_W) 'Concurrency/Keywords.cc'; else $(CYGPATH_W) '$(srcdir)/Concurrency/Keywords.cc'; fi`1244 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Concurrency/$(DEPDIR)/driver_cfa_cpp-Keywords.Tpo Concurrency/$(DEPDIR)/driver_cfa_cpp-Keywords.Po1245 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Concurrency/Keywords.cc' object='Concurrency/driver_cfa_cpp-Keywords.obj' libtool=no @AMDEPBACKSLASH@1246 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1247 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Concurrency/driver_cfa_cpp-Keywords.obj `if test -f 'Concurrency/Keywords.cc'; then $(CYGPATH_W) 'Concurrency/Keywords.cc'; else $(CYGPATH_W) '$(srcdir)/Concurrency/Keywords.cc'; fi`1248 1249 Concurrency/driver_cfa_cpp-Waitfor.o: Concurrency/Waitfor.cc1250 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Concurrency/driver_cfa_cpp-Waitfor.o -MD -MP -MF Concurrency/$(DEPDIR)/driver_cfa_cpp-Waitfor.Tpo -c -o Concurrency/driver_cfa_cpp-Waitfor.o `test -f 'Concurrency/Waitfor.cc' || echo '$(srcdir)/'`Concurrency/Waitfor.cc1251 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Concurrency/$(DEPDIR)/driver_cfa_cpp-Waitfor.Tpo Concurrency/$(DEPDIR)/driver_cfa_cpp-Waitfor.Po1252 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Concurrency/Waitfor.cc' object='Concurrency/driver_cfa_cpp-Waitfor.o' libtool=no @AMDEPBACKSLASH@1253 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1254 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Concurrency/driver_cfa_cpp-Waitfor.o `test -f 'Concurrency/Waitfor.cc' || echo '$(srcdir)/'`Concurrency/Waitfor.cc1255 1256 Concurrency/driver_cfa_cpp-Waitfor.obj: Concurrency/Waitfor.cc1257 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Concurrency/driver_cfa_cpp-Waitfor.obj -MD -MP -MF Concurrency/$(DEPDIR)/driver_cfa_cpp-Waitfor.Tpo -c -o Concurrency/driver_cfa_cpp-Waitfor.obj `if test -f 'Concurrency/Waitfor.cc'; then $(CYGPATH_W) 'Concurrency/Waitfor.cc'; else $(CYGPATH_W) '$(srcdir)/Concurrency/Waitfor.cc'; fi`1258 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Concurrency/$(DEPDIR)/driver_cfa_cpp-Waitfor.Tpo Concurrency/$(DEPDIR)/driver_cfa_cpp-Waitfor.Po1259 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Concurrency/Waitfor.cc' object='Concurrency/driver_cfa_cpp-Waitfor.obj' libtool=no @AMDEPBACKSLASH@1260 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1261 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Concurrency/driver_cfa_cpp-Waitfor.obj `if test -f 'Concurrency/Waitfor.cc'; then $(CYGPATH_W) 'Concurrency/Waitfor.cc'; else $(CYGPATH_W) '$(srcdir)/Concurrency/Waitfor.cc'; fi`1262 1263 Common/driver_cfa_cpp-SemanticError.o: Common/SemanticError.cc1264 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-SemanticError.o -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-SemanticError.Tpo -c -o Common/driver_cfa_cpp-SemanticError.o `test -f 'Common/SemanticError.cc' || echo '$(srcdir)/'`Common/SemanticError.cc1265 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-SemanticError.Tpo Common/$(DEPDIR)/driver_cfa_cpp-SemanticError.Po1266 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Common/SemanticError.cc' object='Common/driver_cfa_cpp-SemanticError.o' libtool=no @AMDEPBACKSLASH@1267 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1268 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-SemanticError.o `test -f 'Common/SemanticError.cc' || echo '$(srcdir)/'`Common/SemanticError.cc1269 1270 Common/driver_cfa_cpp-SemanticError.obj: Common/SemanticError.cc1271 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-SemanticError.obj -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-SemanticError.Tpo -c -o Common/driver_cfa_cpp-SemanticError.obj `if test -f 'Common/SemanticError.cc'; then $(CYGPATH_W) 'Common/SemanticError.cc'; else $(CYGPATH_W) '$(srcdir)/Common/SemanticError.cc'; fi`1272 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-SemanticError.Tpo Common/$(DEPDIR)/driver_cfa_cpp-SemanticError.Po1273 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Common/SemanticError.cc' object='Common/driver_cfa_cpp-SemanticError.obj' libtool=no @AMDEPBACKSLASH@1274 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1275 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-SemanticError.obj `if test -f 'Common/SemanticError.cc'; then $(CYGPATH_W) 'Common/SemanticError.cc'; else $(CYGPATH_W) '$(srcdir)/Common/SemanticError.cc'; fi`1276 1277 Common/driver_cfa_cpp-UniqueName.o: Common/UniqueName.cc1278 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-UniqueName.o -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-UniqueName.Tpo -c -o Common/driver_cfa_cpp-UniqueName.o `test -f 'Common/UniqueName.cc' || echo '$(srcdir)/'`Common/UniqueName.cc1279 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-UniqueName.Tpo Common/$(DEPDIR)/driver_cfa_cpp-UniqueName.Po1280 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Common/UniqueName.cc' object='Common/driver_cfa_cpp-UniqueName.o' libtool=no @AMDEPBACKSLASH@1281 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1282 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-UniqueName.o `test -f 'Common/UniqueName.cc' || echo '$(srcdir)/'`Common/UniqueName.cc1283 1284 Common/driver_cfa_cpp-UniqueName.obj: Common/UniqueName.cc1285 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-UniqueName.obj -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-UniqueName.Tpo -c -o Common/driver_cfa_cpp-UniqueName.obj `if test -f 'Common/UniqueName.cc'; then $(CYGPATH_W) 'Common/UniqueName.cc'; else $(CYGPATH_W) '$(srcdir)/Common/UniqueName.cc'; fi`1286 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-UniqueName.Tpo Common/$(DEPDIR)/driver_cfa_cpp-UniqueName.Po1287 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Common/UniqueName.cc' object='Common/driver_cfa_cpp-UniqueName.obj' libtool=no @AMDEPBACKSLASH@1288 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1289 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-UniqueName.obj `if test -f 'Common/UniqueName.cc'; then $(CYGPATH_W) 'Common/UniqueName.cc'; else $(CYGPATH_W) '$(srcdir)/Common/UniqueName.cc'; fi`1290 1291 Common/driver_cfa_cpp-DebugMalloc.o: Common/DebugMalloc.cc1292 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-DebugMalloc.o -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Tpo -c -o Common/driver_cfa_cpp-DebugMalloc.o `test -f 'Common/DebugMalloc.cc' || echo '$(srcdir)/'`Common/DebugMalloc.cc1293 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Tpo Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Po1294 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Common/DebugMalloc.cc' object='Common/driver_cfa_cpp-DebugMalloc.o' libtool=no @AMDEPBACKSLASH@1295 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1296 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-DebugMalloc.o `test -f 'Common/DebugMalloc.cc' || echo '$(srcdir)/'`Common/DebugMalloc.cc1297 1298 Common/driver_cfa_cpp-DebugMalloc.obj: Common/DebugMalloc.cc1299 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-DebugMalloc.obj -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Tpo -c -o Common/driver_cfa_cpp-DebugMalloc.obj `if test -f 'Common/DebugMalloc.cc'; then $(CYGPATH_W) 'Common/DebugMalloc.cc'; else $(CYGPATH_W) '$(srcdir)/Common/DebugMalloc.cc'; fi`1300 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Tpo Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Po1301 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Common/DebugMalloc.cc' object='Common/driver_cfa_cpp-DebugMalloc.obj' libtool=no @AMDEPBACKSLASH@1302 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1303 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-DebugMalloc.obj `if test -f 'Common/DebugMalloc.cc'; then $(CYGPATH_W) 'Common/DebugMalloc.cc'; else $(CYGPATH_W) '$(srcdir)/Common/DebugMalloc.cc'; fi`1304 1305 Common/driver_cfa_cpp-Assert.o: Common/Assert.cc1306 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-Assert.o -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-Assert.Tpo -c -o Common/driver_cfa_cpp-Assert.o `test -f 'Common/Assert.cc' || echo '$(srcdir)/'`Common/Assert.cc1307 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-Assert.Tpo Common/$(DEPDIR)/driver_cfa_cpp-Assert.Po1308 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Common/Assert.cc' object='Common/driver_cfa_cpp-Assert.o' libtool=no @AMDEPBACKSLASH@1309 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1310 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-Assert.o `test -f 'Common/Assert.cc' || echo '$(srcdir)/'`Common/Assert.cc1311 1312 Common/driver_cfa_cpp-Assert.obj: Common/Assert.cc1313 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-Assert.obj -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-Assert.Tpo -c -o Common/driver_cfa_cpp-Assert.obj `if test -f 'Common/Assert.cc'; then $(CYGPATH_W) 'Common/Assert.cc'; else $(CYGPATH_W) '$(srcdir)/Common/Assert.cc'; fi`1314 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Common/$(DEPDIR)/driver_cfa_cpp-Assert.Tpo Common/$(DEPDIR)/driver_cfa_cpp-Assert.Po1315 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Common/Assert.cc' object='Common/driver_cfa_cpp-Assert.obj' libtool=no @AMDEPBACKSLASH@1316 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1317 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Common/driver_cfa_cpp-Assert.obj `if test -f 'Common/Assert.cc'; then $(CYGPATH_W) 'Common/Assert.cc'; else $(CYGPATH_W) '$(srcdir)/Common/Assert.cc'; fi`1318 1319 ControlStruct/driver_cfa_cpp-LabelGenerator.o: ControlStruct/LabelGenerator.cc1320 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-LabelGenerator.o -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelGenerator.Tpo -c -o ControlStruct/driver_cfa_cpp-LabelGenerator.o `test -f 'ControlStruct/LabelGenerator.cc' || echo '$(srcdir)/'`ControlStruct/LabelGenerator.cc1321 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelGenerator.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelGenerator.Po1322 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/LabelGenerator.cc' object='ControlStruct/driver_cfa_cpp-LabelGenerator.o' libtool=no @AMDEPBACKSLASH@1323 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1324 @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-LabelGenerator.o `test -f 'ControlStruct/LabelGenerator.cc' || echo '$(srcdir)/'`ControlStruct/LabelGenerator.cc1325 1326 ControlStruct/driver_cfa_cpp-LabelGenerator.obj: ControlStruct/LabelGenerator.cc1327 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-LabelGenerator.obj -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelGenerator.Tpo -c -o ControlStruct/driver_cfa_cpp-LabelGenerator.obj `if test -f 'ControlStruct/LabelGenerator.cc'; then $(CYGPATH_W) 'ControlStruct/LabelGenerator.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/LabelGenerator.cc'; fi`1328 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelGenerator.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelGenerator.Po1329 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/LabelGenerator.cc' object='ControlStruct/driver_cfa_cpp-LabelGenerator.obj' libtool=no @AMDEPBACKSLASH@1330 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1331 @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-LabelGenerator.obj `if test -f 'ControlStruct/LabelGenerator.cc'; then $(CYGPATH_W) 'ControlStruct/LabelGenerator.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/LabelGenerator.cc'; fi`1332 1333 ControlStruct/driver_cfa_cpp-LabelFixer.o: ControlStruct/LabelFixer.cc1334 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-LabelFixer.o -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelFixer.Tpo -c -o ControlStruct/driver_cfa_cpp-LabelFixer.o `test -f 'ControlStruct/LabelFixer.cc' || echo '$(srcdir)/'`ControlStruct/LabelFixer.cc1335 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelFixer.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelFixer.Po1336 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/LabelFixer.cc' object='ControlStruct/driver_cfa_cpp-LabelFixer.o' libtool=no @AMDEPBACKSLASH@1337 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1338 @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-LabelFixer.o `test -f 'ControlStruct/LabelFixer.cc' || echo '$(srcdir)/'`ControlStruct/LabelFixer.cc1339 1340 ControlStruct/driver_cfa_cpp-LabelFixer.obj: ControlStruct/LabelFixer.cc1341 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-LabelFixer.obj -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelFixer.Tpo -c -o ControlStruct/driver_cfa_cpp-LabelFixer.obj `if test -f 'ControlStruct/LabelFixer.cc'; then $(CYGPATH_W) 'ControlStruct/LabelFixer.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/LabelFixer.cc'; fi`1342 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelFixer.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-LabelFixer.Po1343 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/LabelFixer.cc' object='ControlStruct/driver_cfa_cpp-LabelFixer.obj' libtool=no @AMDEPBACKSLASH@1344 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1345 @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-LabelFixer.obj `if test -f 'ControlStruct/LabelFixer.cc'; then $(CYGPATH_W) 'ControlStruct/LabelFixer.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/LabelFixer.cc'; fi`1346 1347 ControlStruct/driver_cfa_cpp-MLEMutator.o: ControlStruct/MLEMutator.cc1348 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-MLEMutator.o -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-MLEMutator.Tpo -c -o ControlStruct/driver_cfa_cpp-MLEMutator.o `test -f 'ControlStruct/MLEMutator.cc' || echo '$(srcdir)/'`ControlStruct/MLEMutator.cc1349 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-MLEMutator.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-MLEMutator.Po1350 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/MLEMutator.cc' object='ControlStruct/driver_cfa_cpp-MLEMutator.o' libtool=no @AMDEPBACKSLASH@1351 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1352 @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-MLEMutator.o `test -f 'ControlStruct/MLEMutator.cc' || echo '$(srcdir)/'`ControlStruct/MLEMutator.cc1353 1354 ControlStruct/driver_cfa_cpp-MLEMutator.obj: ControlStruct/MLEMutator.cc1355 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-MLEMutator.obj -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-MLEMutator.Tpo -c -o ControlStruct/driver_cfa_cpp-MLEMutator.obj `if test -f 'ControlStruct/MLEMutator.cc'; then $(CYGPATH_W) 'ControlStruct/MLEMutator.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/MLEMutator.cc'; fi`1356 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-MLEMutator.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-MLEMutator.Po1357 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/MLEMutator.cc' object='ControlStruct/driver_cfa_cpp-MLEMutator.obj' libtool=no @AMDEPBACKSLASH@1358 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1359 @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-MLEMutator.obj `if test -f 'ControlStruct/MLEMutator.cc'; then $(CYGPATH_W) 'ControlStruct/MLEMutator.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/MLEMutator.cc'; fi`1360 1361 ControlStruct/driver_cfa_cpp-Mutate.o: ControlStruct/Mutate.cc1362 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-Mutate.o -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-Mutate.Tpo -c -o ControlStruct/driver_cfa_cpp-Mutate.o `test -f 'ControlStruct/Mutate.cc' || echo '$(srcdir)/'`ControlStruct/Mutate.cc1363 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-Mutate.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-Mutate.Po1364 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/Mutate.cc' object='ControlStruct/driver_cfa_cpp-Mutate.o' libtool=no @AMDEPBACKSLASH@1365 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1366 @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-Mutate.o `test -f 'ControlStruct/Mutate.cc' || echo '$(srcdir)/'`ControlStruct/Mutate.cc1367 1368 ControlStruct/driver_cfa_cpp-Mutate.obj: ControlStruct/Mutate.cc1369 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-Mutate.obj -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-Mutate.Tpo -c -o ControlStruct/driver_cfa_cpp-Mutate.obj `if test -f 'ControlStruct/Mutate.cc'; then $(CYGPATH_W) 'ControlStruct/Mutate.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/Mutate.cc'; fi`1370 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-Mutate.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-Mutate.Po1371 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/Mutate.cc' object='ControlStruct/driver_cfa_cpp-Mutate.obj' libtool=no @AMDEPBACKSLASH@1372 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1373 @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-Mutate.obj `if test -f 'ControlStruct/Mutate.cc'; then $(CYGPATH_W) 'ControlStruct/Mutate.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/Mutate.cc'; fi`1374 1375 ControlStruct/driver_cfa_cpp-ForExprMutator.o: ControlStruct/ForExprMutator.cc1376 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-ForExprMutator.o -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-ForExprMutator.Tpo -c -o ControlStruct/driver_cfa_cpp-ForExprMutator.o `test -f 'ControlStruct/ForExprMutator.cc' || echo '$(srcdir)/'`ControlStruct/ForExprMutator.cc1377 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-ForExprMutator.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-ForExprMutator.Po1378 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/ForExprMutator.cc' object='ControlStruct/driver_cfa_cpp-ForExprMutator.o' libtool=no @AMDEPBACKSLASH@1379 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1380 @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-ForExprMutator.o `test -f 'ControlStruct/ForExprMutator.cc' || echo '$(srcdir)/'`ControlStruct/ForExprMutator.cc1381 1382 ControlStruct/driver_cfa_cpp-ForExprMutator.obj: ControlStruct/ForExprMutator.cc1383 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-ForExprMutator.obj -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-ForExprMutator.Tpo -c -o ControlStruct/driver_cfa_cpp-ForExprMutator.obj `if test -f 'ControlStruct/ForExprMutator.cc'; then $(CYGPATH_W) 'ControlStruct/ForExprMutator.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/ForExprMutator.cc'; fi`1384 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-ForExprMutator.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-ForExprMutator.Po1385 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/ForExprMutator.cc' object='ControlStruct/driver_cfa_cpp-ForExprMutator.obj' libtool=no @AMDEPBACKSLASH@1386 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1387 @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-ForExprMutator.obj `if test -f 'ControlStruct/ForExprMutator.cc'; then $(CYGPATH_W) 'ControlStruct/ForExprMutator.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/ForExprMutator.cc'; fi`1388 1389 ControlStruct/driver_cfa_cpp-ExceptTranslate.o: ControlStruct/ExceptTranslate.cc1390 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-ExceptTranslate.o -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-ExceptTranslate.Tpo -c -o ControlStruct/driver_cfa_cpp-ExceptTranslate.o `test -f 'ControlStruct/ExceptTranslate.cc' || echo '$(srcdir)/'`ControlStruct/ExceptTranslate.cc1391 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-ExceptTranslate.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-ExceptTranslate.Po1392 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/ExceptTranslate.cc' object='ControlStruct/driver_cfa_cpp-ExceptTranslate.o' libtool=no @AMDEPBACKSLASH@1393 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1394 @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-ExceptTranslate.o `test -f 'ControlStruct/ExceptTranslate.cc' || echo '$(srcdir)/'`ControlStruct/ExceptTranslate.cc1395 1396 ControlStruct/driver_cfa_cpp-ExceptTranslate.obj: ControlStruct/ExceptTranslate.cc1397 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ControlStruct/driver_cfa_cpp-ExceptTranslate.obj -MD -MP -MF ControlStruct/$(DEPDIR)/driver_cfa_cpp-ExceptTranslate.Tpo -c -o ControlStruct/driver_cfa_cpp-ExceptTranslate.obj `if test -f 'ControlStruct/ExceptTranslate.cc'; then $(CYGPATH_W) 'ControlStruct/ExceptTranslate.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/ExceptTranslate.cc'; fi`1398 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ControlStruct/$(DEPDIR)/driver_cfa_cpp-ExceptTranslate.Tpo ControlStruct/$(DEPDIR)/driver_cfa_cpp-ExceptTranslate.Po1399 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ControlStruct/ExceptTranslate.cc' object='ControlStruct/driver_cfa_cpp-ExceptTranslate.obj' libtool=no @AMDEPBACKSLASH@1400 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1401 @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-ExceptTranslate.obj `if test -f 'ControlStruct/ExceptTranslate.cc'; then $(CYGPATH_W) 'ControlStruct/ExceptTranslate.cc'; else $(CYGPATH_W) '$(srcdir)/ControlStruct/ExceptTranslate.cc'; fi`1402 1403 GenPoly/driver_cfa_cpp-Box.o: GenPoly/Box.cc1404 @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.cc1405 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-Box.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-Box.Po1406 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/Box.cc' object='GenPoly/driver_cfa_cpp-Box.o' libtool=no @AMDEPBACKSLASH@1407 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1408 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-Box.o `test -f 'GenPoly/Box.cc' || echo '$(srcdir)/'`GenPoly/Box.cc1409 1410 GenPoly/driver_cfa_cpp-Box.obj: GenPoly/Box.cc1411 @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.obj -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-Box.Tpo -c -o GenPoly/driver_cfa_cpp-Box.obj `if test -f 'GenPoly/Box.cc'; then $(CYGPATH_W) 'GenPoly/Box.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/Box.cc'; fi`1412 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-Box.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-Box.Po1413 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/Box.cc' object='GenPoly/driver_cfa_cpp-Box.obj' libtool=no @AMDEPBACKSLASH@1414 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1415 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-Box.obj `if test -f 'GenPoly/Box.cc'; then $(CYGPATH_W) 'GenPoly/Box.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/Box.cc'; fi`1416 1417 GenPoly/driver_cfa_cpp-GenPoly.o: GenPoly/GenPoly.cc1418 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-GenPoly.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-GenPoly.Tpo -c -o GenPoly/driver_cfa_cpp-GenPoly.o `test -f 'GenPoly/GenPoly.cc' || echo '$(srcdir)/'`GenPoly/GenPoly.cc1419 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-GenPoly.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-GenPoly.Po1420 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/GenPoly.cc' object='GenPoly/driver_cfa_cpp-GenPoly.o' libtool=no @AMDEPBACKSLASH@1421 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1422 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-GenPoly.o `test -f 'GenPoly/GenPoly.cc' || echo '$(srcdir)/'`GenPoly/GenPoly.cc1423 1424 GenPoly/driver_cfa_cpp-GenPoly.obj: GenPoly/GenPoly.cc1425 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-GenPoly.obj -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-GenPoly.Tpo -c -o GenPoly/driver_cfa_cpp-GenPoly.obj `if test -f 'GenPoly/GenPoly.cc'; then $(CYGPATH_W) 'GenPoly/GenPoly.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/GenPoly.cc'; fi`1426 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-GenPoly.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-GenPoly.Po1427 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/GenPoly.cc' object='GenPoly/driver_cfa_cpp-GenPoly.obj' libtool=no @AMDEPBACKSLASH@1428 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1429 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-GenPoly.obj `if test -f 'GenPoly/GenPoly.cc'; then $(CYGPATH_W) 'GenPoly/GenPoly.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/GenPoly.cc'; fi`1430 1431 GenPoly/driver_cfa_cpp-ScrubTyVars.o: GenPoly/ScrubTyVars.cc1432 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-ScrubTyVars.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-ScrubTyVars.Tpo -c -o GenPoly/driver_cfa_cpp-ScrubTyVars.o `test -f 'GenPoly/ScrubTyVars.cc' || echo '$(srcdir)/'`GenPoly/ScrubTyVars.cc1433 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-ScrubTyVars.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-ScrubTyVars.Po1434 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/ScrubTyVars.cc' object='GenPoly/driver_cfa_cpp-ScrubTyVars.o' libtool=no @AMDEPBACKSLASH@1435 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1436 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-ScrubTyVars.o `test -f 'GenPoly/ScrubTyVars.cc' || echo '$(srcdir)/'`GenPoly/ScrubTyVars.cc1437 1438 GenPoly/driver_cfa_cpp-ScrubTyVars.obj: GenPoly/ScrubTyVars.cc1439 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-ScrubTyVars.obj -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-ScrubTyVars.Tpo -c -o GenPoly/driver_cfa_cpp-ScrubTyVars.obj `if test -f 'GenPoly/ScrubTyVars.cc'; then $(CYGPATH_W) 'GenPoly/ScrubTyVars.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/ScrubTyVars.cc'; fi`1440 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-ScrubTyVars.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-ScrubTyVars.Po1441 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/ScrubTyVars.cc' object='GenPoly/driver_cfa_cpp-ScrubTyVars.obj' libtool=no @AMDEPBACKSLASH@1442 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1443 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-ScrubTyVars.obj `if test -f 'GenPoly/ScrubTyVars.cc'; then $(CYGPATH_W) 'GenPoly/ScrubTyVars.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/ScrubTyVars.cc'; fi`1444 1445 GenPoly/driver_cfa_cpp-Lvalue.o: GenPoly/Lvalue.cc1446 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-Lvalue.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-Lvalue.Tpo -c -o GenPoly/driver_cfa_cpp-Lvalue.o `test -f 'GenPoly/Lvalue.cc' || echo '$(srcdir)/'`GenPoly/Lvalue.cc1447 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-Lvalue.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-Lvalue.Po1448 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/Lvalue.cc' object='GenPoly/driver_cfa_cpp-Lvalue.o' libtool=no @AMDEPBACKSLASH@1449 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1450 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-Lvalue.o `test -f 'GenPoly/Lvalue.cc' || echo '$(srcdir)/'`GenPoly/Lvalue.cc1451 1452 GenPoly/driver_cfa_cpp-Lvalue.obj: GenPoly/Lvalue.cc1453 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-Lvalue.obj -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-Lvalue.Tpo -c -o GenPoly/driver_cfa_cpp-Lvalue.obj `if test -f 'GenPoly/Lvalue.cc'; then $(CYGPATH_W) 'GenPoly/Lvalue.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/Lvalue.cc'; fi`1454 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-Lvalue.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-Lvalue.Po1455 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/Lvalue.cc' object='GenPoly/driver_cfa_cpp-Lvalue.obj' libtool=no @AMDEPBACKSLASH@1456 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1457 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-Lvalue.obj `if test -f 'GenPoly/Lvalue.cc'; then $(CYGPATH_W) 'GenPoly/Lvalue.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/Lvalue.cc'; fi`1458 1459 GenPoly/driver_cfa_cpp-Specialize.o: GenPoly/Specialize.cc1460 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-Specialize.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-Specialize.Tpo -c -o GenPoly/driver_cfa_cpp-Specialize.o `test -f 'GenPoly/Specialize.cc' || echo '$(srcdir)/'`GenPoly/Specialize.cc1461 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-Specialize.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-Specialize.Po1462 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/Specialize.cc' object='GenPoly/driver_cfa_cpp-Specialize.o' libtool=no @AMDEPBACKSLASH@1463 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1464 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-Specialize.o `test -f 'GenPoly/Specialize.cc' || echo '$(srcdir)/'`GenPoly/Specialize.cc1465 1466 GenPoly/driver_cfa_cpp-Specialize.obj: GenPoly/Specialize.cc1467 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-Specialize.obj -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-Specialize.Tpo -c -o GenPoly/driver_cfa_cpp-Specialize.obj `if test -f 'GenPoly/Specialize.cc'; then $(CYGPATH_W) 'GenPoly/Specialize.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/Specialize.cc'; fi`1468 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-Specialize.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-Specialize.Po1469 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/Specialize.cc' object='GenPoly/driver_cfa_cpp-Specialize.obj' libtool=no @AMDEPBACKSLASH@1470 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1471 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-Specialize.obj `if test -f 'GenPoly/Specialize.cc'; then $(CYGPATH_W) 'GenPoly/Specialize.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/Specialize.cc'; fi`1472 1473 GenPoly/driver_cfa_cpp-FindFunction.o: GenPoly/FindFunction.cc1474 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-FindFunction.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-FindFunction.Tpo -c -o GenPoly/driver_cfa_cpp-FindFunction.o `test -f 'GenPoly/FindFunction.cc' || echo '$(srcdir)/'`GenPoly/FindFunction.cc1475 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-FindFunction.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-FindFunction.Po1476 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/FindFunction.cc' object='GenPoly/driver_cfa_cpp-FindFunction.o' libtool=no @AMDEPBACKSLASH@1477 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1478 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-FindFunction.o `test -f 'GenPoly/FindFunction.cc' || echo '$(srcdir)/'`GenPoly/FindFunction.cc1479 1480 GenPoly/driver_cfa_cpp-FindFunction.obj: GenPoly/FindFunction.cc1481 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-FindFunction.obj -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-FindFunction.Tpo -c -o GenPoly/driver_cfa_cpp-FindFunction.obj `if test -f 'GenPoly/FindFunction.cc'; then $(CYGPATH_W) 'GenPoly/FindFunction.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/FindFunction.cc'; fi`1482 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-FindFunction.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-FindFunction.Po1483 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/FindFunction.cc' object='GenPoly/driver_cfa_cpp-FindFunction.obj' libtool=no @AMDEPBACKSLASH@1484 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1485 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-FindFunction.obj `if test -f 'GenPoly/FindFunction.cc'; then $(CYGPATH_W) 'GenPoly/FindFunction.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/FindFunction.cc'; fi`1486 1487 GenPoly/driver_cfa_cpp-InstantiateGeneric.o: GenPoly/InstantiateGeneric.cc1488 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-InstantiateGeneric.o -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-InstantiateGeneric.Tpo -c -o GenPoly/driver_cfa_cpp-InstantiateGeneric.o `test -f 'GenPoly/InstantiateGeneric.cc' || echo '$(srcdir)/'`GenPoly/InstantiateGeneric.cc1489 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-InstantiateGeneric.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-InstantiateGeneric.Po1490 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/InstantiateGeneric.cc' object='GenPoly/driver_cfa_cpp-InstantiateGeneric.o' libtool=no @AMDEPBACKSLASH@1491 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1492 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-InstantiateGeneric.o `test -f 'GenPoly/InstantiateGeneric.cc' || echo '$(srcdir)/'`GenPoly/InstantiateGeneric.cc1493 1494 GenPoly/driver_cfa_cpp-InstantiateGeneric.obj: GenPoly/InstantiateGeneric.cc1495 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT GenPoly/driver_cfa_cpp-InstantiateGeneric.obj -MD -MP -MF GenPoly/$(DEPDIR)/driver_cfa_cpp-InstantiateGeneric.Tpo -c -o GenPoly/driver_cfa_cpp-InstantiateGeneric.obj `if test -f 'GenPoly/InstantiateGeneric.cc'; then $(CYGPATH_W) 'GenPoly/InstantiateGeneric.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/InstantiateGeneric.cc'; fi`1496 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) GenPoly/$(DEPDIR)/driver_cfa_cpp-InstantiateGeneric.Tpo GenPoly/$(DEPDIR)/driver_cfa_cpp-InstantiateGeneric.Po1497 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GenPoly/InstantiateGeneric.cc' object='GenPoly/driver_cfa_cpp-InstantiateGeneric.obj' libtool=no @AMDEPBACKSLASH@1498 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1499 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o GenPoly/driver_cfa_cpp-InstantiateGeneric.obj `if test -f 'GenPoly/InstantiateGeneric.cc'; then $(CYGPATH_W) 'GenPoly/InstantiateGeneric.cc'; else $(CYGPATH_W) '$(srcdir)/GenPoly/InstantiateGeneric.cc'; fi`1500 1501 InitTweak/driver_cfa_cpp-GenInit.o: InitTweak/GenInit.cc1502 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/driver_cfa_cpp-GenInit.o -MD -MP -MF InitTweak/$(DEPDIR)/driver_cfa_cpp-GenInit.Tpo -c -o InitTweak/driver_cfa_cpp-GenInit.o `test -f 'InitTweak/GenInit.cc' || echo '$(srcdir)/'`InitTweak/GenInit.cc1503 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) InitTweak/$(DEPDIR)/driver_cfa_cpp-GenInit.Tpo InitTweak/$(DEPDIR)/driver_cfa_cpp-GenInit.Po1504 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='InitTweak/GenInit.cc' object='InitTweak/driver_cfa_cpp-GenInit.o' libtool=no @AMDEPBACKSLASH@1505 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1506 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/driver_cfa_cpp-GenInit.o `test -f 'InitTweak/GenInit.cc' || echo '$(srcdir)/'`InitTweak/GenInit.cc1507 1508 InitTweak/driver_cfa_cpp-GenInit.obj: InitTweak/GenInit.cc1509 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/driver_cfa_cpp-GenInit.obj -MD -MP -MF InitTweak/$(DEPDIR)/driver_cfa_cpp-GenInit.Tpo -c -o InitTweak/driver_cfa_cpp-GenInit.obj `if test -f 'InitTweak/GenInit.cc'; then $(CYGPATH_W) 'InitTweak/GenInit.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/GenInit.cc'; fi`1510 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) InitTweak/$(DEPDIR)/driver_cfa_cpp-GenInit.Tpo InitTweak/$(DEPDIR)/driver_cfa_cpp-GenInit.Po1511 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='InitTweak/GenInit.cc' object='InitTweak/driver_cfa_cpp-GenInit.obj' libtool=no @AMDEPBACKSLASH@1512 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1513 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/driver_cfa_cpp-GenInit.obj `if test -f 'InitTweak/GenInit.cc'; then $(CYGPATH_W) 'InitTweak/GenInit.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/GenInit.cc'; fi`1514 1515 InitTweak/driver_cfa_cpp-FixInit.o: InitTweak/FixInit.cc1516 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/driver_cfa_cpp-FixInit.o -MD -MP -MF InitTweak/$(DEPDIR)/driver_cfa_cpp-FixInit.Tpo -c -o InitTweak/driver_cfa_cpp-FixInit.o `test -f 'InitTweak/FixInit.cc' || echo '$(srcdir)/'`InitTweak/FixInit.cc1517 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) InitTweak/$(DEPDIR)/driver_cfa_cpp-FixInit.Tpo InitTweak/$(DEPDIR)/driver_cfa_cpp-FixInit.Po1518 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='InitTweak/FixInit.cc' object='InitTweak/driver_cfa_cpp-FixInit.o' libtool=no @AMDEPBACKSLASH@1519 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1520 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/driver_cfa_cpp-FixInit.o `test -f 'InitTweak/FixInit.cc' || echo '$(srcdir)/'`InitTweak/FixInit.cc1521 1522 InitTweak/driver_cfa_cpp-FixInit.obj: InitTweak/FixInit.cc1523 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/driver_cfa_cpp-FixInit.obj -MD -MP -MF InitTweak/$(DEPDIR)/driver_cfa_cpp-FixInit.Tpo -c -o InitTweak/driver_cfa_cpp-FixInit.obj `if test -f 'InitTweak/FixInit.cc'; then $(CYGPATH_W) 'InitTweak/FixInit.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/FixInit.cc'; fi`1524 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) InitTweak/$(DEPDIR)/driver_cfa_cpp-FixInit.Tpo InitTweak/$(DEPDIR)/driver_cfa_cpp-FixInit.Po1525 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='InitTweak/FixInit.cc' object='InitTweak/driver_cfa_cpp-FixInit.obj' libtool=no @AMDEPBACKSLASH@1526 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1527 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/driver_cfa_cpp-FixInit.obj `if test -f 'InitTweak/FixInit.cc'; then $(CYGPATH_W) 'InitTweak/FixInit.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/FixInit.cc'; fi`1528 1529 InitTweak/driver_cfa_cpp-FixGlobalInit.o: InitTweak/FixGlobalInit.cc1530 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/driver_cfa_cpp-FixGlobalInit.o -MD -MP -MF InitTweak/$(DEPDIR)/driver_cfa_cpp-FixGlobalInit.Tpo -c -o InitTweak/driver_cfa_cpp-FixGlobalInit.o `test -f 'InitTweak/FixGlobalInit.cc' || echo '$(srcdir)/'`InitTweak/FixGlobalInit.cc1531 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) InitTweak/$(DEPDIR)/driver_cfa_cpp-FixGlobalInit.Tpo InitTweak/$(DEPDIR)/driver_cfa_cpp-FixGlobalInit.Po1532 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='InitTweak/FixGlobalInit.cc' object='InitTweak/driver_cfa_cpp-FixGlobalInit.o' libtool=no @AMDEPBACKSLASH@1533 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1534 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/driver_cfa_cpp-FixGlobalInit.o `test -f 'InitTweak/FixGlobalInit.cc' || echo '$(srcdir)/'`InitTweak/FixGlobalInit.cc1535 1536 InitTweak/driver_cfa_cpp-FixGlobalInit.obj: InitTweak/FixGlobalInit.cc1537 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/driver_cfa_cpp-FixGlobalInit.obj -MD -MP -MF InitTweak/$(DEPDIR)/driver_cfa_cpp-FixGlobalInit.Tpo -c -o InitTweak/driver_cfa_cpp-FixGlobalInit.obj `if test -f 'InitTweak/FixGlobalInit.cc'; then $(CYGPATH_W) 'InitTweak/FixGlobalInit.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/FixGlobalInit.cc'; fi`1538 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) InitTweak/$(DEPDIR)/driver_cfa_cpp-FixGlobalInit.Tpo InitTweak/$(DEPDIR)/driver_cfa_cpp-FixGlobalInit.Po1539 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='InitTweak/FixGlobalInit.cc' object='InitTweak/driver_cfa_cpp-FixGlobalInit.obj' libtool=no @AMDEPBACKSLASH@1540 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1541 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/driver_cfa_cpp-FixGlobalInit.obj `if test -f 'InitTweak/FixGlobalInit.cc'; then $(CYGPATH_W) 'InitTweak/FixGlobalInit.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/FixGlobalInit.cc'; fi`1542 1543 InitTweak/driver_cfa_cpp-InitTweak.o: InitTweak/InitTweak.cc1544 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/driver_cfa_cpp-InitTweak.o -MD -MP -MF InitTweak/$(DEPDIR)/driver_cfa_cpp-InitTweak.Tpo -c -o InitTweak/driver_cfa_cpp-InitTweak.o `test -f 'InitTweak/InitTweak.cc' || echo '$(srcdir)/'`InitTweak/InitTweak.cc1545 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) InitTweak/$(DEPDIR)/driver_cfa_cpp-InitTweak.Tpo InitTweak/$(DEPDIR)/driver_cfa_cpp-InitTweak.Po1546 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='InitTweak/InitTweak.cc' object='InitTweak/driver_cfa_cpp-InitTweak.o' libtool=no @AMDEPBACKSLASH@1547 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1548 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/driver_cfa_cpp-InitTweak.o `test -f 'InitTweak/InitTweak.cc' || echo '$(srcdir)/'`InitTweak/InitTweak.cc1549 1550 InitTweak/driver_cfa_cpp-InitTweak.obj: InitTweak/InitTweak.cc1551 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/driver_cfa_cpp-InitTweak.obj -MD -MP -MF InitTweak/$(DEPDIR)/driver_cfa_cpp-InitTweak.Tpo -c -o InitTweak/driver_cfa_cpp-InitTweak.obj `if test -f 'InitTweak/InitTweak.cc'; then $(CYGPATH_W) 'InitTweak/InitTweak.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/InitTweak.cc'; fi`1552 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) InitTweak/$(DEPDIR)/driver_cfa_cpp-InitTweak.Tpo InitTweak/$(DEPDIR)/driver_cfa_cpp-InitTweak.Po1553 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='InitTweak/InitTweak.cc' object='InitTweak/driver_cfa_cpp-InitTweak.obj' libtool=no @AMDEPBACKSLASH@1554 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1555 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/driver_cfa_cpp-InitTweak.obj `if test -f 'InitTweak/InitTweak.cc'; then $(CYGPATH_W) 'InitTweak/InitTweak.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/InitTweak.cc'; fi`1556 1557 Parser/driver_cfa_cpp-parser.o: Parser/parser.cc1558 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-parser.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-parser.Tpo -c -o Parser/driver_cfa_cpp-parser.o `test -f 'Parser/parser.cc' || echo '$(srcdir)/'`Parser/parser.cc1559 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-parser.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-parser.Po1560 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/parser.cc' object='Parser/driver_cfa_cpp-parser.o' libtool=no @AMDEPBACKSLASH@1561 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1562 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-parser.o `test -f 'Parser/parser.cc' || echo '$(srcdir)/'`Parser/parser.cc1563 1564 Parser/driver_cfa_cpp-parser.obj: Parser/parser.cc1565 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-parser.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-parser.Tpo -c -o Parser/driver_cfa_cpp-parser.obj `if test -f 'Parser/parser.cc'; then $(CYGPATH_W) 'Parser/parser.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/parser.cc'; fi`1566 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-parser.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-parser.Po1567 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/parser.cc' object='Parser/driver_cfa_cpp-parser.obj' libtool=no @AMDEPBACKSLASH@1568 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1569 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-parser.obj `if test -f 'Parser/parser.cc'; then $(CYGPATH_W) 'Parser/parser.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/parser.cc'; fi`1570 1571 Parser/driver_cfa_cpp-lex.o: Parser/lex.cc1572 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-lex.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-lex.Tpo -c -o Parser/driver_cfa_cpp-lex.o `test -f 'Parser/lex.cc' || echo '$(srcdir)/'`Parser/lex.cc1573 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-lex.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-lex.Po1574 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/lex.cc' object='Parser/driver_cfa_cpp-lex.o' libtool=no @AMDEPBACKSLASH@1575 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1576 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-lex.o `test -f 'Parser/lex.cc' || echo '$(srcdir)/'`Parser/lex.cc1577 1578 Parser/driver_cfa_cpp-lex.obj: Parser/lex.cc1579 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-lex.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-lex.Tpo -c -o Parser/driver_cfa_cpp-lex.obj `if test -f 'Parser/lex.cc'; then $(CYGPATH_W) 'Parser/lex.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/lex.cc'; fi`1580 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-lex.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-lex.Po1581 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/lex.cc' object='Parser/driver_cfa_cpp-lex.obj' libtool=no @AMDEPBACKSLASH@1582 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1583 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-lex.obj `if test -f 'Parser/lex.cc'; then $(CYGPATH_W) 'Parser/lex.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/lex.cc'; fi`1584 1585 Parser/driver_cfa_cpp-TypedefTable.o: Parser/TypedefTable.cc1586 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-TypedefTable.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-TypedefTable.Tpo -c -o Parser/driver_cfa_cpp-TypedefTable.o `test -f 'Parser/TypedefTable.cc' || echo '$(srcdir)/'`Parser/TypedefTable.cc1587 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-TypedefTable.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-TypedefTable.Po1588 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/TypedefTable.cc' object='Parser/driver_cfa_cpp-TypedefTable.o' libtool=no @AMDEPBACKSLASH@1589 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1590 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-TypedefTable.o `test -f 'Parser/TypedefTable.cc' || echo '$(srcdir)/'`Parser/TypedefTable.cc1591 1592 Parser/driver_cfa_cpp-TypedefTable.obj: Parser/TypedefTable.cc1593 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-TypedefTable.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-TypedefTable.Tpo -c -o Parser/driver_cfa_cpp-TypedefTable.obj `if test -f 'Parser/TypedefTable.cc'; then $(CYGPATH_W) 'Parser/TypedefTable.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/TypedefTable.cc'; fi`1594 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-TypedefTable.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-TypedefTable.Po1595 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/TypedefTable.cc' object='Parser/driver_cfa_cpp-TypedefTable.obj' libtool=no @AMDEPBACKSLASH@1596 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1597 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-TypedefTable.obj `if test -f 'Parser/TypedefTable.cc'; then $(CYGPATH_W) 'Parser/TypedefTable.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/TypedefTable.cc'; fi`1598 1599 Parser/driver_cfa_cpp-ParseNode.o: Parser/ParseNode.cc1600 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-ParseNode.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-ParseNode.Tpo -c -o Parser/driver_cfa_cpp-ParseNode.o `test -f 'Parser/ParseNode.cc' || echo '$(srcdir)/'`Parser/ParseNode.cc1601 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-ParseNode.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-ParseNode.Po1602 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/ParseNode.cc' object='Parser/driver_cfa_cpp-ParseNode.o' libtool=no @AMDEPBACKSLASH@1603 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1604 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-ParseNode.o `test -f 'Parser/ParseNode.cc' || echo '$(srcdir)/'`Parser/ParseNode.cc1605 1606 Parser/driver_cfa_cpp-ParseNode.obj: Parser/ParseNode.cc1607 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-ParseNode.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-ParseNode.Tpo -c -o Parser/driver_cfa_cpp-ParseNode.obj `if test -f 'Parser/ParseNode.cc'; then $(CYGPATH_W) 'Parser/ParseNode.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/ParseNode.cc'; fi`1608 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-ParseNode.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-ParseNode.Po1609 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/ParseNode.cc' object='Parser/driver_cfa_cpp-ParseNode.obj' libtool=no @AMDEPBACKSLASH@1610 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1611 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-ParseNode.obj `if test -f 'Parser/ParseNode.cc'; then $(CYGPATH_W) 'Parser/ParseNode.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/ParseNode.cc'; fi`1612 1613 Parser/driver_cfa_cpp-DeclarationNode.o: Parser/DeclarationNode.cc1614 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-DeclarationNode.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-DeclarationNode.Tpo -c -o Parser/driver_cfa_cpp-DeclarationNode.o `test -f 'Parser/DeclarationNode.cc' || echo '$(srcdir)/'`Parser/DeclarationNode.cc1615 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-DeclarationNode.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-DeclarationNode.Po1616 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/DeclarationNode.cc' object='Parser/driver_cfa_cpp-DeclarationNode.o' libtool=no @AMDEPBACKSLASH@1617 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1618 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-DeclarationNode.o `test -f 'Parser/DeclarationNode.cc' || echo '$(srcdir)/'`Parser/DeclarationNode.cc1619 1620 Parser/driver_cfa_cpp-DeclarationNode.obj: Parser/DeclarationNode.cc1621 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-DeclarationNode.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-DeclarationNode.Tpo -c -o Parser/driver_cfa_cpp-DeclarationNode.obj `if test -f 'Parser/DeclarationNode.cc'; then $(CYGPATH_W) 'Parser/DeclarationNode.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/DeclarationNode.cc'; fi`1622 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-DeclarationNode.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-DeclarationNode.Po1623 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/DeclarationNode.cc' object='Parser/driver_cfa_cpp-DeclarationNode.obj' libtool=no @AMDEPBACKSLASH@1624 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1625 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-DeclarationNode.obj `if test -f 'Parser/DeclarationNode.cc'; then $(CYGPATH_W) 'Parser/DeclarationNode.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/DeclarationNode.cc'; fi`1626 1627 Parser/driver_cfa_cpp-ExpressionNode.o: Parser/ExpressionNode.cc1628 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-ExpressionNode.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-ExpressionNode.Tpo -c -o Parser/driver_cfa_cpp-ExpressionNode.o `test -f 'Parser/ExpressionNode.cc' || echo '$(srcdir)/'`Parser/ExpressionNode.cc1629 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-ExpressionNode.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-ExpressionNode.Po1630 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/ExpressionNode.cc' object='Parser/driver_cfa_cpp-ExpressionNode.o' libtool=no @AMDEPBACKSLASH@1631 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1632 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-ExpressionNode.o `test -f 'Parser/ExpressionNode.cc' || echo '$(srcdir)/'`Parser/ExpressionNode.cc1633 1634 Parser/driver_cfa_cpp-ExpressionNode.obj: Parser/ExpressionNode.cc1635 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-ExpressionNode.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-ExpressionNode.Tpo -c -o Parser/driver_cfa_cpp-ExpressionNode.obj `if test -f 'Parser/ExpressionNode.cc'; then $(CYGPATH_W) 'Parser/ExpressionNode.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/ExpressionNode.cc'; fi`1636 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-ExpressionNode.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-ExpressionNode.Po1637 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/ExpressionNode.cc' object='Parser/driver_cfa_cpp-ExpressionNode.obj' libtool=no @AMDEPBACKSLASH@1638 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1639 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-ExpressionNode.obj `if test -f 'Parser/ExpressionNode.cc'; then $(CYGPATH_W) 'Parser/ExpressionNode.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/ExpressionNode.cc'; fi`1640 1641 Parser/driver_cfa_cpp-StatementNode.o: Parser/StatementNode.cc1642 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-StatementNode.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-StatementNode.Tpo -c -o Parser/driver_cfa_cpp-StatementNode.o `test -f 'Parser/StatementNode.cc' || echo '$(srcdir)/'`Parser/StatementNode.cc1643 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-StatementNode.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-StatementNode.Po1644 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/StatementNode.cc' object='Parser/driver_cfa_cpp-StatementNode.o' libtool=no @AMDEPBACKSLASH@1645 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1646 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-StatementNode.o `test -f 'Parser/StatementNode.cc' || echo '$(srcdir)/'`Parser/StatementNode.cc1647 1648 Parser/driver_cfa_cpp-StatementNode.obj: Parser/StatementNode.cc1649 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-StatementNode.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-StatementNode.Tpo -c -o Parser/driver_cfa_cpp-StatementNode.obj `if test -f 'Parser/StatementNode.cc'; then $(CYGPATH_W) 'Parser/StatementNode.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/StatementNode.cc'; fi`1650 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-StatementNode.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-StatementNode.Po1651 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/StatementNode.cc' object='Parser/driver_cfa_cpp-StatementNode.obj' libtool=no @AMDEPBACKSLASH@1652 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1653 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-StatementNode.obj `if test -f 'Parser/StatementNode.cc'; then $(CYGPATH_W) 'Parser/StatementNode.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/StatementNode.cc'; fi`1654 1655 Parser/driver_cfa_cpp-InitializerNode.o: Parser/InitializerNode.cc1656 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-InitializerNode.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-InitializerNode.Tpo -c -o Parser/driver_cfa_cpp-InitializerNode.o `test -f 'Parser/InitializerNode.cc' || echo '$(srcdir)/'`Parser/InitializerNode.cc1657 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-InitializerNode.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-InitializerNode.Po1658 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/InitializerNode.cc' object='Parser/driver_cfa_cpp-InitializerNode.o' libtool=no @AMDEPBACKSLASH@1659 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1660 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-InitializerNode.o `test -f 'Parser/InitializerNode.cc' || echo '$(srcdir)/'`Parser/InitializerNode.cc1661 1662 Parser/driver_cfa_cpp-InitializerNode.obj: Parser/InitializerNode.cc1663 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-InitializerNode.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-InitializerNode.Tpo -c -o Parser/driver_cfa_cpp-InitializerNode.obj `if test -f 'Parser/InitializerNode.cc'; then $(CYGPATH_W) 'Parser/InitializerNode.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/InitializerNode.cc'; fi`1664 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-InitializerNode.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-InitializerNode.Po1665 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/InitializerNode.cc' object='Parser/driver_cfa_cpp-InitializerNode.obj' libtool=no @AMDEPBACKSLASH@1666 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1667 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-InitializerNode.obj `if test -f 'Parser/InitializerNode.cc'; then $(CYGPATH_W) 'Parser/InitializerNode.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/InitializerNode.cc'; fi`1668 1669 Parser/driver_cfa_cpp-TypeData.o: Parser/TypeData.cc1670 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-TypeData.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-TypeData.Tpo -c -o Parser/driver_cfa_cpp-TypeData.o `test -f 'Parser/TypeData.cc' || echo '$(srcdir)/'`Parser/TypeData.cc1671 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-TypeData.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-TypeData.Po1672 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/TypeData.cc' object='Parser/driver_cfa_cpp-TypeData.o' libtool=no @AMDEPBACKSLASH@1673 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1674 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-TypeData.o `test -f 'Parser/TypeData.cc' || echo '$(srcdir)/'`Parser/TypeData.cc1675 1676 Parser/driver_cfa_cpp-TypeData.obj: Parser/TypeData.cc1677 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-TypeData.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-TypeData.Tpo -c -o Parser/driver_cfa_cpp-TypeData.obj `if test -f 'Parser/TypeData.cc'; then $(CYGPATH_W) 'Parser/TypeData.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/TypeData.cc'; fi`1678 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-TypeData.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-TypeData.Po1679 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/TypeData.cc' object='Parser/driver_cfa_cpp-TypeData.obj' libtool=no @AMDEPBACKSLASH@1680 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1681 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-TypeData.obj `if test -f 'Parser/TypeData.cc'; then $(CYGPATH_W) 'Parser/TypeData.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/TypeData.cc'; fi`1682 1683 Parser/driver_cfa_cpp-LinkageSpec.o: Parser/LinkageSpec.cc1684 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-LinkageSpec.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-LinkageSpec.Tpo -c -o Parser/driver_cfa_cpp-LinkageSpec.o `test -f 'Parser/LinkageSpec.cc' || echo '$(srcdir)/'`Parser/LinkageSpec.cc1685 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-LinkageSpec.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-LinkageSpec.Po1686 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/LinkageSpec.cc' object='Parser/driver_cfa_cpp-LinkageSpec.o' libtool=no @AMDEPBACKSLASH@1687 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1688 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-LinkageSpec.o `test -f 'Parser/LinkageSpec.cc' || echo '$(srcdir)/'`Parser/LinkageSpec.cc1689 1690 Parser/driver_cfa_cpp-LinkageSpec.obj: Parser/LinkageSpec.cc1691 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-LinkageSpec.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-LinkageSpec.Tpo -c -o Parser/driver_cfa_cpp-LinkageSpec.obj `if test -f 'Parser/LinkageSpec.cc'; then $(CYGPATH_W) 'Parser/LinkageSpec.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/LinkageSpec.cc'; fi`1692 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-LinkageSpec.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-LinkageSpec.Po1693 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/LinkageSpec.cc' object='Parser/driver_cfa_cpp-LinkageSpec.obj' libtool=no @AMDEPBACKSLASH@1694 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1695 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-LinkageSpec.obj `if test -f 'Parser/LinkageSpec.cc'; then $(CYGPATH_W) 'Parser/LinkageSpec.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/LinkageSpec.cc'; fi`1696 1697 Parser/driver_cfa_cpp-parserutility.o: Parser/parserutility.cc1698 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-parserutility.o -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-parserutility.Tpo -c -o Parser/driver_cfa_cpp-parserutility.o `test -f 'Parser/parserutility.cc' || echo '$(srcdir)/'`Parser/parserutility.cc1699 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-parserutility.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-parserutility.Po1700 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/parserutility.cc' object='Parser/driver_cfa_cpp-parserutility.o' libtool=no @AMDEPBACKSLASH@1701 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1702 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-parserutility.o `test -f 'Parser/parserutility.cc' || echo '$(srcdir)/'`Parser/parserutility.cc1703 1704 Parser/driver_cfa_cpp-parserutility.obj: Parser/parserutility.cc1705 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/driver_cfa_cpp-parserutility.obj -MD -MP -MF Parser/$(DEPDIR)/driver_cfa_cpp-parserutility.Tpo -c -o Parser/driver_cfa_cpp-parserutility.obj `if test -f 'Parser/parserutility.cc'; then $(CYGPATH_W) 'Parser/parserutility.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/parserutility.cc'; fi`1706 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Parser/$(DEPDIR)/driver_cfa_cpp-parserutility.Tpo Parser/$(DEPDIR)/driver_cfa_cpp-parserutility.Po1707 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Parser/parserutility.cc' object='Parser/driver_cfa_cpp-parserutility.obj' libtool=no @AMDEPBACKSLASH@1708 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1709 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Parser/driver_cfa_cpp-parserutility.obj `if test -f 'Parser/parserutility.cc'; then $(CYGPATH_W) 'Parser/parserutility.cc'; else $(CYGPATH_W) '$(srcdir)/Parser/parserutility.cc'; fi`1710 1711 ResolvExpr/driver_cfa_cpp-AlternativeFinder.o: ResolvExpr/AlternativeFinder.cc1712 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-AlternativeFinder.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativeFinder.Tpo -c -o ResolvExpr/driver_cfa_cpp-AlternativeFinder.o `test -f 'ResolvExpr/AlternativeFinder.cc' || echo '$(srcdir)/'`ResolvExpr/AlternativeFinder.cc1713 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativeFinder.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativeFinder.Po1714 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/AlternativeFinder.cc' object='ResolvExpr/driver_cfa_cpp-AlternativeFinder.o' libtool=no @AMDEPBACKSLASH@1715 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1716 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-AlternativeFinder.o `test -f 'ResolvExpr/AlternativeFinder.cc' || echo '$(srcdir)/'`ResolvExpr/AlternativeFinder.cc1717 1718 ResolvExpr/driver_cfa_cpp-AlternativeFinder.obj: ResolvExpr/AlternativeFinder.cc1719 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-AlternativeFinder.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativeFinder.Tpo -c -o ResolvExpr/driver_cfa_cpp-AlternativeFinder.obj `if test -f 'ResolvExpr/AlternativeFinder.cc'; then $(CYGPATH_W) 'ResolvExpr/AlternativeFinder.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/AlternativeFinder.cc'; fi`1720 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativeFinder.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativeFinder.Po1721 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/AlternativeFinder.cc' object='ResolvExpr/driver_cfa_cpp-AlternativeFinder.obj' libtool=no @AMDEPBACKSLASH@1722 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1723 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-AlternativeFinder.obj `if test -f 'ResolvExpr/AlternativeFinder.cc'; then $(CYGPATH_W) 'ResolvExpr/AlternativeFinder.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/AlternativeFinder.cc'; fi`1724 1725 ResolvExpr/driver_cfa_cpp-Alternative.o: ResolvExpr/Alternative.cc1726 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-Alternative.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Alternative.Tpo -c -o ResolvExpr/driver_cfa_cpp-Alternative.o `test -f 'ResolvExpr/Alternative.cc' || echo '$(srcdir)/'`ResolvExpr/Alternative.cc1727 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Alternative.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Alternative.Po1728 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/Alternative.cc' object='ResolvExpr/driver_cfa_cpp-Alternative.o' libtool=no @AMDEPBACKSLASH@1729 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1730 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-Alternative.o `test -f 'ResolvExpr/Alternative.cc' || echo '$(srcdir)/'`ResolvExpr/Alternative.cc1731 1732 ResolvExpr/driver_cfa_cpp-Alternative.obj: ResolvExpr/Alternative.cc1733 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-Alternative.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Alternative.Tpo -c -o ResolvExpr/driver_cfa_cpp-Alternative.obj `if test -f 'ResolvExpr/Alternative.cc'; then $(CYGPATH_W) 'ResolvExpr/Alternative.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/Alternative.cc'; fi`1734 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Alternative.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Alternative.Po1735 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/Alternative.cc' object='ResolvExpr/driver_cfa_cpp-Alternative.obj' libtool=no @AMDEPBACKSLASH@1736 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1737 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-Alternative.obj `if test -f 'ResolvExpr/Alternative.cc'; then $(CYGPATH_W) 'ResolvExpr/Alternative.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/Alternative.cc'; fi`1738 1739 ResolvExpr/driver_cfa_cpp-Unify.o: ResolvExpr/Unify.cc1740 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-Unify.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Unify.Tpo -c -o ResolvExpr/driver_cfa_cpp-Unify.o `test -f 'ResolvExpr/Unify.cc' || echo '$(srcdir)/'`ResolvExpr/Unify.cc1741 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Unify.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Unify.Po1742 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/Unify.cc' object='ResolvExpr/driver_cfa_cpp-Unify.o' libtool=no @AMDEPBACKSLASH@1743 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1744 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-Unify.o `test -f 'ResolvExpr/Unify.cc' || echo '$(srcdir)/'`ResolvExpr/Unify.cc1745 1746 ResolvExpr/driver_cfa_cpp-Unify.obj: ResolvExpr/Unify.cc1747 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-Unify.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Unify.Tpo -c -o ResolvExpr/driver_cfa_cpp-Unify.obj `if test -f 'ResolvExpr/Unify.cc'; then $(CYGPATH_W) 'ResolvExpr/Unify.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/Unify.cc'; fi`1748 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Unify.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Unify.Po1749 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/Unify.cc' object='ResolvExpr/driver_cfa_cpp-Unify.obj' libtool=no @AMDEPBACKSLASH@1750 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1751 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-Unify.obj `if test -f 'ResolvExpr/Unify.cc'; then $(CYGPATH_W) 'ResolvExpr/Unify.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/Unify.cc'; fi`1752 1753 ResolvExpr/driver_cfa_cpp-PtrsAssignable.o: ResolvExpr/PtrsAssignable.cc1754 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-PtrsAssignable.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsAssignable.Tpo -c -o ResolvExpr/driver_cfa_cpp-PtrsAssignable.o `test -f 'ResolvExpr/PtrsAssignable.cc' || echo '$(srcdir)/'`ResolvExpr/PtrsAssignable.cc1755 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsAssignable.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsAssignable.Po1756 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/PtrsAssignable.cc' object='ResolvExpr/driver_cfa_cpp-PtrsAssignable.o' libtool=no @AMDEPBACKSLASH@1757 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1758 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-PtrsAssignable.o `test -f 'ResolvExpr/PtrsAssignable.cc' || echo '$(srcdir)/'`ResolvExpr/PtrsAssignable.cc1759 1760 ResolvExpr/driver_cfa_cpp-PtrsAssignable.obj: ResolvExpr/PtrsAssignable.cc1761 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-PtrsAssignable.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsAssignable.Tpo -c -o ResolvExpr/driver_cfa_cpp-PtrsAssignable.obj `if test -f 'ResolvExpr/PtrsAssignable.cc'; then $(CYGPATH_W) 'ResolvExpr/PtrsAssignable.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/PtrsAssignable.cc'; fi`1762 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsAssignable.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsAssignable.Po1763 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/PtrsAssignable.cc' object='ResolvExpr/driver_cfa_cpp-PtrsAssignable.obj' libtool=no @AMDEPBACKSLASH@1764 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1765 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-PtrsAssignable.obj `if test -f 'ResolvExpr/PtrsAssignable.cc'; then $(CYGPATH_W) 'ResolvExpr/PtrsAssignable.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/PtrsAssignable.cc'; fi`1766 1767 ResolvExpr/driver_cfa_cpp-CommonType.o: ResolvExpr/CommonType.cc1768 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-CommonType.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CommonType.Tpo -c -o ResolvExpr/driver_cfa_cpp-CommonType.o `test -f 'ResolvExpr/CommonType.cc' || echo '$(srcdir)/'`ResolvExpr/CommonType.cc1769 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CommonType.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CommonType.Po1770 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/CommonType.cc' object='ResolvExpr/driver_cfa_cpp-CommonType.o' libtool=no @AMDEPBACKSLASH@1771 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1772 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-CommonType.o `test -f 'ResolvExpr/CommonType.cc' || echo '$(srcdir)/'`ResolvExpr/CommonType.cc1773 1774 ResolvExpr/driver_cfa_cpp-CommonType.obj: ResolvExpr/CommonType.cc1775 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-CommonType.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CommonType.Tpo -c -o ResolvExpr/driver_cfa_cpp-CommonType.obj `if test -f 'ResolvExpr/CommonType.cc'; then $(CYGPATH_W) 'ResolvExpr/CommonType.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/CommonType.cc'; fi`1776 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CommonType.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CommonType.Po1777 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/CommonType.cc' object='ResolvExpr/driver_cfa_cpp-CommonType.obj' libtool=no @AMDEPBACKSLASH@1778 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1779 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-CommonType.obj `if test -f 'ResolvExpr/CommonType.cc'; then $(CYGPATH_W) 'ResolvExpr/CommonType.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/CommonType.cc'; fi`1780 1781 ResolvExpr/driver_cfa_cpp-ConversionCost.o: ResolvExpr/ConversionCost.cc1782 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-ConversionCost.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ConversionCost.Tpo -c -o ResolvExpr/driver_cfa_cpp-ConversionCost.o `test -f 'ResolvExpr/ConversionCost.cc' || echo '$(srcdir)/'`ResolvExpr/ConversionCost.cc1783 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ConversionCost.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ConversionCost.Po1784 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/ConversionCost.cc' object='ResolvExpr/driver_cfa_cpp-ConversionCost.o' libtool=no @AMDEPBACKSLASH@1785 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1786 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-ConversionCost.o `test -f 'ResolvExpr/ConversionCost.cc' || echo '$(srcdir)/'`ResolvExpr/ConversionCost.cc1787 1788 ResolvExpr/driver_cfa_cpp-ConversionCost.obj: ResolvExpr/ConversionCost.cc1789 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-ConversionCost.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ConversionCost.Tpo -c -o ResolvExpr/driver_cfa_cpp-ConversionCost.obj `if test -f 'ResolvExpr/ConversionCost.cc'; then $(CYGPATH_W) 'ResolvExpr/ConversionCost.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/ConversionCost.cc'; fi`1790 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ConversionCost.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ConversionCost.Po1791 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/ConversionCost.cc' object='ResolvExpr/driver_cfa_cpp-ConversionCost.obj' libtool=no @AMDEPBACKSLASH@1792 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1793 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-ConversionCost.obj `if test -f 'ResolvExpr/ConversionCost.cc'; then $(CYGPATH_W) 'ResolvExpr/ConversionCost.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/ConversionCost.cc'; fi`1794 1795 ResolvExpr/driver_cfa_cpp-CastCost.o: ResolvExpr/CastCost.cc1796 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-CastCost.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CastCost.Tpo -c -o ResolvExpr/driver_cfa_cpp-CastCost.o `test -f 'ResolvExpr/CastCost.cc' || echo '$(srcdir)/'`ResolvExpr/CastCost.cc1797 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CastCost.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CastCost.Po1798 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/CastCost.cc' object='ResolvExpr/driver_cfa_cpp-CastCost.o' libtool=no @AMDEPBACKSLASH@1799 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1800 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-CastCost.o `test -f 'ResolvExpr/CastCost.cc' || echo '$(srcdir)/'`ResolvExpr/CastCost.cc1801 1802 ResolvExpr/driver_cfa_cpp-CastCost.obj: ResolvExpr/CastCost.cc1803 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-CastCost.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CastCost.Tpo -c -o ResolvExpr/driver_cfa_cpp-CastCost.obj `if test -f 'ResolvExpr/CastCost.cc'; then $(CYGPATH_W) 'ResolvExpr/CastCost.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/CastCost.cc'; fi`1804 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CastCost.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CastCost.Po1805 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/CastCost.cc' object='ResolvExpr/driver_cfa_cpp-CastCost.obj' libtool=no @AMDEPBACKSLASH@1806 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1807 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-CastCost.obj `if test -f 'ResolvExpr/CastCost.cc'; then $(CYGPATH_W) 'ResolvExpr/CastCost.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/CastCost.cc'; fi`1808 1809 ResolvExpr/driver_cfa_cpp-PtrsCastable.o: ResolvExpr/PtrsCastable.cc1810 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-PtrsCastable.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsCastable.Tpo -c -o ResolvExpr/driver_cfa_cpp-PtrsCastable.o `test -f 'ResolvExpr/PtrsCastable.cc' || echo '$(srcdir)/'`ResolvExpr/PtrsCastable.cc1811 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsCastable.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsCastable.Po1812 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/PtrsCastable.cc' object='ResolvExpr/driver_cfa_cpp-PtrsCastable.o' libtool=no @AMDEPBACKSLASH@1813 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1814 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-PtrsCastable.o `test -f 'ResolvExpr/PtrsCastable.cc' || echo '$(srcdir)/'`ResolvExpr/PtrsCastable.cc1815 1816 ResolvExpr/driver_cfa_cpp-PtrsCastable.obj: ResolvExpr/PtrsCastable.cc1817 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-PtrsCastable.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsCastable.Tpo -c -o ResolvExpr/driver_cfa_cpp-PtrsCastable.obj `if test -f 'ResolvExpr/PtrsCastable.cc'; then $(CYGPATH_W) 'ResolvExpr/PtrsCastable.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/PtrsCastable.cc'; fi`1818 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsCastable.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PtrsCastable.Po1819 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/PtrsCastable.cc' object='ResolvExpr/driver_cfa_cpp-PtrsCastable.obj' libtool=no @AMDEPBACKSLASH@1820 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1821 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-PtrsCastable.obj `if test -f 'ResolvExpr/PtrsCastable.cc'; then $(CYGPATH_W) 'ResolvExpr/PtrsCastable.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/PtrsCastable.cc'; fi`1822 1823 ResolvExpr/driver_cfa_cpp-AdjustExprType.o: ResolvExpr/AdjustExprType.cc1824 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-AdjustExprType.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AdjustExprType.Tpo -c -o ResolvExpr/driver_cfa_cpp-AdjustExprType.o `test -f 'ResolvExpr/AdjustExprType.cc' || echo '$(srcdir)/'`ResolvExpr/AdjustExprType.cc1825 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AdjustExprType.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AdjustExprType.Po1826 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/AdjustExprType.cc' object='ResolvExpr/driver_cfa_cpp-AdjustExprType.o' libtool=no @AMDEPBACKSLASH@1827 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1828 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-AdjustExprType.o `test -f 'ResolvExpr/AdjustExprType.cc' || echo '$(srcdir)/'`ResolvExpr/AdjustExprType.cc1829 1830 ResolvExpr/driver_cfa_cpp-AdjustExprType.obj: ResolvExpr/AdjustExprType.cc1831 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-AdjustExprType.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AdjustExprType.Tpo -c -o ResolvExpr/driver_cfa_cpp-AdjustExprType.obj `if test -f 'ResolvExpr/AdjustExprType.cc'; then $(CYGPATH_W) 'ResolvExpr/AdjustExprType.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/AdjustExprType.cc'; fi`1832 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AdjustExprType.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AdjustExprType.Po1833 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/AdjustExprType.cc' object='ResolvExpr/driver_cfa_cpp-AdjustExprType.obj' libtool=no @AMDEPBACKSLASH@1834 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1835 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-AdjustExprType.obj `if test -f 'ResolvExpr/AdjustExprType.cc'; then $(CYGPATH_W) 'ResolvExpr/AdjustExprType.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/AdjustExprType.cc'; fi`1836 1837 ResolvExpr/driver_cfa_cpp-AlternativePrinter.o: ResolvExpr/AlternativePrinter.cc1838 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-AlternativePrinter.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativePrinter.Tpo -c -o ResolvExpr/driver_cfa_cpp-AlternativePrinter.o `test -f 'ResolvExpr/AlternativePrinter.cc' || echo '$(srcdir)/'`ResolvExpr/AlternativePrinter.cc1839 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativePrinter.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativePrinter.Po1840 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/AlternativePrinter.cc' object='ResolvExpr/driver_cfa_cpp-AlternativePrinter.o' libtool=no @AMDEPBACKSLASH@1841 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1842 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-AlternativePrinter.o `test -f 'ResolvExpr/AlternativePrinter.cc' || echo '$(srcdir)/'`ResolvExpr/AlternativePrinter.cc1843 1844 ResolvExpr/driver_cfa_cpp-AlternativePrinter.obj: ResolvExpr/AlternativePrinter.cc1845 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-AlternativePrinter.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativePrinter.Tpo -c -o ResolvExpr/driver_cfa_cpp-AlternativePrinter.obj `if test -f 'ResolvExpr/AlternativePrinter.cc'; then $(CYGPATH_W) 'ResolvExpr/AlternativePrinter.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/AlternativePrinter.cc'; fi`1846 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativePrinter.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-AlternativePrinter.Po1847 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/AlternativePrinter.cc' object='ResolvExpr/driver_cfa_cpp-AlternativePrinter.obj' libtool=no @AMDEPBACKSLASH@1848 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1849 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-AlternativePrinter.obj `if test -f 'ResolvExpr/AlternativePrinter.cc'; then $(CYGPATH_W) 'ResolvExpr/AlternativePrinter.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/AlternativePrinter.cc'; fi`1850 1851 ResolvExpr/driver_cfa_cpp-Resolver.o: ResolvExpr/Resolver.cc1852 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-Resolver.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Resolver.Tpo -c -o ResolvExpr/driver_cfa_cpp-Resolver.o `test -f 'ResolvExpr/Resolver.cc' || echo '$(srcdir)/'`ResolvExpr/Resolver.cc1853 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Resolver.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Resolver.Po1854 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/Resolver.cc' object='ResolvExpr/driver_cfa_cpp-Resolver.o' libtool=no @AMDEPBACKSLASH@1855 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1856 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-Resolver.o `test -f 'ResolvExpr/Resolver.cc' || echo '$(srcdir)/'`ResolvExpr/Resolver.cc1857 1858 ResolvExpr/driver_cfa_cpp-Resolver.obj: ResolvExpr/Resolver.cc1859 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-Resolver.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Resolver.Tpo -c -o ResolvExpr/driver_cfa_cpp-Resolver.obj `if test -f 'ResolvExpr/Resolver.cc'; then $(CYGPATH_W) 'ResolvExpr/Resolver.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/Resolver.cc'; fi`1860 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Resolver.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Resolver.Po1861 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/Resolver.cc' object='ResolvExpr/driver_cfa_cpp-Resolver.obj' libtool=no @AMDEPBACKSLASH@1862 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1863 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-Resolver.obj `if test -f 'ResolvExpr/Resolver.cc'; then $(CYGPATH_W) 'ResolvExpr/Resolver.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/Resolver.cc'; fi`1864 1865 ResolvExpr/driver_cfa_cpp-ResolveTypeof.o: ResolvExpr/ResolveTypeof.cc1866 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-ResolveTypeof.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ResolveTypeof.Tpo -c -o ResolvExpr/driver_cfa_cpp-ResolveTypeof.o `test -f 'ResolvExpr/ResolveTypeof.cc' || echo '$(srcdir)/'`ResolvExpr/ResolveTypeof.cc1867 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ResolveTypeof.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ResolveTypeof.Po1868 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/ResolveTypeof.cc' object='ResolvExpr/driver_cfa_cpp-ResolveTypeof.o' libtool=no @AMDEPBACKSLASH@1869 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1870 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-ResolveTypeof.o `test -f 'ResolvExpr/ResolveTypeof.cc' || echo '$(srcdir)/'`ResolvExpr/ResolveTypeof.cc1871 1872 ResolvExpr/driver_cfa_cpp-ResolveTypeof.obj: ResolvExpr/ResolveTypeof.cc1873 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-ResolveTypeof.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ResolveTypeof.Tpo -c -o ResolvExpr/driver_cfa_cpp-ResolveTypeof.obj `if test -f 'ResolvExpr/ResolveTypeof.cc'; then $(CYGPATH_W) 'ResolvExpr/ResolveTypeof.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/ResolveTypeof.cc'; fi`1874 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ResolveTypeof.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ResolveTypeof.Po1875 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/ResolveTypeof.cc' object='ResolvExpr/driver_cfa_cpp-ResolveTypeof.obj' libtool=no @AMDEPBACKSLASH@1876 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1877 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-ResolveTypeof.obj `if test -f 'ResolvExpr/ResolveTypeof.cc'; then $(CYGPATH_W) 'ResolvExpr/ResolveTypeof.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/ResolveTypeof.cc'; fi`1878 1879 ResolvExpr/driver_cfa_cpp-RenameVars.o: ResolvExpr/RenameVars.cc1880 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-RenameVars.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-RenameVars.Tpo -c -o ResolvExpr/driver_cfa_cpp-RenameVars.o `test -f 'ResolvExpr/RenameVars.cc' || echo '$(srcdir)/'`ResolvExpr/RenameVars.cc1881 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-RenameVars.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-RenameVars.Po1882 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/RenameVars.cc' object='ResolvExpr/driver_cfa_cpp-RenameVars.o' libtool=no @AMDEPBACKSLASH@1883 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1884 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-RenameVars.o `test -f 'ResolvExpr/RenameVars.cc' || echo '$(srcdir)/'`ResolvExpr/RenameVars.cc1885 1886 ResolvExpr/driver_cfa_cpp-RenameVars.obj: ResolvExpr/RenameVars.cc1887 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-RenameVars.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-RenameVars.Tpo -c -o ResolvExpr/driver_cfa_cpp-RenameVars.obj `if test -f 'ResolvExpr/RenameVars.cc'; then $(CYGPATH_W) 'ResolvExpr/RenameVars.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/RenameVars.cc'; fi`1888 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-RenameVars.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-RenameVars.Po1889 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/RenameVars.cc' object='ResolvExpr/driver_cfa_cpp-RenameVars.obj' libtool=no @AMDEPBACKSLASH@1890 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1891 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-RenameVars.obj `if test -f 'ResolvExpr/RenameVars.cc'; then $(CYGPATH_W) 'ResolvExpr/RenameVars.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/RenameVars.cc'; fi`1892 1893 ResolvExpr/driver_cfa_cpp-FindOpenVars.o: ResolvExpr/FindOpenVars.cc1894 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-FindOpenVars.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-FindOpenVars.Tpo -c -o ResolvExpr/driver_cfa_cpp-FindOpenVars.o `test -f 'ResolvExpr/FindOpenVars.cc' || echo '$(srcdir)/'`ResolvExpr/FindOpenVars.cc1895 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-FindOpenVars.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-FindOpenVars.Po1896 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/FindOpenVars.cc' object='ResolvExpr/driver_cfa_cpp-FindOpenVars.o' libtool=no @AMDEPBACKSLASH@1897 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1898 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-FindOpenVars.o `test -f 'ResolvExpr/FindOpenVars.cc' || echo '$(srcdir)/'`ResolvExpr/FindOpenVars.cc1899 1900 ResolvExpr/driver_cfa_cpp-FindOpenVars.obj: ResolvExpr/FindOpenVars.cc1901 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-FindOpenVars.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-FindOpenVars.Tpo -c -o ResolvExpr/driver_cfa_cpp-FindOpenVars.obj `if test -f 'ResolvExpr/FindOpenVars.cc'; then $(CYGPATH_W) 'ResolvExpr/FindOpenVars.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/FindOpenVars.cc'; fi`1902 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-FindOpenVars.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-FindOpenVars.Po1903 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/FindOpenVars.cc' object='ResolvExpr/driver_cfa_cpp-FindOpenVars.obj' libtool=no @AMDEPBACKSLASH@1904 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1905 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-FindOpenVars.obj `if test -f 'ResolvExpr/FindOpenVars.cc'; then $(CYGPATH_W) 'ResolvExpr/FindOpenVars.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/FindOpenVars.cc'; fi`1906 1907 ResolvExpr/driver_cfa_cpp-PolyCost.o: ResolvExpr/PolyCost.cc1908 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-PolyCost.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PolyCost.Tpo -c -o ResolvExpr/driver_cfa_cpp-PolyCost.o `test -f 'ResolvExpr/PolyCost.cc' || echo '$(srcdir)/'`ResolvExpr/PolyCost.cc1909 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PolyCost.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PolyCost.Po1910 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/PolyCost.cc' object='ResolvExpr/driver_cfa_cpp-PolyCost.o' libtool=no @AMDEPBACKSLASH@1911 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1912 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-PolyCost.o `test -f 'ResolvExpr/PolyCost.cc' || echo '$(srcdir)/'`ResolvExpr/PolyCost.cc1913 1914 ResolvExpr/driver_cfa_cpp-PolyCost.obj: ResolvExpr/PolyCost.cc1915 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-PolyCost.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PolyCost.Tpo -c -o ResolvExpr/driver_cfa_cpp-PolyCost.obj `if test -f 'ResolvExpr/PolyCost.cc'; then $(CYGPATH_W) 'ResolvExpr/PolyCost.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/PolyCost.cc'; fi`1916 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PolyCost.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-PolyCost.Po1917 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/PolyCost.cc' object='ResolvExpr/driver_cfa_cpp-PolyCost.obj' libtool=no @AMDEPBACKSLASH@1918 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1919 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-PolyCost.obj `if test -f 'ResolvExpr/PolyCost.cc'; then $(CYGPATH_W) 'ResolvExpr/PolyCost.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/PolyCost.cc'; fi`1920 1921 ResolvExpr/driver_cfa_cpp-Occurs.o: ResolvExpr/Occurs.cc1922 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-Occurs.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Occurs.Tpo -c -o ResolvExpr/driver_cfa_cpp-Occurs.o `test -f 'ResolvExpr/Occurs.cc' || echo '$(srcdir)/'`ResolvExpr/Occurs.cc1923 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Occurs.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Occurs.Po1924 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/Occurs.cc' object='ResolvExpr/driver_cfa_cpp-Occurs.o' libtool=no @AMDEPBACKSLASH@1925 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1926 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-Occurs.o `test -f 'ResolvExpr/Occurs.cc' || echo '$(srcdir)/'`ResolvExpr/Occurs.cc1927 1928 ResolvExpr/driver_cfa_cpp-Occurs.obj: ResolvExpr/Occurs.cc1929 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-Occurs.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Occurs.Tpo -c -o ResolvExpr/driver_cfa_cpp-Occurs.obj `if test -f 'ResolvExpr/Occurs.cc'; then $(CYGPATH_W) 'ResolvExpr/Occurs.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/Occurs.cc'; fi`1930 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Occurs.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-Occurs.Po1931 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/Occurs.cc' object='ResolvExpr/driver_cfa_cpp-Occurs.obj' libtool=no @AMDEPBACKSLASH@1932 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1933 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-Occurs.obj `if test -f 'ResolvExpr/Occurs.cc'; then $(CYGPATH_W) 'ResolvExpr/Occurs.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/Occurs.cc'; fi`1934 1935 ResolvExpr/driver_cfa_cpp-TypeEnvironment.o: ResolvExpr/TypeEnvironment.cc1936 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-TypeEnvironment.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-TypeEnvironment.Tpo -c -o ResolvExpr/driver_cfa_cpp-TypeEnvironment.o `test -f 'ResolvExpr/TypeEnvironment.cc' || echo '$(srcdir)/'`ResolvExpr/TypeEnvironment.cc1937 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-TypeEnvironment.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-TypeEnvironment.Po1938 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/TypeEnvironment.cc' object='ResolvExpr/driver_cfa_cpp-TypeEnvironment.o' libtool=no @AMDEPBACKSLASH@1939 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1940 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-TypeEnvironment.o `test -f 'ResolvExpr/TypeEnvironment.cc' || echo '$(srcdir)/'`ResolvExpr/TypeEnvironment.cc1941 1942 ResolvExpr/driver_cfa_cpp-TypeEnvironment.obj: ResolvExpr/TypeEnvironment.cc1943 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-TypeEnvironment.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-TypeEnvironment.Tpo -c -o ResolvExpr/driver_cfa_cpp-TypeEnvironment.obj `if test -f 'ResolvExpr/TypeEnvironment.cc'; then $(CYGPATH_W) 'ResolvExpr/TypeEnvironment.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/TypeEnvironment.cc'; fi`1944 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-TypeEnvironment.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-TypeEnvironment.Po1945 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/TypeEnvironment.cc' object='ResolvExpr/driver_cfa_cpp-TypeEnvironment.obj' libtool=no @AMDEPBACKSLASH@1946 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1947 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-TypeEnvironment.obj `if test -f 'ResolvExpr/TypeEnvironment.cc'; then $(CYGPATH_W) 'ResolvExpr/TypeEnvironment.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/TypeEnvironment.cc'; fi`1948 1949 ResolvExpr/driver_cfa_cpp-CurrentObject.o: ResolvExpr/CurrentObject.cc1950 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-CurrentObject.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CurrentObject.Tpo -c -o ResolvExpr/driver_cfa_cpp-CurrentObject.o `test -f 'ResolvExpr/CurrentObject.cc' || echo '$(srcdir)/'`ResolvExpr/CurrentObject.cc1951 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CurrentObject.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CurrentObject.Po1952 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/CurrentObject.cc' object='ResolvExpr/driver_cfa_cpp-CurrentObject.o' libtool=no @AMDEPBACKSLASH@1953 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1954 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-CurrentObject.o `test -f 'ResolvExpr/CurrentObject.cc' || echo '$(srcdir)/'`ResolvExpr/CurrentObject.cc1955 1956 ResolvExpr/driver_cfa_cpp-CurrentObject.obj: ResolvExpr/CurrentObject.cc1957 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-CurrentObject.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CurrentObject.Tpo -c -o ResolvExpr/driver_cfa_cpp-CurrentObject.obj `if test -f 'ResolvExpr/CurrentObject.cc'; then $(CYGPATH_W) 'ResolvExpr/CurrentObject.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/CurrentObject.cc'; fi`1958 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CurrentObject.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-CurrentObject.Po1959 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/CurrentObject.cc' object='ResolvExpr/driver_cfa_cpp-CurrentObject.obj' libtool=no @AMDEPBACKSLASH@1960 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1961 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-CurrentObject.obj `if test -f 'ResolvExpr/CurrentObject.cc'; then $(CYGPATH_W) 'ResolvExpr/CurrentObject.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/CurrentObject.cc'; fi`1962 1963 ResolvExpr/driver_cfa_cpp-ExplodedActual.o: ResolvExpr/ExplodedActual.cc1964 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-ExplodedActual.o -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ExplodedActual.Tpo -c -o ResolvExpr/driver_cfa_cpp-ExplodedActual.o `test -f 'ResolvExpr/ExplodedActual.cc' || echo '$(srcdir)/'`ResolvExpr/ExplodedActual.cc1965 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ExplodedActual.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ExplodedActual.Po1966 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/ExplodedActual.cc' object='ResolvExpr/driver_cfa_cpp-ExplodedActual.o' libtool=no @AMDEPBACKSLASH@1967 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1968 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-ExplodedActual.o `test -f 'ResolvExpr/ExplodedActual.cc' || echo '$(srcdir)/'`ResolvExpr/ExplodedActual.cc1969 1970 ResolvExpr/driver_cfa_cpp-ExplodedActual.obj: ResolvExpr/ExplodedActual.cc1971 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT ResolvExpr/driver_cfa_cpp-ExplodedActual.obj -MD -MP -MF ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ExplodedActual.Tpo -c -o ResolvExpr/driver_cfa_cpp-ExplodedActual.obj `if test -f 'ResolvExpr/ExplodedActual.cc'; then $(CYGPATH_W) 'ResolvExpr/ExplodedActual.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/ExplodedActual.cc'; fi`1972 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ExplodedActual.Tpo ResolvExpr/$(DEPDIR)/driver_cfa_cpp-ExplodedActual.Po1973 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ResolvExpr/ExplodedActual.cc' object='ResolvExpr/driver_cfa_cpp-ExplodedActual.obj' libtool=no @AMDEPBACKSLASH@1974 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1975 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o ResolvExpr/driver_cfa_cpp-ExplodedActual.obj `if test -f 'ResolvExpr/ExplodedActual.cc'; then $(CYGPATH_W) 'ResolvExpr/ExplodedActual.cc'; else $(CYGPATH_W) '$(srcdir)/ResolvExpr/ExplodedActual.cc'; fi`1976 1977 SymTab/driver_cfa_cpp-Indexer.o: SymTab/Indexer.cc1978 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-Indexer.o -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-Indexer.Tpo -c -o SymTab/driver_cfa_cpp-Indexer.o `test -f 'SymTab/Indexer.cc' || echo '$(srcdir)/'`SymTab/Indexer.cc1979 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-Indexer.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-Indexer.Po1980 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/Indexer.cc' object='SymTab/driver_cfa_cpp-Indexer.o' libtool=no @AMDEPBACKSLASH@1981 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1982 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-Indexer.o `test -f 'SymTab/Indexer.cc' || echo '$(srcdir)/'`SymTab/Indexer.cc1983 1984 SymTab/driver_cfa_cpp-Indexer.obj: SymTab/Indexer.cc1985 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-Indexer.obj -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-Indexer.Tpo -c -o SymTab/driver_cfa_cpp-Indexer.obj `if test -f 'SymTab/Indexer.cc'; then $(CYGPATH_W) 'SymTab/Indexer.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/Indexer.cc'; fi`1986 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-Indexer.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-Indexer.Po1987 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/Indexer.cc' object='SymTab/driver_cfa_cpp-Indexer.obj' libtool=no @AMDEPBACKSLASH@1988 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1989 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-Indexer.obj `if test -f 'SymTab/Indexer.cc'; then $(CYGPATH_W) 'SymTab/Indexer.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/Indexer.cc'; fi`1990 1991 SymTab/driver_cfa_cpp-Mangler.o: SymTab/Mangler.cc1992 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-Mangler.o -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-Mangler.Tpo -c -o SymTab/driver_cfa_cpp-Mangler.o `test -f 'SymTab/Mangler.cc' || echo '$(srcdir)/'`SymTab/Mangler.cc1993 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-Mangler.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-Mangler.Po1994 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/Mangler.cc' object='SymTab/driver_cfa_cpp-Mangler.o' libtool=no @AMDEPBACKSLASH@1995 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@1996 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-Mangler.o `test -f 'SymTab/Mangler.cc' || echo '$(srcdir)/'`SymTab/Mangler.cc1997 1998 SymTab/driver_cfa_cpp-Mangler.obj: SymTab/Mangler.cc1999 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-Mangler.obj -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-Mangler.Tpo -c -o SymTab/driver_cfa_cpp-Mangler.obj `if test -f 'SymTab/Mangler.cc'; then $(CYGPATH_W) 'SymTab/Mangler.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/Mangler.cc'; fi`2000 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-Mangler.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-Mangler.Po2001 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/Mangler.cc' object='SymTab/driver_cfa_cpp-Mangler.obj' libtool=no @AMDEPBACKSLASH@2002 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2003 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-Mangler.obj `if test -f 'SymTab/Mangler.cc'; then $(CYGPATH_W) 'SymTab/Mangler.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/Mangler.cc'; fi`2004 2005 SymTab/driver_cfa_cpp-Validate.o: SymTab/Validate.cc2006 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-Validate.o -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-Validate.Tpo -c -o SymTab/driver_cfa_cpp-Validate.o `test -f 'SymTab/Validate.cc' || echo '$(srcdir)/'`SymTab/Validate.cc2007 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-Validate.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-Validate.Po2008 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/Validate.cc' object='SymTab/driver_cfa_cpp-Validate.o' libtool=no @AMDEPBACKSLASH@2009 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2010 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-Validate.o `test -f 'SymTab/Validate.cc' || echo '$(srcdir)/'`SymTab/Validate.cc2011 2012 SymTab/driver_cfa_cpp-Validate.obj: SymTab/Validate.cc2013 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-Validate.obj -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-Validate.Tpo -c -o SymTab/driver_cfa_cpp-Validate.obj `if test -f 'SymTab/Validate.cc'; then $(CYGPATH_W) 'SymTab/Validate.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/Validate.cc'; fi`2014 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-Validate.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-Validate.Po2015 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/Validate.cc' object='SymTab/driver_cfa_cpp-Validate.obj' libtool=no @AMDEPBACKSLASH@2016 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2017 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-Validate.obj `if test -f 'SymTab/Validate.cc'; then $(CYGPATH_W) 'SymTab/Validate.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/Validate.cc'; fi`2018 2019 SymTab/driver_cfa_cpp-FixFunction.o: SymTab/FixFunction.cc2020 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-FixFunction.o -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-FixFunction.Tpo -c -o SymTab/driver_cfa_cpp-FixFunction.o `test -f 'SymTab/FixFunction.cc' || echo '$(srcdir)/'`SymTab/FixFunction.cc2021 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-FixFunction.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-FixFunction.Po2022 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/FixFunction.cc' object='SymTab/driver_cfa_cpp-FixFunction.o' libtool=no @AMDEPBACKSLASH@2023 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2024 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-FixFunction.o `test -f 'SymTab/FixFunction.cc' || echo '$(srcdir)/'`SymTab/FixFunction.cc2025 2026 SymTab/driver_cfa_cpp-FixFunction.obj: SymTab/FixFunction.cc2027 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-FixFunction.obj -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-FixFunction.Tpo -c -o SymTab/driver_cfa_cpp-FixFunction.obj `if test -f 'SymTab/FixFunction.cc'; then $(CYGPATH_W) 'SymTab/FixFunction.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/FixFunction.cc'; fi`2028 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-FixFunction.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-FixFunction.Po2029 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/FixFunction.cc' object='SymTab/driver_cfa_cpp-FixFunction.obj' libtool=no @AMDEPBACKSLASH@2030 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2031 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-FixFunction.obj `if test -f 'SymTab/FixFunction.cc'; then $(CYGPATH_W) 'SymTab/FixFunction.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/FixFunction.cc'; fi`2032 2033 SymTab/driver_cfa_cpp-Autogen.o: SymTab/Autogen.cc2034 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-Autogen.o -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-Autogen.Tpo -c -o SymTab/driver_cfa_cpp-Autogen.o `test -f 'SymTab/Autogen.cc' || echo '$(srcdir)/'`SymTab/Autogen.cc2035 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-Autogen.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-Autogen.Po2036 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/Autogen.cc' object='SymTab/driver_cfa_cpp-Autogen.o' libtool=no @AMDEPBACKSLASH@2037 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2038 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-Autogen.o `test -f 'SymTab/Autogen.cc' || echo '$(srcdir)/'`SymTab/Autogen.cc2039 2040 SymTab/driver_cfa_cpp-Autogen.obj: SymTab/Autogen.cc2041 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-Autogen.obj -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-Autogen.Tpo -c -o SymTab/driver_cfa_cpp-Autogen.obj `if test -f 'SymTab/Autogen.cc'; then $(CYGPATH_W) 'SymTab/Autogen.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/Autogen.cc'; fi`2042 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-Autogen.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-Autogen.Po2043 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/Autogen.cc' object='SymTab/driver_cfa_cpp-Autogen.obj' libtool=no @AMDEPBACKSLASH@2044 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2045 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SymTab/driver_cfa_cpp-Autogen.obj `if test -f 'SymTab/Autogen.cc'; then $(CYGPATH_W) 'SymTab/Autogen.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/Autogen.cc'; fi`2046 2047 SynTree/driver_cfa_cpp-Type.o: SynTree/Type.cc2048 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Type.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Type.Tpo -c -o SynTree/driver_cfa_cpp-Type.o `test -f 'SynTree/Type.cc' || echo '$(srcdir)/'`SynTree/Type.cc2049 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Type.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Type.Po2050 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Type.cc' object='SynTree/driver_cfa_cpp-Type.o' libtool=no @AMDEPBACKSLASH@2051 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2052 @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-Type.o `test -f 'SynTree/Type.cc' || echo '$(srcdir)/'`SynTree/Type.cc2053 2054 SynTree/driver_cfa_cpp-Type.obj: SynTree/Type.cc2055 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Type.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Type.Tpo -c -o SynTree/driver_cfa_cpp-Type.obj `if test -f 'SynTree/Type.cc'; then $(CYGPATH_W) 'SynTree/Type.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Type.cc'; fi`2056 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Type.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Type.Po2057 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Type.cc' object='SynTree/driver_cfa_cpp-Type.obj' libtool=no @AMDEPBACKSLASH@2058 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2059 @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-Type.obj `if test -f 'SynTree/Type.cc'; then $(CYGPATH_W) 'SynTree/Type.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Type.cc'; fi`2060 2061 SynTree/driver_cfa_cpp-VoidType.o: SynTree/VoidType.cc2062 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-VoidType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-VoidType.Tpo -c -o SynTree/driver_cfa_cpp-VoidType.o `test -f 'SynTree/VoidType.cc' || echo '$(srcdir)/'`SynTree/VoidType.cc2063 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-VoidType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-VoidType.Po2064 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/VoidType.cc' object='SynTree/driver_cfa_cpp-VoidType.o' libtool=no @AMDEPBACKSLASH@2065 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2066 @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-VoidType.o `test -f 'SynTree/VoidType.cc' || echo '$(srcdir)/'`SynTree/VoidType.cc2067 2068 SynTree/driver_cfa_cpp-VoidType.obj: SynTree/VoidType.cc2069 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-VoidType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-VoidType.Tpo -c -o SynTree/driver_cfa_cpp-VoidType.obj `if test -f 'SynTree/VoidType.cc'; then $(CYGPATH_W) 'SynTree/VoidType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/VoidType.cc'; fi`2070 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-VoidType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-VoidType.Po2071 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/VoidType.cc' object='SynTree/driver_cfa_cpp-VoidType.obj' libtool=no @AMDEPBACKSLASH@2072 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2073 @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-VoidType.obj `if test -f 'SynTree/VoidType.cc'; then $(CYGPATH_W) 'SynTree/VoidType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/VoidType.cc'; fi`2074 2075 SynTree/driver_cfa_cpp-BasicType.o: SynTree/BasicType.cc2076 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-BasicType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-BasicType.Tpo -c -o SynTree/driver_cfa_cpp-BasicType.o `test -f 'SynTree/BasicType.cc' || echo '$(srcdir)/'`SynTree/BasicType.cc2077 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-BasicType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-BasicType.Po2078 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/BasicType.cc' object='SynTree/driver_cfa_cpp-BasicType.o' libtool=no @AMDEPBACKSLASH@2079 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2080 @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-BasicType.o `test -f 'SynTree/BasicType.cc' || echo '$(srcdir)/'`SynTree/BasicType.cc2081 2082 SynTree/driver_cfa_cpp-BasicType.obj: SynTree/BasicType.cc2083 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-BasicType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-BasicType.Tpo -c -o SynTree/driver_cfa_cpp-BasicType.obj `if test -f 'SynTree/BasicType.cc'; then $(CYGPATH_W) 'SynTree/BasicType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/BasicType.cc'; fi`2084 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-BasicType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-BasicType.Po2085 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/BasicType.cc' object='SynTree/driver_cfa_cpp-BasicType.obj' libtool=no @AMDEPBACKSLASH@2086 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2087 @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-BasicType.obj `if test -f 'SynTree/BasicType.cc'; then $(CYGPATH_W) 'SynTree/BasicType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/BasicType.cc'; fi`2088 2089 SynTree/driver_cfa_cpp-PointerType.o: SynTree/PointerType.cc2090 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-PointerType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-PointerType.Tpo -c -o SynTree/driver_cfa_cpp-PointerType.o `test -f 'SynTree/PointerType.cc' || echo '$(srcdir)/'`SynTree/PointerType.cc2091 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-PointerType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-PointerType.Po2092 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/PointerType.cc' object='SynTree/driver_cfa_cpp-PointerType.o' libtool=no @AMDEPBACKSLASH@2093 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2094 @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-PointerType.o `test -f 'SynTree/PointerType.cc' || echo '$(srcdir)/'`SynTree/PointerType.cc2095 2096 SynTree/driver_cfa_cpp-PointerType.obj: SynTree/PointerType.cc2097 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-PointerType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-PointerType.Tpo -c -o SynTree/driver_cfa_cpp-PointerType.obj `if test -f 'SynTree/PointerType.cc'; then $(CYGPATH_W) 'SynTree/PointerType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/PointerType.cc'; fi`2098 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-PointerType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-PointerType.Po2099 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/PointerType.cc' object='SynTree/driver_cfa_cpp-PointerType.obj' libtool=no @AMDEPBACKSLASH@2100 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2101 @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-PointerType.obj `if test -f 'SynTree/PointerType.cc'; then $(CYGPATH_W) 'SynTree/PointerType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/PointerType.cc'; fi`2102 2103 SynTree/driver_cfa_cpp-ArrayType.o: SynTree/ArrayType.cc2104 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ArrayType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ArrayType.Tpo -c -o SynTree/driver_cfa_cpp-ArrayType.o `test -f 'SynTree/ArrayType.cc' || echo '$(srcdir)/'`SynTree/ArrayType.cc2105 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ArrayType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ArrayType.Po2106 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ArrayType.cc' object='SynTree/driver_cfa_cpp-ArrayType.o' libtool=no @AMDEPBACKSLASH@2107 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2108 @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-ArrayType.o `test -f 'SynTree/ArrayType.cc' || echo '$(srcdir)/'`SynTree/ArrayType.cc2109 2110 SynTree/driver_cfa_cpp-ArrayType.obj: SynTree/ArrayType.cc2111 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ArrayType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ArrayType.Tpo -c -o SynTree/driver_cfa_cpp-ArrayType.obj `if test -f 'SynTree/ArrayType.cc'; then $(CYGPATH_W) 'SynTree/ArrayType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ArrayType.cc'; fi`2112 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ArrayType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ArrayType.Po2113 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ArrayType.cc' object='SynTree/driver_cfa_cpp-ArrayType.obj' libtool=no @AMDEPBACKSLASH@2114 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2115 @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-ArrayType.obj `if test -f 'SynTree/ArrayType.cc'; then $(CYGPATH_W) 'SynTree/ArrayType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ArrayType.cc'; fi`2116 2117 SynTree/driver_cfa_cpp-ReferenceType.o: SynTree/ReferenceType.cc2118 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ReferenceType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Tpo -c -o SynTree/driver_cfa_cpp-ReferenceType.o `test -f 'SynTree/ReferenceType.cc' || echo '$(srcdir)/'`SynTree/ReferenceType.cc2119 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Po2120 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ReferenceType.cc' object='SynTree/driver_cfa_cpp-ReferenceType.o' libtool=no @AMDEPBACKSLASH@2121 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2122 @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-ReferenceType.o `test -f 'SynTree/ReferenceType.cc' || echo '$(srcdir)/'`SynTree/ReferenceType.cc2123 2124 SynTree/driver_cfa_cpp-ReferenceType.obj: SynTree/ReferenceType.cc2125 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ReferenceType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Tpo -c -o SynTree/driver_cfa_cpp-ReferenceType.obj `if test -f 'SynTree/ReferenceType.cc'; then $(CYGPATH_W) 'SynTree/ReferenceType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ReferenceType.cc'; fi`2126 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Po2127 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ReferenceType.cc' object='SynTree/driver_cfa_cpp-ReferenceType.obj' libtool=no @AMDEPBACKSLASH@2128 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2129 @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-ReferenceType.obj `if test -f 'SynTree/ReferenceType.cc'; then $(CYGPATH_W) 'SynTree/ReferenceType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ReferenceType.cc'; fi`2130 2131 SynTree/driver_cfa_cpp-FunctionType.o: SynTree/FunctionType.cc2132 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-FunctionType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionType.Tpo -c -o SynTree/driver_cfa_cpp-FunctionType.o `test -f 'SynTree/FunctionType.cc' || echo '$(srcdir)/'`SynTree/FunctionType.cc2133 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionType.Po2134 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/FunctionType.cc' object='SynTree/driver_cfa_cpp-FunctionType.o' libtool=no @AMDEPBACKSLASH@2135 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2136 @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-FunctionType.o `test -f 'SynTree/FunctionType.cc' || echo '$(srcdir)/'`SynTree/FunctionType.cc2137 2138 SynTree/driver_cfa_cpp-FunctionType.obj: SynTree/FunctionType.cc2139 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-FunctionType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionType.Tpo -c -o SynTree/driver_cfa_cpp-FunctionType.obj `if test -f 'SynTree/FunctionType.cc'; then $(CYGPATH_W) 'SynTree/FunctionType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/FunctionType.cc'; fi`2140 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionType.Po2141 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/FunctionType.cc' object='SynTree/driver_cfa_cpp-FunctionType.obj' libtool=no @AMDEPBACKSLASH@2142 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2143 @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-FunctionType.obj `if test -f 'SynTree/FunctionType.cc'; then $(CYGPATH_W) 'SynTree/FunctionType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/FunctionType.cc'; fi`2144 2145 SynTree/driver_cfa_cpp-ReferenceToType.o: SynTree/ReferenceToType.cc2146 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ReferenceToType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceToType.Tpo -c -o SynTree/driver_cfa_cpp-ReferenceToType.o `test -f 'SynTree/ReferenceToType.cc' || echo '$(srcdir)/'`SynTree/ReferenceToType.cc2147 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceToType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceToType.Po2148 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ReferenceToType.cc' object='SynTree/driver_cfa_cpp-ReferenceToType.o' libtool=no @AMDEPBACKSLASH@2149 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2150 @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-ReferenceToType.o `test -f 'SynTree/ReferenceToType.cc' || echo '$(srcdir)/'`SynTree/ReferenceToType.cc2151 2152 SynTree/driver_cfa_cpp-ReferenceToType.obj: SynTree/ReferenceToType.cc2153 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ReferenceToType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceToType.Tpo -c -o SynTree/driver_cfa_cpp-ReferenceToType.obj `if test -f 'SynTree/ReferenceToType.cc'; then $(CYGPATH_W) 'SynTree/ReferenceToType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ReferenceToType.cc'; fi`2154 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceToType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceToType.Po2155 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ReferenceToType.cc' object='SynTree/driver_cfa_cpp-ReferenceToType.obj' libtool=no @AMDEPBACKSLASH@2156 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2157 @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-ReferenceToType.obj `if test -f 'SynTree/ReferenceToType.cc'; then $(CYGPATH_W) 'SynTree/ReferenceToType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ReferenceToType.cc'; fi`2158 2159 SynTree/driver_cfa_cpp-TupleType.o: SynTree/TupleType.cc2160 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TupleType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TupleType.Tpo -c -o SynTree/driver_cfa_cpp-TupleType.o `test -f 'SynTree/TupleType.cc' || echo '$(srcdir)/'`SynTree/TupleType.cc2161 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TupleType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TupleType.Po2162 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TupleType.cc' object='SynTree/driver_cfa_cpp-TupleType.o' libtool=no @AMDEPBACKSLASH@2163 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2164 @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-TupleType.o `test -f 'SynTree/TupleType.cc' || echo '$(srcdir)/'`SynTree/TupleType.cc2165 2166 SynTree/driver_cfa_cpp-TupleType.obj: SynTree/TupleType.cc2167 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TupleType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TupleType.Tpo -c -o SynTree/driver_cfa_cpp-TupleType.obj `if test -f 'SynTree/TupleType.cc'; then $(CYGPATH_W) 'SynTree/TupleType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TupleType.cc'; fi`2168 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TupleType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TupleType.Po2169 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TupleType.cc' object='SynTree/driver_cfa_cpp-TupleType.obj' libtool=no @AMDEPBACKSLASH@2170 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2171 @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-TupleType.obj `if test -f 'SynTree/TupleType.cc'; then $(CYGPATH_W) 'SynTree/TupleType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TupleType.cc'; fi`2172 2173 SynTree/driver_cfa_cpp-TypeofType.o: SynTree/TypeofType.cc2174 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TypeofType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TypeofType.Tpo -c -o SynTree/driver_cfa_cpp-TypeofType.o `test -f 'SynTree/TypeofType.cc' || echo '$(srcdir)/'`SynTree/TypeofType.cc2175 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TypeofType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TypeofType.Po2176 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TypeofType.cc' object='SynTree/driver_cfa_cpp-TypeofType.o' libtool=no @AMDEPBACKSLASH@2177 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2178 @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-TypeofType.o `test -f 'SynTree/TypeofType.cc' || echo '$(srcdir)/'`SynTree/TypeofType.cc2179 2180 SynTree/driver_cfa_cpp-TypeofType.obj: SynTree/TypeofType.cc2181 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TypeofType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TypeofType.Tpo -c -o SynTree/driver_cfa_cpp-TypeofType.obj `if test -f 'SynTree/TypeofType.cc'; then $(CYGPATH_W) 'SynTree/TypeofType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TypeofType.cc'; fi`2182 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TypeofType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TypeofType.Po2183 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TypeofType.cc' object='SynTree/driver_cfa_cpp-TypeofType.obj' libtool=no @AMDEPBACKSLASH@2184 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2185 @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-TypeofType.obj `if test -f 'SynTree/TypeofType.cc'; then $(CYGPATH_W) 'SynTree/TypeofType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TypeofType.cc'; fi`2186 2187 SynTree/driver_cfa_cpp-AttrType.o: SynTree/AttrType.cc2188 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-AttrType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-AttrType.Tpo -c -o SynTree/driver_cfa_cpp-AttrType.o `test -f 'SynTree/AttrType.cc' || echo '$(srcdir)/'`SynTree/AttrType.cc2189 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-AttrType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-AttrType.Po2190 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/AttrType.cc' object='SynTree/driver_cfa_cpp-AttrType.o' libtool=no @AMDEPBACKSLASH@2191 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2192 @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-AttrType.o `test -f 'SynTree/AttrType.cc' || echo '$(srcdir)/'`SynTree/AttrType.cc2193 2194 SynTree/driver_cfa_cpp-AttrType.obj: SynTree/AttrType.cc2195 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-AttrType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-AttrType.Tpo -c -o SynTree/driver_cfa_cpp-AttrType.obj `if test -f 'SynTree/AttrType.cc'; then $(CYGPATH_W) 'SynTree/AttrType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/AttrType.cc'; fi`2196 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-AttrType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-AttrType.Po2197 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/AttrType.cc' object='SynTree/driver_cfa_cpp-AttrType.obj' libtool=no @AMDEPBACKSLASH@2198 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2199 @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-AttrType.obj `if test -f 'SynTree/AttrType.cc'; then $(CYGPATH_W) 'SynTree/AttrType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/AttrType.cc'; fi`2200 2201 SynTree/driver_cfa_cpp-VarArgsType.o: SynTree/VarArgsType.cc2202 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-VarArgsType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-VarArgsType.Tpo -c -o SynTree/driver_cfa_cpp-VarArgsType.o `test -f 'SynTree/VarArgsType.cc' || echo '$(srcdir)/'`SynTree/VarArgsType.cc2203 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-VarArgsType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-VarArgsType.Po2204 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/VarArgsType.cc' object='SynTree/driver_cfa_cpp-VarArgsType.o' libtool=no @AMDEPBACKSLASH@2205 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2206 @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-VarArgsType.o `test -f 'SynTree/VarArgsType.cc' || echo '$(srcdir)/'`SynTree/VarArgsType.cc2207 2208 SynTree/driver_cfa_cpp-VarArgsType.obj: SynTree/VarArgsType.cc2209 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-VarArgsType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-VarArgsType.Tpo -c -o SynTree/driver_cfa_cpp-VarArgsType.obj `if test -f 'SynTree/VarArgsType.cc'; then $(CYGPATH_W) 'SynTree/VarArgsType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/VarArgsType.cc'; fi`2210 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-VarArgsType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-VarArgsType.Po2211 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/VarArgsType.cc' object='SynTree/driver_cfa_cpp-VarArgsType.obj' libtool=no @AMDEPBACKSLASH@2212 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2213 @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-VarArgsType.obj `if test -f 'SynTree/VarArgsType.cc'; then $(CYGPATH_W) 'SynTree/VarArgsType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/VarArgsType.cc'; fi`2214 2215 SynTree/driver_cfa_cpp-ZeroOneType.o: SynTree/ZeroOneType.cc2216 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ZeroOneType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Tpo -c -o SynTree/driver_cfa_cpp-ZeroOneType.o `test -f 'SynTree/ZeroOneType.cc' || echo '$(srcdir)/'`SynTree/ZeroOneType.cc2217 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Po2218 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ZeroOneType.cc' object='SynTree/driver_cfa_cpp-ZeroOneType.o' libtool=no @AMDEPBACKSLASH@2219 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2220 @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-ZeroOneType.o `test -f 'SynTree/ZeroOneType.cc' || echo '$(srcdir)/'`SynTree/ZeroOneType.cc2221 2222 SynTree/driver_cfa_cpp-ZeroOneType.obj: SynTree/ZeroOneType.cc2223 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ZeroOneType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Tpo -c -o SynTree/driver_cfa_cpp-ZeroOneType.obj `if test -f 'SynTree/ZeroOneType.cc'; then $(CYGPATH_W) 'SynTree/ZeroOneType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ZeroOneType.cc'; fi`2224 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Po2225 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ZeroOneType.cc' object='SynTree/driver_cfa_cpp-ZeroOneType.obj' libtool=no @AMDEPBACKSLASH@2226 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2227 @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-ZeroOneType.obj `if test -f 'SynTree/ZeroOneType.cc'; then $(CYGPATH_W) 'SynTree/ZeroOneType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ZeroOneType.cc'; fi`2228 2229 SynTree/driver_cfa_cpp-Constant.o: SynTree/Constant.cc2230 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Constant.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Constant.Tpo -c -o SynTree/driver_cfa_cpp-Constant.o `test -f 'SynTree/Constant.cc' || echo '$(srcdir)/'`SynTree/Constant.cc2231 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Constant.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Constant.Po2232 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Constant.cc' object='SynTree/driver_cfa_cpp-Constant.o' libtool=no @AMDEPBACKSLASH@2233 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2234 @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-Constant.o `test -f 'SynTree/Constant.cc' || echo '$(srcdir)/'`SynTree/Constant.cc2235 2236 SynTree/driver_cfa_cpp-Constant.obj: SynTree/Constant.cc2237 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Constant.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Constant.Tpo -c -o SynTree/driver_cfa_cpp-Constant.obj `if test -f 'SynTree/Constant.cc'; then $(CYGPATH_W) 'SynTree/Constant.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Constant.cc'; fi`2238 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Constant.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Constant.Po2239 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Constant.cc' object='SynTree/driver_cfa_cpp-Constant.obj' libtool=no @AMDEPBACKSLASH@2240 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2241 @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-Constant.obj `if test -f 'SynTree/Constant.cc'; then $(CYGPATH_W) 'SynTree/Constant.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Constant.cc'; fi`2242 2243 SynTree/driver_cfa_cpp-Expression.o: SynTree/Expression.cc2244 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Expression.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Expression.Tpo -c -o SynTree/driver_cfa_cpp-Expression.o `test -f 'SynTree/Expression.cc' || echo '$(srcdir)/'`SynTree/Expression.cc2245 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Expression.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Expression.Po2246 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Expression.cc' object='SynTree/driver_cfa_cpp-Expression.o' libtool=no @AMDEPBACKSLASH@2247 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2248 @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-Expression.o `test -f 'SynTree/Expression.cc' || echo '$(srcdir)/'`SynTree/Expression.cc2249 2250 SynTree/driver_cfa_cpp-Expression.obj: SynTree/Expression.cc2251 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Expression.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Expression.Tpo -c -o SynTree/driver_cfa_cpp-Expression.obj `if test -f 'SynTree/Expression.cc'; then $(CYGPATH_W) 'SynTree/Expression.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Expression.cc'; fi`2252 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Expression.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Expression.Po2253 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Expression.cc' object='SynTree/driver_cfa_cpp-Expression.obj' libtool=no @AMDEPBACKSLASH@2254 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2255 @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-Expression.obj `if test -f 'SynTree/Expression.cc'; then $(CYGPATH_W) 'SynTree/Expression.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Expression.cc'; fi`2256 2257 SynTree/driver_cfa_cpp-TupleExpr.o: SynTree/TupleExpr.cc2258 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TupleExpr.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TupleExpr.Tpo -c -o SynTree/driver_cfa_cpp-TupleExpr.o `test -f 'SynTree/TupleExpr.cc' || echo '$(srcdir)/'`SynTree/TupleExpr.cc2259 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TupleExpr.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TupleExpr.Po2260 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TupleExpr.cc' object='SynTree/driver_cfa_cpp-TupleExpr.o' libtool=no @AMDEPBACKSLASH@2261 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2262 @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-TupleExpr.o `test -f 'SynTree/TupleExpr.cc' || echo '$(srcdir)/'`SynTree/TupleExpr.cc2263 2264 SynTree/driver_cfa_cpp-TupleExpr.obj: SynTree/TupleExpr.cc2265 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TupleExpr.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TupleExpr.Tpo -c -o SynTree/driver_cfa_cpp-TupleExpr.obj `if test -f 'SynTree/TupleExpr.cc'; then $(CYGPATH_W) 'SynTree/TupleExpr.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TupleExpr.cc'; fi`2266 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TupleExpr.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TupleExpr.Po2267 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TupleExpr.cc' object='SynTree/driver_cfa_cpp-TupleExpr.obj' libtool=no @AMDEPBACKSLASH@2268 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2269 @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-TupleExpr.obj `if test -f 'SynTree/TupleExpr.cc'; then $(CYGPATH_W) 'SynTree/TupleExpr.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TupleExpr.cc'; fi`2270 2271 SynTree/driver_cfa_cpp-CommaExpr.o: SynTree/CommaExpr.cc2272 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-CommaExpr.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-CommaExpr.Tpo -c -o SynTree/driver_cfa_cpp-CommaExpr.o `test -f 'SynTree/CommaExpr.cc' || echo '$(srcdir)/'`SynTree/CommaExpr.cc2273 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-CommaExpr.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-CommaExpr.Po2274 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/CommaExpr.cc' object='SynTree/driver_cfa_cpp-CommaExpr.o' libtool=no @AMDEPBACKSLASH@2275 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2276 @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-CommaExpr.o `test -f 'SynTree/CommaExpr.cc' || echo '$(srcdir)/'`SynTree/CommaExpr.cc2277 2278 SynTree/driver_cfa_cpp-CommaExpr.obj: SynTree/CommaExpr.cc2279 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-CommaExpr.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-CommaExpr.Tpo -c -o SynTree/driver_cfa_cpp-CommaExpr.obj `if test -f 'SynTree/CommaExpr.cc'; then $(CYGPATH_W) 'SynTree/CommaExpr.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/CommaExpr.cc'; fi`2280 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-CommaExpr.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-CommaExpr.Po2281 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/CommaExpr.cc' object='SynTree/driver_cfa_cpp-CommaExpr.obj' libtool=no @AMDEPBACKSLASH@2282 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2283 @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-CommaExpr.obj `if test -f 'SynTree/CommaExpr.cc'; then $(CYGPATH_W) 'SynTree/CommaExpr.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/CommaExpr.cc'; fi`2284 2285 SynTree/driver_cfa_cpp-TypeExpr.o: SynTree/TypeExpr.cc2286 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TypeExpr.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TypeExpr.Tpo -c -o SynTree/driver_cfa_cpp-TypeExpr.o `test -f 'SynTree/TypeExpr.cc' || echo '$(srcdir)/'`SynTree/TypeExpr.cc2287 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TypeExpr.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TypeExpr.Po2288 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TypeExpr.cc' object='SynTree/driver_cfa_cpp-TypeExpr.o' libtool=no @AMDEPBACKSLASH@2289 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2290 @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-TypeExpr.o `test -f 'SynTree/TypeExpr.cc' || echo '$(srcdir)/'`SynTree/TypeExpr.cc2291 2292 SynTree/driver_cfa_cpp-TypeExpr.obj: SynTree/TypeExpr.cc2293 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TypeExpr.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TypeExpr.Tpo -c -o SynTree/driver_cfa_cpp-TypeExpr.obj `if test -f 'SynTree/TypeExpr.cc'; then $(CYGPATH_W) 'SynTree/TypeExpr.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TypeExpr.cc'; fi`2294 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TypeExpr.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TypeExpr.Po2295 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TypeExpr.cc' object='SynTree/driver_cfa_cpp-TypeExpr.obj' libtool=no @AMDEPBACKSLASH@2296 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2297 @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-TypeExpr.obj `if test -f 'SynTree/TypeExpr.cc'; then $(CYGPATH_W) 'SynTree/TypeExpr.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TypeExpr.cc'; fi`2298 2299 SynTree/driver_cfa_cpp-ApplicationExpr.o: SynTree/ApplicationExpr.cc2300 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ApplicationExpr.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ApplicationExpr.Tpo -c -o SynTree/driver_cfa_cpp-ApplicationExpr.o `test -f 'SynTree/ApplicationExpr.cc' || echo '$(srcdir)/'`SynTree/ApplicationExpr.cc2301 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ApplicationExpr.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ApplicationExpr.Po2302 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ApplicationExpr.cc' object='SynTree/driver_cfa_cpp-ApplicationExpr.o' libtool=no @AMDEPBACKSLASH@2303 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2304 @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-ApplicationExpr.o `test -f 'SynTree/ApplicationExpr.cc' || echo '$(srcdir)/'`SynTree/ApplicationExpr.cc2305 2306 SynTree/driver_cfa_cpp-ApplicationExpr.obj: SynTree/ApplicationExpr.cc2307 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ApplicationExpr.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ApplicationExpr.Tpo -c -o SynTree/driver_cfa_cpp-ApplicationExpr.obj `if test -f 'SynTree/ApplicationExpr.cc'; then $(CYGPATH_W) 'SynTree/ApplicationExpr.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ApplicationExpr.cc'; fi`2308 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ApplicationExpr.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ApplicationExpr.Po2309 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ApplicationExpr.cc' object='SynTree/driver_cfa_cpp-ApplicationExpr.obj' libtool=no @AMDEPBACKSLASH@2310 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2311 @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-ApplicationExpr.obj `if test -f 'SynTree/ApplicationExpr.cc'; then $(CYGPATH_W) 'SynTree/ApplicationExpr.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ApplicationExpr.cc'; fi`2312 2313 SynTree/driver_cfa_cpp-AddressExpr.o: SynTree/AddressExpr.cc2314 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-AddressExpr.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-AddressExpr.Tpo -c -o SynTree/driver_cfa_cpp-AddressExpr.o `test -f 'SynTree/AddressExpr.cc' || echo '$(srcdir)/'`SynTree/AddressExpr.cc2315 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-AddressExpr.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-AddressExpr.Po2316 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/AddressExpr.cc' object='SynTree/driver_cfa_cpp-AddressExpr.o' libtool=no @AMDEPBACKSLASH@2317 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2318 @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-AddressExpr.o `test -f 'SynTree/AddressExpr.cc' || echo '$(srcdir)/'`SynTree/AddressExpr.cc2319 2320 SynTree/driver_cfa_cpp-AddressExpr.obj: SynTree/AddressExpr.cc2321 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-AddressExpr.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-AddressExpr.Tpo -c -o SynTree/driver_cfa_cpp-AddressExpr.obj `if test -f 'SynTree/AddressExpr.cc'; then $(CYGPATH_W) 'SynTree/AddressExpr.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/AddressExpr.cc'; fi`2322 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-AddressExpr.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-AddressExpr.Po2323 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/AddressExpr.cc' object='SynTree/driver_cfa_cpp-AddressExpr.obj' libtool=no @AMDEPBACKSLASH@2324 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2325 @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-AddressExpr.obj `if test -f 'SynTree/AddressExpr.cc'; then $(CYGPATH_W) 'SynTree/AddressExpr.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/AddressExpr.cc'; fi`2326 2327 SynTree/driver_cfa_cpp-Statement.o: SynTree/Statement.cc2328 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Statement.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Statement.Tpo -c -o SynTree/driver_cfa_cpp-Statement.o `test -f 'SynTree/Statement.cc' || echo '$(srcdir)/'`SynTree/Statement.cc2329 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Statement.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Statement.Po2330 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Statement.cc' object='SynTree/driver_cfa_cpp-Statement.o' libtool=no @AMDEPBACKSLASH@2331 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2332 @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-Statement.o `test -f 'SynTree/Statement.cc' || echo '$(srcdir)/'`SynTree/Statement.cc2333 2334 SynTree/driver_cfa_cpp-Statement.obj: SynTree/Statement.cc2335 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Statement.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Statement.Tpo -c -o SynTree/driver_cfa_cpp-Statement.obj `if test -f 'SynTree/Statement.cc'; then $(CYGPATH_W) 'SynTree/Statement.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Statement.cc'; fi`2336 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Statement.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Statement.Po2337 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Statement.cc' object='SynTree/driver_cfa_cpp-Statement.obj' libtool=no @AMDEPBACKSLASH@2338 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2339 @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-Statement.obj `if test -f 'SynTree/Statement.cc'; then $(CYGPATH_W) 'SynTree/Statement.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Statement.cc'; fi`2340 2341 SynTree/driver_cfa_cpp-CompoundStmt.o: SynTree/CompoundStmt.cc2342 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-CompoundStmt.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-CompoundStmt.Tpo -c -o SynTree/driver_cfa_cpp-CompoundStmt.o `test -f 'SynTree/CompoundStmt.cc' || echo '$(srcdir)/'`SynTree/CompoundStmt.cc2343 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-CompoundStmt.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-CompoundStmt.Po2344 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/CompoundStmt.cc' object='SynTree/driver_cfa_cpp-CompoundStmt.o' libtool=no @AMDEPBACKSLASH@2345 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2346 @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-CompoundStmt.o `test -f 'SynTree/CompoundStmt.cc' || echo '$(srcdir)/'`SynTree/CompoundStmt.cc2347 2348 SynTree/driver_cfa_cpp-CompoundStmt.obj: SynTree/CompoundStmt.cc2349 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-CompoundStmt.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-CompoundStmt.Tpo -c -o SynTree/driver_cfa_cpp-CompoundStmt.obj `if test -f 'SynTree/CompoundStmt.cc'; then $(CYGPATH_W) 'SynTree/CompoundStmt.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/CompoundStmt.cc'; fi`2350 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-CompoundStmt.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-CompoundStmt.Po2351 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/CompoundStmt.cc' object='SynTree/driver_cfa_cpp-CompoundStmt.obj' libtool=no @AMDEPBACKSLASH@2352 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2353 @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-CompoundStmt.obj `if test -f 'SynTree/CompoundStmt.cc'; then $(CYGPATH_W) 'SynTree/CompoundStmt.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/CompoundStmt.cc'; fi`2354 2355 SynTree/driver_cfa_cpp-DeclStmt.o: SynTree/DeclStmt.cc2356 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-DeclStmt.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-DeclStmt.Tpo -c -o SynTree/driver_cfa_cpp-DeclStmt.o `test -f 'SynTree/DeclStmt.cc' || echo '$(srcdir)/'`SynTree/DeclStmt.cc2357 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-DeclStmt.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-DeclStmt.Po2358 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/DeclStmt.cc' object='SynTree/driver_cfa_cpp-DeclStmt.o' libtool=no @AMDEPBACKSLASH@2359 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2360 @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-DeclStmt.o `test -f 'SynTree/DeclStmt.cc' || echo '$(srcdir)/'`SynTree/DeclStmt.cc2361 2362 SynTree/driver_cfa_cpp-DeclStmt.obj: SynTree/DeclStmt.cc2363 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-DeclStmt.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-DeclStmt.Tpo -c -o SynTree/driver_cfa_cpp-DeclStmt.obj `if test -f 'SynTree/DeclStmt.cc'; then $(CYGPATH_W) 'SynTree/DeclStmt.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/DeclStmt.cc'; fi`2364 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-DeclStmt.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-DeclStmt.Po2365 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/DeclStmt.cc' object='SynTree/driver_cfa_cpp-DeclStmt.obj' libtool=no @AMDEPBACKSLASH@2366 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2367 @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-DeclStmt.obj `if test -f 'SynTree/DeclStmt.cc'; then $(CYGPATH_W) 'SynTree/DeclStmt.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/DeclStmt.cc'; fi`2368 2369 SynTree/driver_cfa_cpp-Declaration.o: SynTree/Declaration.cc2370 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Declaration.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Declaration.Tpo -c -o SynTree/driver_cfa_cpp-Declaration.o `test -f 'SynTree/Declaration.cc' || echo '$(srcdir)/'`SynTree/Declaration.cc2371 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Declaration.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Declaration.Po2372 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Declaration.cc' object='SynTree/driver_cfa_cpp-Declaration.o' libtool=no @AMDEPBACKSLASH@2373 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2374 @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-Declaration.o `test -f 'SynTree/Declaration.cc' || echo '$(srcdir)/'`SynTree/Declaration.cc2375 2376 SynTree/driver_cfa_cpp-Declaration.obj: SynTree/Declaration.cc2377 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Declaration.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Declaration.Tpo -c -o SynTree/driver_cfa_cpp-Declaration.obj `if test -f 'SynTree/Declaration.cc'; then $(CYGPATH_W) 'SynTree/Declaration.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Declaration.cc'; fi`2378 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Declaration.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Declaration.Po2379 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Declaration.cc' object='SynTree/driver_cfa_cpp-Declaration.obj' libtool=no @AMDEPBACKSLASH@2380 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2381 @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-Declaration.obj `if test -f 'SynTree/Declaration.cc'; then $(CYGPATH_W) 'SynTree/Declaration.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Declaration.cc'; fi`2382 2383 SynTree/driver_cfa_cpp-DeclarationWithType.o: SynTree/DeclarationWithType.cc2384 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-DeclarationWithType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-DeclarationWithType.Tpo -c -o SynTree/driver_cfa_cpp-DeclarationWithType.o `test -f 'SynTree/DeclarationWithType.cc' || echo '$(srcdir)/'`SynTree/DeclarationWithType.cc2385 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-DeclarationWithType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-DeclarationWithType.Po2386 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/DeclarationWithType.cc' object='SynTree/driver_cfa_cpp-DeclarationWithType.o' libtool=no @AMDEPBACKSLASH@2387 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2388 @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-DeclarationWithType.o `test -f 'SynTree/DeclarationWithType.cc' || echo '$(srcdir)/'`SynTree/DeclarationWithType.cc2389 2390 SynTree/driver_cfa_cpp-DeclarationWithType.obj: SynTree/DeclarationWithType.cc2391 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-DeclarationWithType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-DeclarationWithType.Tpo -c -o SynTree/driver_cfa_cpp-DeclarationWithType.obj `if test -f 'SynTree/DeclarationWithType.cc'; then $(CYGPATH_W) 'SynTree/DeclarationWithType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/DeclarationWithType.cc'; fi`2392 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-DeclarationWithType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-DeclarationWithType.Po2393 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/DeclarationWithType.cc' object='SynTree/driver_cfa_cpp-DeclarationWithType.obj' libtool=no @AMDEPBACKSLASH@2394 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2395 @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-DeclarationWithType.obj `if test -f 'SynTree/DeclarationWithType.cc'; then $(CYGPATH_W) 'SynTree/DeclarationWithType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/DeclarationWithType.cc'; fi`2396 2397 SynTree/driver_cfa_cpp-ObjectDecl.o: SynTree/ObjectDecl.cc2398 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ObjectDecl.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ObjectDecl.Tpo -c -o SynTree/driver_cfa_cpp-ObjectDecl.o `test -f 'SynTree/ObjectDecl.cc' || echo '$(srcdir)/'`SynTree/ObjectDecl.cc2399 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ObjectDecl.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ObjectDecl.Po2400 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ObjectDecl.cc' object='SynTree/driver_cfa_cpp-ObjectDecl.o' libtool=no @AMDEPBACKSLASH@2401 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2402 @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-ObjectDecl.o `test -f 'SynTree/ObjectDecl.cc' || echo '$(srcdir)/'`SynTree/ObjectDecl.cc2403 2404 SynTree/driver_cfa_cpp-ObjectDecl.obj: SynTree/ObjectDecl.cc2405 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ObjectDecl.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ObjectDecl.Tpo -c -o SynTree/driver_cfa_cpp-ObjectDecl.obj `if test -f 'SynTree/ObjectDecl.cc'; then $(CYGPATH_W) 'SynTree/ObjectDecl.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ObjectDecl.cc'; fi`2406 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ObjectDecl.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ObjectDecl.Po2407 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ObjectDecl.cc' object='SynTree/driver_cfa_cpp-ObjectDecl.obj' libtool=no @AMDEPBACKSLASH@2408 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2409 @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-ObjectDecl.obj `if test -f 'SynTree/ObjectDecl.cc'; then $(CYGPATH_W) 'SynTree/ObjectDecl.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ObjectDecl.cc'; fi`2410 2411 SynTree/driver_cfa_cpp-FunctionDecl.o: SynTree/FunctionDecl.cc2412 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-FunctionDecl.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionDecl.Tpo -c -o SynTree/driver_cfa_cpp-FunctionDecl.o `test -f 'SynTree/FunctionDecl.cc' || echo '$(srcdir)/'`SynTree/FunctionDecl.cc2413 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionDecl.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionDecl.Po2414 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/FunctionDecl.cc' object='SynTree/driver_cfa_cpp-FunctionDecl.o' libtool=no @AMDEPBACKSLASH@2415 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2416 @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-FunctionDecl.o `test -f 'SynTree/FunctionDecl.cc' || echo '$(srcdir)/'`SynTree/FunctionDecl.cc2417 2418 SynTree/driver_cfa_cpp-FunctionDecl.obj: SynTree/FunctionDecl.cc2419 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-FunctionDecl.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionDecl.Tpo -c -o SynTree/driver_cfa_cpp-FunctionDecl.obj `if test -f 'SynTree/FunctionDecl.cc'; then $(CYGPATH_W) 'SynTree/FunctionDecl.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/FunctionDecl.cc'; fi`2420 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionDecl.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-FunctionDecl.Po2421 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/FunctionDecl.cc' object='SynTree/driver_cfa_cpp-FunctionDecl.obj' libtool=no @AMDEPBACKSLASH@2422 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2423 @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-FunctionDecl.obj `if test -f 'SynTree/FunctionDecl.cc'; then $(CYGPATH_W) 'SynTree/FunctionDecl.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/FunctionDecl.cc'; fi`2424 2425 SynTree/driver_cfa_cpp-AggregateDecl.o: SynTree/AggregateDecl.cc2426 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-AggregateDecl.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-AggregateDecl.Tpo -c -o SynTree/driver_cfa_cpp-AggregateDecl.o `test -f 'SynTree/AggregateDecl.cc' || echo '$(srcdir)/'`SynTree/AggregateDecl.cc2427 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-AggregateDecl.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-AggregateDecl.Po2428 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/AggregateDecl.cc' object='SynTree/driver_cfa_cpp-AggregateDecl.o' libtool=no @AMDEPBACKSLASH@2429 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2430 @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-AggregateDecl.o `test -f 'SynTree/AggregateDecl.cc' || echo '$(srcdir)/'`SynTree/AggregateDecl.cc2431 2432 SynTree/driver_cfa_cpp-AggregateDecl.obj: SynTree/AggregateDecl.cc2433 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-AggregateDecl.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-AggregateDecl.Tpo -c -o SynTree/driver_cfa_cpp-AggregateDecl.obj `if test -f 'SynTree/AggregateDecl.cc'; then $(CYGPATH_W) 'SynTree/AggregateDecl.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/AggregateDecl.cc'; fi`2434 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-AggregateDecl.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-AggregateDecl.Po2435 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/AggregateDecl.cc' object='SynTree/driver_cfa_cpp-AggregateDecl.obj' libtool=no @AMDEPBACKSLASH@2436 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2437 @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-AggregateDecl.obj `if test -f 'SynTree/AggregateDecl.cc'; then $(CYGPATH_W) 'SynTree/AggregateDecl.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/AggregateDecl.cc'; fi`2438 2439 SynTree/driver_cfa_cpp-NamedTypeDecl.o: SynTree/NamedTypeDecl.cc2440 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-NamedTypeDecl.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-NamedTypeDecl.Tpo -c -o SynTree/driver_cfa_cpp-NamedTypeDecl.o `test -f 'SynTree/NamedTypeDecl.cc' || echo '$(srcdir)/'`SynTree/NamedTypeDecl.cc2441 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-NamedTypeDecl.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-NamedTypeDecl.Po2442 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/NamedTypeDecl.cc' object='SynTree/driver_cfa_cpp-NamedTypeDecl.o' libtool=no @AMDEPBACKSLASH@2443 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2444 @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-NamedTypeDecl.o `test -f 'SynTree/NamedTypeDecl.cc' || echo '$(srcdir)/'`SynTree/NamedTypeDecl.cc2445 2446 SynTree/driver_cfa_cpp-NamedTypeDecl.obj: SynTree/NamedTypeDecl.cc2447 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-NamedTypeDecl.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-NamedTypeDecl.Tpo -c -o SynTree/driver_cfa_cpp-NamedTypeDecl.obj `if test -f 'SynTree/NamedTypeDecl.cc'; then $(CYGPATH_W) 'SynTree/NamedTypeDecl.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/NamedTypeDecl.cc'; fi`2448 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-NamedTypeDecl.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-NamedTypeDecl.Po2449 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/NamedTypeDecl.cc' object='SynTree/driver_cfa_cpp-NamedTypeDecl.obj' libtool=no @AMDEPBACKSLASH@2450 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2451 @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-NamedTypeDecl.obj `if test -f 'SynTree/NamedTypeDecl.cc'; then $(CYGPATH_W) 'SynTree/NamedTypeDecl.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/NamedTypeDecl.cc'; fi`2452 2453 SynTree/driver_cfa_cpp-TypeDecl.o: SynTree/TypeDecl.cc2454 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TypeDecl.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TypeDecl.Tpo -c -o SynTree/driver_cfa_cpp-TypeDecl.o `test -f 'SynTree/TypeDecl.cc' || echo '$(srcdir)/'`SynTree/TypeDecl.cc2455 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TypeDecl.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TypeDecl.Po2456 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TypeDecl.cc' object='SynTree/driver_cfa_cpp-TypeDecl.o' libtool=no @AMDEPBACKSLASH@2457 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2458 @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-TypeDecl.o `test -f 'SynTree/TypeDecl.cc' || echo '$(srcdir)/'`SynTree/TypeDecl.cc2459 2460 SynTree/driver_cfa_cpp-TypeDecl.obj: SynTree/TypeDecl.cc2461 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TypeDecl.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TypeDecl.Tpo -c -o SynTree/driver_cfa_cpp-TypeDecl.obj `if test -f 'SynTree/TypeDecl.cc'; then $(CYGPATH_W) 'SynTree/TypeDecl.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TypeDecl.cc'; fi`2462 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TypeDecl.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TypeDecl.Po2463 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TypeDecl.cc' object='SynTree/driver_cfa_cpp-TypeDecl.obj' libtool=no @AMDEPBACKSLASH@2464 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2465 @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-TypeDecl.obj `if test -f 'SynTree/TypeDecl.cc'; then $(CYGPATH_W) 'SynTree/TypeDecl.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TypeDecl.cc'; fi`2466 2467 SynTree/driver_cfa_cpp-Initializer.o: SynTree/Initializer.cc2468 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Initializer.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Initializer.Tpo -c -o SynTree/driver_cfa_cpp-Initializer.o `test -f 'SynTree/Initializer.cc' || echo '$(srcdir)/'`SynTree/Initializer.cc2469 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Initializer.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Initializer.Po2470 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Initializer.cc' object='SynTree/driver_cfa_cpp-Initializer.o' libtool=no @AMDEPBACKSLASH@2471 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2472 @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-Initializer.o `test -f 'SynTree/Initializer.cc' || echo '$(srcdir)/'`SynTree/Initializer.cc2473 2474 SynTree/driver_cfa_cpp-Initializer.obj: SynTree/Initializer.cc2475 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Initializer.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Initializer.Tpo -c -o SynTree/driver_cfa_cpp-Initializer.obj `if test -f 'SynTree/Initializer.cc'; then $(CYGPATH_W) 'SynTree/Initializer.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Initializer.cc'; fi`2476 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Initializer.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Initializer.Po2477 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Initializer.cc' object='SynTree/driver_cfa_cpp-Initializer.obj' libtool=no @AMDEPBACKSLASH@2478 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2479 @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-Initializer.obj `if test -f 'SynTree/Initializer.cc'; then $(CYGPATH_W) 'SynTree/Initializer.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Initializer.cc'; fi`2480 2481 SynTree/driver_cfa_cpp-Visitor.o: SynTree/Visitor.cc2482 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Visitor.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Visitor.Tpo -c -o SynTree/driver_cfa_cpp-Visitor.o `test -f 'SynTree/Visitor.cc' || echo '$(srcdir)/'`SynTree/Visitor.cc2483 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Visitor.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Visitor.Po2484 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Visitor.cc' object='SynTree/driver_cfa_cpp-Visitor.o' libtool=no @AMDEPBACKSLASH@2485 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2486 @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-Visitor.o `test -f 'SynTree/Visitor.cc' || echo '$(srcdir)/'`SynTree/Visitor.cc2487 2488 SynTree/driver_cfa_cpp-Visitor.obj: SynTree/Visitor.cc2489 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Visitor.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Visitor.Tpo -c -o SynTree/driver_cfa_cpp-Visitor.obj `if test -f 'SynTree/Visitor.cc'; then $(CYGPATH_W) 'SynTree/Visitor.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Visitor.cc'; fi`2490 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Visitor.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Visitor.Po2491 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Visitor.cc' object='SynTree/driver_cfa_cpp-Visitor.obj' libtool=no @AMDEPBACKSLASH@2492 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2493 @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-Visitor.obj `if test -f 'SynTree/Visitor.cc'; then $(CYGPATH_W) 'SynTree/Visitor.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Visitor.cc'; fi`2494 2495 SynTree/driver_cfa_cpp-Mutator.o: SynTree/Mutator.cc2496 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Mutator.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Mutator.Tpo -c -o SynTree/driver_cfa_cpp-Mutator.o `test -f 'SynTree/Mutator.cc' || echo '$(srcdir)/'`SynTree/Mutator.cc2497 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Mutator.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Mutator.Po2498 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Mutator.cc' object='SynTree/driver_cfa_cpp-Mutator.o' libtool=no @AMDEPBACKSLASH@2499 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2500 @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-Mutator.o `test -f 'SynTree/Mutator.cc' || echo '$(srcdir)/'`SynTree/Mutator.cc2501 2502 SynTree/driver_cfa_cpp-Mutator.obj: SynTree/Mutator.cc2503 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Mutator.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Mutator.Tpo -c -o SynTree/driver_cfa_cpp-Mutator.obj `if test -f 'SynTree/Mutator.cc'; then $(CYGPATH_W) 'SynTree/Mutator.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Mutator.cc'; fi`2504 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Mutator.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Mutator.Po2505 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Mutator.cc' object='SynTree/driver_cfa_cpp-Mutator.obj' libtool=no @AMDEPBACKSLASH@2506 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2507 @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-Mutator.obj `if test -f 'SynTree/Mutator.cc'; then $(CYGPATH_W) 'SynTree/Mutator.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Mutator.cc'; fi`2508 2509 SynTree/driver_cfa_cpp-TypeSubstitution.o: SynTree/TypeSubstitution.cc2510 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TypeSubstitution.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TypeSubstitution.Tpo -c -o SynTree/driver_cfa_cpp-TypeSubstitution.o `test -f 'SynTree/TypeSubstitution.cc' || echo '$(srcdir)/'`SynTree/TypeSubstitution.cc2511 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TypeSubstitution.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TypeSubstitution.Po2512 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TypeSubstitution.cc' object='SynTree/driver_cfa_cpp-TypeSubstitution.o' libtool=no @AMDEPBACKSLASH@2513 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2514 @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-TypeSubstitution.o `test -f 'SynTree/TypeSubstitution.cc' || echo '$(srcdir)/'`SynTree/TypeSubstitution.cc2515 2516 SynTree/driver_cfa_cpp-TypeSubstitution.obj: SynTree/TypeSubstitution.cc2517 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-TypeSubstitution.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-TypeSubstitution.Tpo -c -o SynTree/driver_cfa_cpp-TypeSubstitution.obj `if test -f 'SynTree/TypeSubstitution.cc'; then $(CYGPATH_W) 'SynTree/TypeSubstitution.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TypeSubstitution.cc'; fi`2518 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-TypeSubstitution.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-TypeSubstitution.Po2519 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/TypeSubstitution.cc' object='SynTree/driver_cfa_cpp-TypeSubstitution.obj' libtool=no @AMDEPBACKSLASH@2520 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2521 @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-TypeSubstitution.obj `if test -f 'SynTree/TypeSubstitution.cc'; then $(CYGPATH_W) 'SynTree/TypeSubstitution.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/TypeSubstitution.cc'; fi`2522 2523 SynTree/driver_cfa_cpp-Attribute.o: SynTree/Attribute.cc2524 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Attribute.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Attribute.Tpo -c -o SynTree/driver_cfa_cpp-Attribute.o `test -f 'SynTree/Attribute.cc' || echo '$(srcdir)/'`SynTree/Attribute.cc2525 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Attribute.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Attribute.Po2526 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Attribute.cc' object='SynTree/driver_cfa_cpp-Attribute.o' libtool=no @AMDEPBACKSLASH@2527 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2528 @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.o `test -f 'SynTree/Attribute.cc' || echo '$(srcdir)/'`SynTree/Attribute.cc2529 2530 SynTree/driver_cfa_cpp-Attribute.obj: SynTree/Attribute.cc2531 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-Attribute.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-Attribute.Tpo -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`2532 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-Attribute.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-Attribute.Po2533 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/Attribute.cc' object='SynTree/driver_cfa_cpp-Attribute.obj' libtool=no @AMDEPBACKSLASH@2534 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2535 @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`2536 2537 SynTree/driver_cfa_cpp-VarExprReplacer.o: SynTree/VarExprReplacer.cc2538 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-VarExprReplacer.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-VarExprReplacer.Tpo -c -o SynTree/driver_cfa_cpp-VarExprReplacer.o `test -f 'SynTree/VarExprReplacer.cc' || echo '$(srcdir)/'`SynTree/VarExprReplacer.cc2539 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-VarExprReplacer.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-VarExprReplacer.Po2540 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/VarExprReplacer.cc' object='SynTree/driver_cfa_cpp-VarExprReplacer.o' libtool=no @AMDEPBACKSLASH@2541 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2542 @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-VarExprReplacer.o `test -f 'SynTree/VarExprReplacer.cc' || echo '$(srcdir)/'`SynTree/VarExprReplacer.cc2543 2544 SynTree/driver_cfa_cpp-VarExprReplacer.obj: SynTree/VarExprReplacer.cc2545 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-VarExprReplacer.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-VarExprReplacer.Tpo -c -o SynTree/driver_cfa_cpp-VarExprReplacer.obj `if test -f 'SynTree/VarExprReplacer.cc'; then $(CYGPATH_W) 'SynTree/VarExprReplacer.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/VarExprReplacer.cc'; fi`2546 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-VarExprReplacer.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-VarExprReplacer.Po2547 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/VarExprReplacer.cc' object='SynTree/driver_cfa_cpp-VarExprReplacer.obj' libtool=no @AMDEPBACKSLASH@2548 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2549 @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-VarExprReplacer.obj `if test -f 'SynTree/VarExprReplacer.cc'; then $(CYGPATH_W) 'SynTree/VarExprReplacer.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/VarExprReplacer.cc'; fi`2550 2551 Tuples/driver_cfa_cpp-TupleAssignment.o: Tuples/TupleAssignment.cc2552 @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.cc2553 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Tuples/$(DEPDIR)/driver_cfa_cpp-TupleAssignment.Tpo Tuples/$(DEPDIR)/driver_cfa_cpp-TupleAssignment.Po2554 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Tuples/TupleAssignment.cc' object='Tuples/driver_cfa_cpp-TupleAssignment.o' libtool=no @AMDEPBACKSLASH@2555 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2556 @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.o `test -f 'Tuples/TupleAssignment.cc' || echo '$(srcdir)/'`Tuples/TupleAssignment.cc2557 2558 Tuples/driver_cfa_cpp-TupleAssignment.obj: Tuples/TupleAssignment.cc2559 @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.obj -MD -MP -MF Tuples/$(DEPDIR)/driver_cfa_cpp-TupleAssignment.Tpo -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`2560 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Tuples/$(DEPDIR)/driver_cfa_cpp-TupleAssignment.Tpo Tuples/$(DEPDIR)/driver_cfa_cpp-TupleAssignment.Po2561 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Tuples/TupleAssignment.cc' object='Tuples/driver_cfa_cpp-TupleAssignment.obj' libtool=no @AMDEPBACKSLASH@2562 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2563 @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`2564 2565 Tuples/driver_cfa_cpp-TupleExpansion.o: Tuples/TupleExpansion.cc2566 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Tuples/driver_cfa_cpp-TupleExpansion.o -MD -MP -MF Tuples/$(DEPDIR)/driver_cfa_cpp-TupleExpansion.Tpo -c -o Tuples/driver_cfa_cpp-TupleExpansion.o `test -f 'Tuples/TupleExpansion.cc' || echo '$(srcdir)/'`Tuples/TupleExpansion.cc2567 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Tuples/$(DEPDIR)/driver_cfa_cpp-TupleExpansion.Tpo Tuples/$(DEPDIR)/driver_cfa_cpp-TupleExpansion.Po2568 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Tuples/TupleExpansion.cc' object='Tuples/driver_cfa_cpp-TupleExpansion.o' libtool=no @AMDEPBACKSLASH@2569 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2570 @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-TupleExpansion.o `test -f 'Tuples/TupleExpansion.cc' || echo '$(srcdir)/'`Tuples/TupleExpansion.cc2571 2572 Tuples/driver_cfa_cpp-TupleExpansion.obj: Tuples/TupleExpansion.cc2573 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Tuples/driver_cfa_cpp-TupleExpansion.obj -MD -MP -MF Tuples/$(DEPDIR)/driver_cfa_cpp-TupleExpansion.Tpo -c -o Tuples/driver_cfa_cpp-TupleExpansion.obj `if test -f 'Tuples/TupleExpansion.cc'; then $(CYGPATH_W) 'Tuples/TupleExpansion.cc'; else $(CYGPATH_W) '$(srcdir)/Tuples/TupleExpansion.cc'; fi`2574 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Tuples/$(DEPDIR)/driver_cfa_cpp-TupleExpansion.Tpo Tuples/$(DEPDIR)/driver_cfa_cpp-TupleExpansion.Po2575 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Tuples/TupleExpansion.cc' object='Tuples/driver_cfa_cpp-TupleExpansion.obj' libtool=no @AMDEPBACKSLASH@2576 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2577 @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-TupleExpansion.obj `if test -f 'Tuples/TupleExpansion.cc'; then $(CYGPATH_W) 'Tuples/TupleExpansion.cc'; else $(CYGPATH_W) '$(srcdir)/Tuples/TupleExpansion.cc'; fi`2578 2579 Tuples/driver_cfa_cpp-Explode.o: Tuples/Explode.cc2580 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Tuples/driver_cfa_cpp-Explode.o -MD -MP -MF Tuples/$(DEPDIR)/driver_cfa_cpp-Explode.Tpo -c -o Tuples/driver_cfa_cpp-Explode.o `test -f 'Tuples/Explode.cc' || echo '$(srcdir)/'`Tuples/Explode.cc2581 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Tuples/$(DEPDIR)/driver_cfa_cpp-Explode.Tpo Tuples/$(DEPDIR)/driver_cfa_cpp-Explode.Po2582 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Tuples/Explode.cc' object='Tuples/driver_cfa_cpp-Explode.o' libtool=no @AMDEPBACKSLASH@2583 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2584 @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-Explode.o `test -f 'Tuples/Explode.cc' || echo '$(srcdir)/'`Tuples/Explode.cc2585 2586 Tuples/driver_cfa_cpp-Explode.obj: Tuples/Explode.cc2587 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Tuples/driver_cfa_cpp-Explode.obj -MD -MP -MF Tuples/$(DEPDIR)/driver_cfa_cpp-Explode.Tpo -c -o Tuples/driver_cfa_cpp-Explode.obj `if test -f 'Tuples/Explode.cc'; then $(CYGPATH_W) 'Tuples/Explode.cc'; else $(CYGPATH_W) '$(srcdir)/Tuples/Explode.cc'; fi`2588 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Tuples/$(DEPDIR)/driver_cfa_cpp-Explode.Tpo Tuples/$(DEPDIR)/driver_cfa_cpp-Explode.Po2589 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Tuples/Explode.cc' object='Tuples/driver_cfa_cpp-Explode.obj' libtool=no @AMDEPBACKSLASH@2590 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2591 @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-Explode.obj `if test -f 'Tuples/Explode.cc'; then $(CYGPATH_W) 'Tuples/Explode.cc'; else $(CYGPATH_W) '$(srcdir)/Tuples/Explode.cc'; fi`2592 2593 Virtual/driver_cfa_cpp-ExpandCasts.o: Virtual/ExpandCasts.cc2594 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Virtual/driver_cfa_cpp-ExpandCasts.o -MD -MP -MF Virtual/$(DEPDIR)/driver_cfa_cpp-ExpandCasts.Tpo -c -o Virtual/driver_cfa_cpp-ExpandCasts.o `test -f 'Virtual/ExpandCasts.cc' || echo '$(srcdir)/'`Virtual/ExpandCasts.cc2595 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Virtual/$(DEPDIR)/driver_cfa_cpp-ExpandCasts.Tpo Virtual/$(DEPDIR)/driver_cfa_cpp-ExpandCasts.Po2596 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Virtual/ExpandCasts.cc' object='Virtual/driver_cfa_cpp-ExpandCasts.o' libtool=no @AMDEPBACKSLASH@2597 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2598 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Virtual/driver_cfa_cpp-ExpandCasts.o `test -f 'Virtual/ExpandCasts.cc' || echo '$(srcdir)/'`Virtual/ExpandCasts.cc2599 2600 Virtual/driver_cfa_cpp-ExpandCasts.obj: Virtual/ExpandCasts.cc2601 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Virtual/driver_cfa_cpp-ExpandCasts.obj -MD -MP -MF Virtual/$(DEPDIR)/driver_cfa_cpp-ExpandCasts.Tpo -c -o Virtual/driver_cfa_cpp-ExpandCasts.obj `if test -f 'Virtual/ExpandCasts.cc'; then $(CYGPATH_W) 'Virtual/ExpandCasts.cc'; else $(CYGPATH_W) '$(srcdir)/Virtual/ExpandCasts.cc'; fi`2602 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) Virtual/$(DEPDIR)/driver_cfa_cpp-ExpandCasts.Tpo Virtual/$(DEPDIR)/driver_cfa_cpp-ExpandCasts.Po2603 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Virtual/ExpandCasts.cc' object='Virtual/driver_cfa_cpp-ExpandCasts.obj' libtool=no @AMDEPBACKSLASH@2604 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2605 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Virtual/driver_cfa_cpp-ExpandCasts.obj `if test -f 'Virtual/ExpandCasts.cc'; then $(CYGPATH_W) 'Virtual/ExpandCasts.cc'; else $(CYGPATH_W) '$(srcdir)/Virtual/ExpandCasts.cc'; fi`2606 1222 2607 1223 .ll.cc: … … 2696 1312 check: $(BUILT_SOURCES) 2697 1313 $(MAKE) $(AM_MAKEFLAGS) check-am 2698 all-am: Makefile $( PROGRAMS)1314 all-am: Makefile $(LIBRARIES) $(PROGRAMS) 2699 1315 installdirs: 2700 1316 for dir in "$(DESTDIR)$(cfa_cpplibdir)"; do \ … … 2722 1338 fi 2723 1339 mostlyclean-generic: 1340 -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) 2724 1341 2725 1342 clean-generic: … … 2728 1345 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 2729 1346 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 1347 -rm -f ../driver/$(am__dirstamp) 2730 1348 -rm -f CodeGen/$(DEPDIR)/$(am__dirstamp) 2731 1349 -rm -f CodeGen/$(am__dirstamp) … … 2752 1370 -rm -f Tuples/$(DEPDIR)/$(am__dirstamp) 2753 1371 -rm -f Tuples/$(am__dirstamp) 1372 -rm -f Validate/$(DEPDIR)/$(am__dirstamp) 1373 -rm -f Validate/$(am__dirstamp) 2754 1374 -rm -f Virtual/$(DEPDIR)/$(am__dirstamp) 2755 1375 -rm -f Virtual/$(am__dirstamp) 2756 -rm -f driver/$(am__dirstamp)2757 1376 2758 1377 maintainer-clean-generic: … … 2766 1385 clean: clean-am 2767 1386 2768 clean-am: clean-cfa_cpplibPROGRAMS clean-generic mostlyclean-am 1387 clean-am: clean-cfa_cpplibPROGRAMS clean-generic clean-noinstLIBRARIES \ 1388 mostlyclean-am 2769 1389 2770 1390 distclean: distclean-am 2771 -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) V irtual/$(DEPDIR)1391 -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR) 2772 1392 -rm -f Makefile 2773 1393 distclean-am: clean-am distclean-compile distclean-generic \ … … 2815 1435 2816 1436 maintainer-clean: maintainer-clean-am 2817 -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) V irtual/$(DEPDIR)1437 -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR) 2818 1438 -rm -f Makefile 2819 1439 maintainer-clean-am: distclean-am maintainer-clean-generic … … 2836 1456 2837 1457 .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ 2838 clean-cfa_cpplibPROGRAMS clean-generic cscopelist-am ctags \ 2839 ctags-am distclean distclean-compile distclean-generic \ 2840 distclean-tags distdir dvi dvi-am html html-am info info-am \ 2841 install install-am install-cfa_cpplibPROGRAMS install-data \ 2842 install-data-am install-dvi install-dvi-am install-exec \ 2843 install-exec-am install-html install-html-am install-info \ 2844 install-info-am install-man install-pdf install-pdf-am \ 2845 install-ps install-ps-am install-strip installcheck \ 2846 installcheck-am installdirs maintainer-clean \ 2847 maintainer-clean-generic mostlyclean mostlyclean-compile \ 2848 mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ 2849 uninstall-am uninstall-cfa_cpplibPROGRAMS 1458 clean-cfa_cpplibPROGRAMS clean-generic clean-noinstLIBRARIES \ 1459 cscopelist-am ctags ctags-am distclean distclean-compile \ 1460 distclean-generic distclean-tags distdir dvi dvi-am html \ 1461 html-am info info-am install install-am \ 1462 install-cfa_cpplibPROGRAMS install-data install-data-am \ 1463 install-dvi install-dvi-am install-exec install-exec-am \ 1464 install-html install-html-am install-info install-info-am \ 1465 install-man install-pdf install-pdf-am install-ps \ 1466 install-ps-am install-strip installcheck installcheck-am \ 1467 installdirs maintainer-clean maintainer-clean-generic \ 1468 mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ 1469 ps ps-am tags tags-am uninstall uninstall-am \ 1470 uninstall-cfa_cpplibPROGRAMS 2850 1471 2851 1472 .PRECIOUS: Makefile -
src/Parser/DeclarationNode.cc
rf9feab8 r90152a4 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Nov 20 09:21:52 201713 // Update Count : 1 03112 // Last Modified On : Fri Jul 20 14:56:54 2018 13 // Update Count : 1107 14 14 // 15 15 … … 32 32 #include "SynTree/Type.h" // for Type, Type::StorageClasses, Type::... 33 33 #include "TypeData.h" // for TypeData, TypeData::Aggregate_t 34 #include "TypedefTable.h" // for TypedefTable , TypedefTable::kind_t...34 #include "TypedefTable.h" // for TypedefTable 35 35 36 36 class Initializer; … … 47 47 const char * DeclarationNode::aggregateNames[] = { "struct", "union", "trait", "coroutine", "monitor", "thread", "NoAggregateNames" }; 48 48 const char * DeclarationNode::typeClassNames[] = { "otype", "dtype", "ftype", "NoTypeClassNames" }; 49 const char * DeclarationNode::builtinTypeNames[] = { "__builtin_va_list", " NoBuiltinTypeNames" };49 const char * DeclarationNode::builtinTypeNames[] = { "__builtin_va_list", "zero_t", "one_t", "NoBuiltinTypeNames" }; 50 50 51 51 UniqueName DeclarationNode::anonymous( "__anonymous" ); … … 54 54 55 55 DeclarationNode::DeclarationNode() : 56 type( nullptr ), 57 bitfieldWidth( nullptr ), 58 hasEllipsis( false ), 59 linkage( ::linkage ), 60 asmName( nullptr ), 61 initializer( nullptr ), 62 extension( false ), 63 asmStmt( nullptr ) { 56 linkage( ::linkage ) { 64 57 65 58 // variable.name = nullptr; … … 71 64 attr.expr = nullptr; 72 65 attr.type = nullptr; 66 67 assert.condition = nullptr; 68 assert.message = nullptr; 73 69 } 74 70 … … 88 84 // asmName, no delete, passed to next stage 89 85 delete initializer; 86 87 delete assert.condition; 88 delete assert.message; 90 89 } 91 90 … … 95 94 newnode->name = name ? new string( *name ) : nullptr; 96 95 96 newnode->builtin = NoBuiltinType; 97 97 newnode->type = maybeClone( type ); 98 newnode->inLine = inLine; 98 99 newnode->storageClasses = storageClasses; 99 100 newnode->funcSpecs = funcSpecs; … … 117 118 newnode->attr.expr = maybeClone( attr.expr ); 118 119 newnode->attr.type = maybeClone( attr.type ); 120 121 newnode->assert.condition = maybeClone( assert.condition ); 122 newnode->assert.message = maybeClone( assert.message ); 119 123 return newnode; 120 124 } // DeclarationNode::clone 121 125 122 bool DeclarationNode::get_hasEllipsis() const { 123 return hasEllipsis; 124 } 125 126 void DeclarationNode::print( std::ostream &os, int indent ) const { 126 void DeclarationNode::print( std::ostream & os, int indent ) const { 127 127 os << string( indent, ' ' ); 128 128 if ( name ) { … … 160 160 } 161 161 162 void DeclarationNode::printList( std::ostream & os, int indent ) const {162 void DeclarationNode::printList( std::ostream & os, int indent ) const { 163 163 ParseNode::printList( os, indent ); 164 164 if ( hasEllipsis ) { … … 167 167 } 168 168 169 DeclarationNode * DeclarationNode::newFunction( string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body, bool newStyle) {169 DeclarationNode * DeclarationNode::newFunction( const string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body ) { 170 170 DeclarationNode * newnode = new DeclarationNode; 171 171 newnode->name = name; 172 172 newnode->type = new TypeData( TypeData::Function ); 173 173 newnode->type->function.params = param; 174 newnode->type->function.newStyle = newStyle;175 174 newnode->type->function.body = body; 176 177 // ignore unnamed routine declarations: void p( int (*)(int) );178 if ( newnode->name ) {179 typedefTable.addToEnclosingScope( *newnode->name, TypedefTable::ID );180 } // if181 175 182 176 if ( ret ) { … … 244 238 } // DeclarationNode::newForall 245 239 246 DeclarationNode * DeclarationNode::newFromTypedef( string * name ) {240 DeclarationNode * DeclarationNode::newFromTypedef( const string * name ) { 247 241 DeclarationNode * newnode = new DeclarationNode; 248 242 newnode->type = new TypeData( TypeData::SymbolicInst ); … … 253 247 } // DeclarationNode::newFromTypedef 254 248 249 DeclarationNode * DeclarationNode::newFromGlobalScope() { 250 DeclarationNode * newnode = new DeclarationNode; 251 newnode->type = new TypeData( TypeData::GlobalScope ); 252 return newnode; 253 } 254 255 DeclarationNode * DeclarationNode::newQualifiedType( DeclarationNode * parent, DeclarationNode * child) { 256 DeclarationNode * newnode = new DeclarationNode; 257 newnode->type = new TypeData( TypeData::Qualified ); 258 newnode->type->qualified.parent = parent->type; 259 newnode->type->qualified.child = child->type; 260 parent->type = nullptr; 261 child->type = nullptr; 262 delete parent; 263 delete child; 264 return newnode; 265 } 266 255 267 DeclarationNode * DeclarationNode::newAggregate( Aggregate kind, const string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body ) { 256 assert( name );257 268 DeclarationNode * newnode = new DeclarationNode; 258 269 newnode->type = new TypeData( TypeData::Aggregate ); 259 270 newnode->type->aggregate.kind = kind; 260 newnode->type->aggregate.name = name;271 newnode->type->aggregate.name = name == nullptr ? new string( DeclarationNode::anonymous.newName() ) : name; 261 272 newnode->type->aggregate.actuals = actuals; 262 273 newnode->type->aggregate.fields = fields; … … 264 275 newnode->type->aggregate.tagged = false; 265 276 newnode->type->aggregate.parent = nullptr; 277 newnode->type->aggregate.anon = name == nullptr; 266 278 return newnode; 267 279 } // DeclarationNode::newAggregate 268 280 269 DeclarationNode * DeclarationNode::newEnum( string * name, DeclarationNode * constants, bool body ) { 270 assert( name ); 281 DeclarationNode * DeclarationNode::newEnum( const string * name, DeclarationNode * constants, bool body ) { 271 282 DeclarationNode * newnode = new DeclarationNode; 272 283 newnode->type = new TypeData( TypeData::Enum ); 273 newnode->type->enumeration.name = name ;284 newnode->type->enumeration.name = name == nullptr ? new string( DeclarationNode::anonymous.newName() ) : name; 274 285 newnode->type->enumeration.constants = constants; 275 286 newnode->type->enumeration.body = body; 287 newnode->type->enumeration.anon = name == nullptr; 276 288 return newnode; 277 289 } // DeclarationNode::newEnum 278 290 279 DeclarationNode * DeclarationNode::newEnumConstant( string * name, ExpressionNode * constant ) {291 DeclarationNode * DeclarationNode::newEnumConstant( const string * name, ExpressionNode * constant ) { 280 292 DeclarationNode * newnode = new DeclarationNode; 281 293 newnode->name = name; 282 294 newnode->enumeratorValue.reset( constant ); 283 typedefTable.addToEnclosingScope( *newnode->name, TypedefTable::ID );284 295 return newnode; 285 296 } // DeclarationNode::newEnumConstant 286 297 287 DeclarationNode * DeclarationNode::newName( string * name ) {298 DeclarationNode * DeclarationNode::newName( const string * name ) { 288 299 DeclarationNode * newnode = new DeclarationNode; 289 300 newnode->name = name; … … 291 302 } // DeclarationNode::newName 292 303 293 DeclarationNode * DeclarationNode::newFromTypeGen( string * name, ExpressionNode * params ) {304 DeclarationNode * DeclarationNode::newFromTypeGen( const string * name, ExpressionNode * params ) { 294 305 DeclarationNode * newnode = new DeclarationNode; 295 306 newnode->type = new TypeData( TypeData::SymbolicInst ); … … 300 311 } // DeclarationNode::newFromTypeGen 301 312 302 DeclarationNode * DeclarationNode::newTypeParam( TypeClass tc, string * name ) {313 DeclarationNode * DeclarationNode::newTypeParam( TypeClass tc, const string * name ) { 303 314 DeclarationNode * newnode = new DeclarationNode; 304 315 newnode->type = nullptr; … … 331 342 } // DeclarationNode::newTraitUse 332 343 333 DeclarationNode * DeclarationNode::newTypeDecl( string * name, DeclarationNode * typeParams ) {344 DeclarationNode * DeclarationNode::newTypeDecl( const string * name, DeclarationNode * typeParams ) { 334 345 DeclarationNode * newnode = new DeclarationNode; 335 346 newnode->name = name; … … 343 354 DeclarationNode * newnode = new DeclarationNode; 344 355 newnode->type = new TypeData( kind == OperKinds::PointTo ? TypeData::Pointer : TypeData::Reference ); 356 if ( kind == OperKinds::And ) { 357 // T && is parsed as 'And' operator rather than two references => add a second reference type 358 TypeData * td = new TypeData( TypeData::Reference ); 359 td->base = newnode->type; 360 newnode->type = td; 361 } 345 362 if ( qualifiers ) { 346 363 return newnode->addQualifiers( qualifiers ); … … 400 417 } // DeclarationNode::newBuiltinType 401 418 402 DeclarationNode * DeclarationNode::newAttr( string * name, ExpressionNode * expr ) {419 DeclarationNode * DeclarationNode::newAttr( const string * name, ExpressionNode * expr ) { 403 420 DeclarationNode * newnode = new DeclarationNode; 404 421 newnode->type = nullptr; … … 409 426 } 410 427 411 DeclarationNode * DeclarationNode::newAttr( string * name, DeclarationNode * type ) {428 DeclarationNode * DeclarationNode::newAttr( const string * name, DeclarationNode * type ) { 412 429 DeclarationNode * newnode = new DeclarationNode; 413 430 newnode->type = nullptr; … … 418 435 } 419 436 420 DeclarationNode * DeclarationNode::newAttribute( string * name, ExpressionNode * expr ) {437 DeclarationNode * DeclarationNode::newAttribute( const string * name, ExpressionNode * expr ) { 421 438 DeclarationNode * newnode = new DeclarationNode; 422 439 newnode->type = nullptr; … … 433 450 return newnode; 434 451 } 452 453 DeclarationNode * DeclarationNode::newStaticAssert( ExpressionNode * condition, Expression * message ) { 454 DeclarationNode * newnode = new DeclarationNode; 455 newnode->assert.condition = condition; 456 newnode->assert.message = message; 457 return newnode; 458 } 459 435 460 436 461 void appendError( string & dst, const string & src ) { … … 489 514 } // DeclarationNode::copySpecifiers 490 515 491 static void addQualifiersToType( TypeData *&src, TypeData * dst ) { 492 if ( src->forall && dst->kind == TypeData::Function ) { 493 if ( dst->forall ) { 494 dst->forall->appendList( src->forall ); 495 } else { 496 dst->forall = src->forall; 497 } // if 498 src->forall = nullptr; 499 } // if 516 static void addQualifiersToType( TypeData *& src, TypeData * dst ) { 500 517 if ( dst->base ) { 501 518 addQualifiersToType( src, dst->base ); … … 509 526 510 527 DeclarationNode * DeclarationNode::addQualifiers( DeclarationNode * q ) { 511 if ( ! q ) { delete q; return this; }// empty qualifier528 if ( ! q ) { return this; } // empty qualifier 512 529 513 530 checkSpecifiers( q ); … … 531 548 type->aggregate.params->appendList( q->type->forall ); // augment forall qualifier 532 549 } else { // not polymorphic 533 type->aggregate.params = q->type->forall; // make polymorphic type 534 // change implicit typedef from TYPEDEFname to TYPEGENname 535 typedefTable.changeKind( *type->aggregate.name, TypedefTable::TG ); 550 type->aggregate.params = q->type->forall; // set forall qualifier 536 551 } // if 537 552 } else { // not polymorphic … … 543 558 544 559 checkQualifiers( type, q->type ); 560 if ( (builtin == Zero || builtin == One) && q->type->qualifiers.val != 0 && error.length() == 0 ) { 561 SemanticWarning( yylloc, Warning::BadQualifiersZeroOne, Type::QualifiersNames[ilog2( q->type->qualifiers.val )], builtinTypeNames[builtin] ); 562 } // if 545 563 addQualifiersToType( q->type, type ); 546 564 … … 549 567 } // addQualifiers 550 568 551 static void addTypeToType( TypeData *& src, TypeData *&dst ) {569 static void addTypeToType( TypeData *& src, TypeData *& dst ) { 552 570 if ( src->forall && dst->kind == TypeData::Function ) { 553 571 if ( dst->forall ) { … … 575 593 dst->basictype = src->basictype; 576 594 } else if ( src->basictype != DeclarationNode::NoBasicType ) 577 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::basicTypeNames[ src->basictype ] + " in type: ", src);595 SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::basicTypeNames[ src->basictype ] + " in type: " ); 578 596 579 597 if ( dst->complextype == DeclarationNode::NoComplexType ) { 580 598 dst->complextype = src->complextype; 581 599 } else if ( src->complextype != DeclarationNode::NoComplexType ) 582 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::complexTypeNames[ src->complextype ] + " in type: ", src);600 SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::complexTypeNames[ src->complextype ] + " in type: " ); 583 601 584 602 if ( dst->signedness == DeclarationNode::NoSignedness ) { 585 603 dst->signedness = src->signedness; 586 604 } else if ( src->signedness != DeclarationNode::NoSignedness ) 587 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::signednessNames[ src->signedness ] + " in type: ", src);605 SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::signednessNames[ src->signedness ] + " in type: " ); 588 606 589 607 if ( dst->length == DeclarationNode::NoLength ) { … … 592 610 dst->length = DeclarationNode::LongLong; 593 611 } else if ( src->length != DeclarationNode::NoLength ) 594 throw SemanticError( string( "conflicting type specifier " ) + DeclarationNode::lengthNames[ src->length ] + " in type: ", src);612 SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::lengthNames[ src->length ] + " in type: " ); 595 613 } // if 596 614 break; … … 717 735 } 718 736 719 DeclarationNode * DeclarationNode::addFunctionBody( StatementNode * body, StatementNode * with) {737 DeclarationNode * DeclarationNode::addFunctionBody( StatementNode * body, ExpressionNode * withExprs ) { 720 738 assert( type ); 721 739 assert( type->kind == TypeData::Function ); 722 740 assert( ! type->function.body ); 723 if ( with ) {724 // convert725 // void f(S s) with (s) { x = 0; }726 // to727 // void f(S s) { with(s) { x = 0; } }728 WithStmt * withStmt = strict_dynamic_cast< WithStmt * >( with->build() );729 withStmt->stmt = body->build();730 delete body;731 delete with;732 body = new StatementNode( new CompoundStmt( { withStmt } ) );733 }734 741 type->function.body = body; 742 type->function.withExprs = withExprs; 735 743 return this; 736 744 } … … 771 779 DeclarationNode * DeclarationNode::addPointer( DeclarationNode * p ) { 772 780 if ( p ) { 773 assert( p->type->kind == TypeData::Pointer || TypeData::Reference );781 assert( p->type->kind == TypeData::Pointer || p->type->kind == TypeData::Reference ); 774 782 setBase( p->type ); 775 783 p->type = nullptr; … … 916 924 delete newType->aggInst.aggregate->enumeration.constants; 917 925 newType->aggInst.aggregate->enumeration.constants = nullptr; 926 newType->aggInst.aggregate->enumeration.body = false; 918 927 } else { 919 928 assert( newType->aggInst.aggregate->kind == TypeData::Aggregate ); 920 929 delete newType->aggInst.aggregate->aggregate.fields; 921 930 newType->aggInst.aggregate->aggregate.fields = nullptr; 931 newType->aggInst.aggregate->aggregate.body = false; 922 932 } // if 923 933 // don't hoist twice … … 948 958 } 949 959 950 void buildList( const DeclarationNode * firstNode, std::list< Declaration * > & outputList ) {951 SemanticError errors;960 void buildList( const DeclarationNode * firstNode, std::list< Declaration * > & outputList ) { 961 SemanticErrorException errors; 952 962 std::back_insert_iterator< std::list< Declaration * > > out( outputList ); 953 963 954 964 for ( const DeclarationNode * cur = firstNode; cur; cur = dynamic_cast< DeclarationNode * >( cur->get_next() ) ) { 955 965 try { 966 bool extracted = false; 967 bool anon = false; 956 968 if ( DeclarationNode * extr = cur->extractAggregate() ) { 957 969 // handle the case where a structure declaration is contained within an object or type declaration 958 970 Declaration * decl = extr->build(); 959 971 if ( decl ) { 972 // hoist the structure declaration 960 973 decl->location = cur->location; 961 974 * out++ = decl; 975 976 // need to remember the cases where a declaration contains an anonymous aggregate definition 977 extracted = true; 978 assert( extr->type ); 979 if ( extr->type->kind == TypeData::Aggregate ) { 980 anon = extr->type->aggregate.anon; 981 } else if ( extr->type->kind == TypeData::Enum ) { 982 // xxx - is it useful to have an implicit anonymous enum member? 983 anon = extr->type->enumeration.anon; 984 } 962 985 } // if 963 986 delete extr; … … 966 989 Declaration * decl = cur->build(); 967 990 if ( decl ) { 968 decl->location = cur->location; 969 * out++ = decl; 991 // don't include anonymous declaration for named aggregates, but do include them for anonymous aggregates, e.g.: 992 // struct S { 993 // struct T { int x; }; // no anonymous member 994 // struct { int y; }; // anonymous member 995 // struct T; // anonymous member 996 // }; 997 if ( ! (extracted && decl->name == "" && ! anon && ! cur->get_inLine()) ) { 998 if ( decl->name == "" ) { 999 if ( DeclarationWithType * dwt = dynamic_cast<DeclarationWithType *>( decl ) ) { 1000 if ( ReferenceToType * aggr = dynamic_cast<ReferenceToType *>( dwt->get_type() ) ) { 1001 if ( aggr->name.find("anonymous") == std::string::npos ) { 1002 if ( ! cur->get_inLine() ) { 1003 // temporary: warn about anonymous member declarations of named types, since 1004 // this conflicts with the syntax for the forward declaration of an anonymous type 1005 SemanticWarning( cur->location, Warning::AggrForwardDecl, aggr->name.c_str() ); 1006 } // if 1007 } // if 1008 } // if 1009 } // if 1010 } // if 1011 decl->location = cur->location; 1012 *out++ = decl; 1013 } // if 970 1014 } // if 971 } catch( SemanticError &e ) { 972 e.set_location( cur->location ); 1015 } catch( SemanticErrorException & e ) { 973 1016 errors.append( e ); 974 1017 } // try 975 } // while1018 } // for 976 1019 977 1020 if ( ! errors.isEmpty() ) { … … 980 1023 } // buildList 981 1024 982 void buildList( const DeclarationNode * firstNode, std::list< DeclarationWithType * > &outputList ) { 983 SemanticError errors; 1025 // currently only builds assertions, function parameters, and return values 1026 void buildList( const DeclarationNode * firstNode, std::list< DeclarationWithType * > & outputList ) { 1027 SemanticErrorException errors; 984 1028 std::back_insert_iterator< std::list< DeclarationWithType * > > out( outputList ); 985 1029 … … 987 1031 try { 988 1032 Declaration * decl = cur->build(); 989 if ( decl ) { 990 if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * >( decl ) ) { 991 dwt->location = cur->location; 992 * out++ = dwt; 993 } else if ( StructDecl * agg = dynamic_cast< StructDecl * >( decl ) ) { 994 StructInstType * inst = new StructInstType( Type::Qualifiers(), agg->get_name() ); 995 auto obj = new ObjectDecl( "", Type::StorageClasses(), linkage, nullptr, inst, nullptr ); 996 obj->location = cur->location; 997 * out++ = obj; 998 delete agg; 999 } else if ( UnionDecl * agg = dynamic_cast< UnionDecl * >( decl ) ) { 1000 UnionInstType * inst = new UnionInstType( Type::Qualifiers(), agg->get_name() ); 1001 auto obj = new ObjectDecl( "", Type::StorageClasses(), linkage, nullptr, inst, nullptr ); 1002 obj->location = cur->location; 1003 * out++ = obj; 1004 } // if 1033 assert( decl ); 1034 if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * >( decl ) ) { 1035 dwt->location = cur->location; 1036 * out++ = dwt; 1037 } else if ( StructDecl * agg = dynamic_cast< StructDecl * >( decl ) ) { 1038 // e.g., int foo(struct S) {} 1039 StructInstType * inst = new StructInstType( Type::Qualifiers(), agg->name ); 1040 auto obj = new ObjectDecl( "", Type::StorageClasses(), linkage, nullptr, inst, nullptr ); 1041 obj->location = cur->location; 1042 * out++ = obj; 1043 delete agg; 1044 } else if ( UnionDecl * agg = dynamic_cast< UnionDecl * >( decl ) ) { 1045 // e.g., int foo(union U) {} 1046 UnionInstType * inst = new UnionInstType( Type::Qualifiers(), agg->name ); 1047 auto obj = new ObjectDecl( "", Type::StorageClasses(), linkage, nullptr, inst, nullptr ); 1048 obj->location = cur->location; 1049 * out++ = obj; 1050 } else if ( EnumDecl * agg = dynamic_cast< EnumDecl * >( decl ) ) { 1051 // e.g., int foo(enum E) {} 1052 EnumInstType * inst = new EnumInstType( Type::Qualifiers(), agg->name ); 1053 auto obj = new ObjectDecl( "", Type::StorageClasses(), linkage, nullptr, inst, nullptr ); 1054 obj->location = cur->location; 1055 * out++ = obj; 1005 1056 } // if 1006 } catch( SemanticError &e ) { 1007 e.set_location( cur->location ); 1057 } catch( SemanticErrorException & e ) { 1008 1058 errors.append( e ); 1009 1059 } // try … … 1015 1065 } // buildList 1016 1066 1017 void buildTypeList( const DeclarationNode * firstNode, std::list< Type * > & outputList ) {1018 SemanticError errors;1067 void buildTypeList( const DeclarationNode * firstNode, std::list< Type * > & outputList ) { 1068 SemanticErrorException errors; 1019 1069 std::back_insert_iterator< std::list< Type * > > out( outputList ); 1020 1070 const DeclarationNode * cur = firstNode; … … 1023 1073 try { 1024 1074 * out++ = cur->buildType(); 1025 } catch( SemanticError &e ) { 1026 e.set_location( cur->location ); 1075 } catch( SemanticErrorException & e ) { 1027 1076 errors.append( e ); 1028 1077 } // try … … 1036 1085 1037 1086 Declaration * DeclarationNode::build() const { 1038 if ( ! error.empty() ) throw SemanticError( error + " in declaration of ", this);1087 if ( ! error.empty() ) SemanticError( this, error + " in declaration of " ); 1039 1088 1040 1089 if ( asmStmt ) { … … 1059 1108 // inline _Noreturn int i; // disallowed 1060 1109 if ( type->kind != TypeData::Function && funcSpecs.any() ) { 1061 throw SemanticError( "invalid function specifier for ", this ); 1062 } // if 1063 return buildDecl( type, name ? *name : string( "" ), storageClasses, maybeBuild< Expression >( bitfieldWidth ), funcSpecs, linkage, asmName, maybeBuild< Initializer >(initializer), attributes )->set_extension( extension ); 1064 } // if 1110 SemanticError( this, "invalid function specifier for " ); 1111 } // if 1112 // Forall qualifier can only appear on a function/aggregate definition/declaration. 1113 // 1114 // forall int f(); // allowed 1115 // forall int g( int i ); // allowed 1116 // forall int i; // disallowed 1117 if ( type->kind != TypeData::Function && type->forall ) { 1118 SemanticError( this, "invalid type qualifier for " ); 1119 } // if 1120 bool isDelete = initializer && initializer->get_isDelete(); 1121 Declaration * decl = buildDecl( type, name ? *name : string( "" ), storageClasses, maybeBuild< Expression >( bitfieldWidth ), funcSpecs, linkage, asmName, isDelete ? nullptr : maybeBuild< Initializer >(initializer), attributes )->set_extension( extension ); 1122 if ( isDelete ) { 1123 DeclarationWithType * dwt = strict_dynamic_cast<DeclarationWithType *>( decl ); 1124 dwt->isDeleted = true; 1125 } 1126 return decl; 1127 } // if 1128 1129 if ( assert.condition ) { 1130 return new StaticAssertDecl( maybeBuild< Expression >( assert.condition ), strict_dynamic_cast< ConstantExpr * >( maybeClone( assert.message ) ) ); 1131 } 1065 1132 1066 1133 // SUE's cannot have function specifiers, either … … 1069 1136 // inlne _Noreturn enum E { ... }; // disallowed 1070 1137 if ( funcSpecs.any() ) { 1071 throw SemanticError( "invalid function specifier for ", this);1138 SemanticError( this, "invalid function specifier for " ); 1072 1139 } // if 1073 1140 assertf( name, "ObjectDecl must a have name\n" ); -
src/Parser/ExpressionNode.cc
rf9feab8 r90152a4 10 10 // Created On : Sat May 16 13:17:07 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Sep 27 22:51:55 201713 // Update Count : 78112 // Last Modified On : Mon Jun 4 21:24:45 2018 13 // Update Count : 802 14 14 // 15 15 … … 58 58 static inline bool checkD( char c ) { return c == 'd' || c == 'D'; } 59 59 static inline bool checkI( char c ) { return c == 'i' || c == 'I'; } 60 static inline bool checkB( char c ) { return c == 'b' || c == 'B'; } 60 61 static inline bool checkX( char c ) { return c == 'x' || c == 'X'; } 61 62 … … 93 94 } // checkLNInt 94 95 95 static void sepNumeric( string & str, string & units ) {96 string::size_type posn = str.find_first_of( "`" );97 if ( posn != string::npos ) {98 units = "?" + str.substr( posn ); // extract units99 str.erase( posn ); // remove units100 } // if101 } // sepNumeric102 103 96 Expression * build_constantInteger( string & str ) { 104 97 static const BasicType::Kind kind[2][6] = { … … 108 101 }; 109 102 110 string units;111 sepNumeric( str, units ); // separate constant from units112 113 103 bool dec = true, Unsigned = false; // decimal, unsigned constant 114 104 int size; // 0 => short, 1 => char, 2 => int, 3 => long int, 4 => long long int, 5 => int128 … … 116 106 117 107 unsigned long long int v; // converted integral value 118 size_t last = str.length() - 1; // last characterof constant108 size_t last = str.length() - 1; // last subscript of constant 119 109 Expression * ret; 120 110 … … 129 119 } // if 130 120 131 if ( str[0] == '0' ) { // octal/hex constant ? 121 // Cannot be "0" 122 123 if ( str[0] == '0' ) { // radix character ? 132 124 dec = false; 133 if ( last != 0 && checkX( str[1] ) ) {// hex constant ?125 if ( checkX( str[1] ) ) { // hex constant ? 134 126 sscanf( (char *)str.c_str(), "%llx", &v ); 127 //printf( "%llx %llu\n", v, v ); 128 } else if ( checkB( str[1] ) ) { // binary constant ? 129 v = 0; 130 for ( unsigned int i = 2;; i += 1 ) { // compute value 131 if ( str[i] == '1' ) v |= 1; 132 if ( i == last ) break; 133 v <<= 1; 134 } // for 135 135 //printf( "%llx %llu\n", v, v ); 136 136 } else { // octal constant … … 211 211 if ( Unsigned && size < 2 ) { // hh or h, less than int ? 212 212 // int i = -1uh => 65535 not -1, so cast is necessary for unsigned, which unfortunately eliminates warnings for large values. 213 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][size] ) );213 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][size] ), false ); 214 214 } else if ( lnth != -1 ) { // explicit length ? 215 215 if ( lnth == 5 ) { // int128 ? 216 216 size = 5; 217 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][size] ) );217 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][size] ), false ); 218 218 } else { 219 ret = new CastExpr( ret, new TypeInstType( Type::Qualifiers(), lnthsInt[Unsigned][lnth], false ) );219 ret = new CastExpr( ret, new TypeInstType( Type::Qualifiers(), lnthsInt[Unsigned][lnth], false ), false ); 220 220 } // if 221 221 } // if 222 222 CLEANUP: 223 if ( units.length() != 0 ) {224 ret = new UntypedExpr( new NameExpr( units ), { ret } );225 } // if226 223 227 224 delete &str; // created by lex … … 257 254 }; 258 255 259 string units;260 sepNumeric( str, units ); // separate constant from units261 262 256 bool complx = false; // real, complex 263 257 int size = 1; // 0 => float, 1 => double, 2 => long double … … 291 285 Expression * ret = new ConstantExpr( Constant( new BasicType( noQualifiers, kind[complx][size] ), str, v ) ); 292 286 if ( lnth != -1 ) { // explicit length ? 293 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[complx][size] ) ); 294 } // if 295 if ( units.length() != 0 ) { 296 ret = new UntypedExpr( new NameExpr( units ), { ret } ); 287 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[complx][size] ), false ); 297 288 } // if 298 289 … … 323 314 324 315 Expression * build_constantStr( string & str ) { 316 assert( str.length() > 0 ); 325 317 string units; // units 326 318 sepString( str, units, '"' ); // separate constant from units … … 356 348 357 349 Expression * build_field_name_FLOATING_FRACTIONconstant( const string & str ) { 358 if ( str.find_first_not_of( "0123456789", 1 ) != string::npos ) throw SemanticError("invalid tuple index " + str );350 if ( str.find_first_not_of( "0123456789", 1 ) != string::npos ) SemanticError( yylloc, "invalid tuple index " + str ); 359 351 Expression * ret = build_constantInteger( *new string( str.substr(1) ) ); 360 352 delete &str; … … 363 355 364 356 Expression * build_field_name_FLOATING_DECIMALconstant( const string & str ) { 365 if ( str[str.size()-1] != '.' ) throw SemanticError("invalid tuple index " + str );357 if ( str[str.size()-1] != '.' ) SemanticError( yylloc, "invalid tuple index " + str ); 366 358 Expression * ret = build_constantInteger( *new string( str.substr( 0, str.size()-1 ) ) ); 367 359 delete &str; … … 417 409 if ( dynamic_cast< VoidType * >( targetType ) ) { 418 410 delete targetType; 419 return new CastExpr( maybeMoveBuild< Expression >(expr_node) );411 return new CastExpr( maybeMoveBuild< Expression >(expr_node), false ); 420 412 } else { 421 return new CastExpr( maybeMoveBuild< Expression >(expr_node), targetType );413 return new CastExpr( maybeMoveBuild< Expression >(expr_node), targetType, false ); 422 414 } // if 423 415 } // build_cast 416 417 Expression * build_keyword_cast( KeywordCastExpr::Target target, ExpressionNode * expr_node ) { 418 return new KeywordCastExpr( maybeMoveBuild< Expression >(expr_node), target ); 419 } 424 420 425 421 Expression * build_virtual_cast( DeclarationNode * decl_node, ExpressionNode * expr_node ) { -
src/Parser/InitializerNode.cc
rf9feab8 r90152a4 27 27 28 28 InitializerNode::InitializerNode( ExpressionNode * _expr, bool aggrp, ExpressionNode * des ) 29 : expr( _expr ), aggregate( aggrp ), designator( des ), kids( nullptr ), maybeConstructed( true ) {29 : expr( _expr ), aggregate( aggrp ), designator( des ), kids( nullptr ), maybeConstructed( true ), isDelete( false ) { 30 30 if ( aggrp ) 31 31 kids = dynamic_cast< InitializerNode * >( get_next() ); … … 36 36 37 37 InitializerNode::InitializerNode( InitializerNode * init, bool aggrp, ExpressionNode * des ) 38 : expr( nullptr ), aggregate( aggrp ), designator( des ), kids( nullptr ), maybeConstructed( true ) {38 : expr( nullptr ), aggregate( aggrp ), designator( des ), kids( nullptr ), maybeConstructed( true ), isDelete( false ) { 39 39 if ( init ) 40 40 set_last( init ); … … 46 46 set_next( nullptr ); 47 47 } // InitializerNode::InitializerNode 48 49 InitializerNode::InitializerNode( bool isDelete ) : expr( nullptr ), aggregate( false ), designator( nullptr ), kids( nullptr ), maybeConstructed( false ), isDelete( isDelete ) {} 48 50 49 51 InitializerNode::~InitializerNode() { … … 84 86 85 87 Initializer * InitializerNode::build() const { 88 assertf( ! isDelete, "Should not build delete stmt InitializerNode" ); 86 89 if ( aggregate ) { 87 90 // steal designators from children -
src/Parser/LinkageSpec.cc
rf9feab8 r90152a4 24 24 namespace LinkageSpec { 25 25 26 Spec linkageCheck( const string * spec ) {26 Spec linkageCheck( CodeLocation location, const string * spec ) { 27 27 assert( spec ); 28 28 unique_ptr<const string> guard( spec ); // allocated by lexer … … 34 34 return BuiltinC; 35 35 } else { 36 throw SemanticError("Invalid linkage specifier " + *spec );36 SemanticError( location, "Invalid linkage specifier " + *spec ); 37 37 } // if 38 38 } 39 39 40 Spec linkageUpdate( Spec old_spec, const string * cmd ) {40 Spec linkageUpdate( CodeLocation location, Spec old_spec, const string * cmd ) { 41 41 assert( cmd ); 42 42 unique_ptr<const string> guard( cmd ); // allocated by lexer … … 48 48 return old_spec; 49 49 } else { 50 throw SemanticError("Invalid linkage specifier " + *cmd );50 SemanticError( location, "Invalid linkage specifier " + *cmd ); 51 51 } // if 52 52 } -
src/Parser/LinkageSpec.h
rf9feab8 r90152a4 10 10 // Created On : Sat May 16 13:24:28 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 22 09:32:16 201713 // Update Count : 1 412 // Last Modified On : Mon Jul 2 07:46:49 2018 13 // Update Count : 16 14 14 // 15 15 … … 18 18 #include <string> 19 19 20 #include "Common/CodeLocation.h" 21 20 22 namespace LinkageSpec { 21 23 // All linkage specs are some combination of these flags: 22 enum { 23 Mangle = 1 << 0, 24 Generate = 1 << 1, 25 Overrideable = 1 << 2, 26 Builtin = 1 << 3, 27 28 NoOfSpecs = 1 << 4, 29 }; 24 enum { Mangle = 1 << 0, Generate = 1 << 1, Overrideable = 1 << 2, Builtin = 1 << 3, GccBuiltin = 1 << 4, NoOfSpecs = 1 << 5, }; 30 25 31 26 union Spec { … … 36 31 bool is_overridable : 1; 37 32 bool is_builtin : 1; 33 bool is_gcc_builtin : 1; 38 34 }; 39 35 constexpr Spec( unsigned int val ) : val( val ) {} 40 constexpr Spec( Spec const & other ) : val( other.val ) {}36 constexpr Spec( Spec const & other ) : val( other.val ) {} 41 37 // Operators may go here. 42 38 // Supports == and != 43 constexpr operator unsigned int 39 constexpr operator unsigned int() const { return val; } 44 40 }; 45 41 46 42 47 Spec linkageCheck( const std::string * );43 Spec linkageCheck( CodeLocation location, const std::string * ); 48 44 // Returns the Spec with the given name (limited to C, Cforall & BuiltinC) 49 Spec linkageUpdate( Spec old_spec, const std::string * cmd );45 Spec linkageUpdate( CodeLocation location, Spec old_spec, const std::string * cmd ); 50 46 /* If cmd = "C" returns a Spec that is old_spec with is_mangled = false 51 47 * If cmd = "Cforall" returns old_spec Spec with is_mangled = true … … 59 55 inline bool isOverridable( Spec spec ) { return spec.is_overridable; } 60 56 inline bool isBuiltin( Spec spec ) { return spec.is_builtin; } 57 inline bool isGccBuiltin( Spec spec ) { return spec.is_gcc_builtin; } 61 58 62 59 // Pre-defined flag combinations: … … 70 67 constexpr Spec const AutoGen = { Mangle | Generate | Overrideable }; 71 68 // gcc internal 72 constexpr Spec const Compiler = { Builtin };69 constexpr Spec const Compiler = { Mangle | Builtin | GccBuiltin }; 73 70 // mangled builtins 74 71 constexpr Spec const BuiltinCFA = { Mangle | Generate | Builtin }; -
src/Parser/ParseNode.h
rf9feab8 r90152a4 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Nov 27 17:33:35 201713 // Update Count : 8 2412 // Last Modified On : Sat Aug 4 09:39:40 2018 13 // Update Count : 853 14 14 // 15 15 … … 68 68 } 69 69 70 virtual void print( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const {}71 virtual void printList( std::ostream & os, int indent = 0 ) const {70 virtual void print( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const {} 71 virtual void printList( std::ostream & os, int indent = 0 ) const { 72 72 print( os, indent ); 73 73 if ( next ) next->print( os, indent ); … … 77 77 78 78 ParseNode * next = nullptr; 79 std::string * name = nullptr;79 const std::string * name = nullptr; 80 80 CodeLocation location = yylloc; 81 81 }; // ParseNode … … 87 87 InitializerNode( ExpressionNode *, bool aggrp = false, ExpressionNode * des = nullptr ); 88 88 InitializerNode( InitializerNode *, bool aggrp = false, ExpressionNode * des = nullptr ); 89 InitializerNode( bool isDelete ); 89 90 ~InitializerNode(); 90 91 virtual InitializerNode * clone() const { assert( false ); return nullptr; } … … 98 99 bool get_maybeConstructed() const { return maybeConstructed; } 99 100 101 bool get_isDelete() const { return isDelete; } 102 100 103 InitializerNode * next_init() const { return kids; } 101 104 102 void print( std::ostream & os, int indent = 0 ) const;105 void print( std::ostream & os, int indent = 0 ) const; 103 106 void printOneLine( std::ostream & ) const; 104 107 … … 110 113 InitializerNode * kids; 111 114 bool maybeConstructed; 115 bool isDelete; 112 116 }; // InitializerNode 113 117 … … 123 127 ExpressionNode * set_extension( bool exten ) { extension = exten; return this; } 124 128 125 virtual void print( std::ostream &os, __attribute__((unused)) int indent = 0 ) const override { 126 os << expr.get() << std::endl; 127 } 128 void printOneLine( __attribute__((unused)) std::ostream &os, __attribute__((unused)) int indent = 0 ) const {} 129 129 virtual void print( std::ostream & os, __attribute__((unused)) int indent = 0 ) const override { 130 os << expr.get(); 131 } 132 void printOneLine( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const {} 133 134 Expression *get_expr() const { return expr.get(); } 130 135 template<typename T> 131 136 bool isExpressionType() const { return nullptr != dynamic_cast<T>(expr.get()); } … … 167 172 }; 168 173 169 Expression * build_constantInteger( std::string & str );170 Expression * build_constantFloat( std::string & str );171 Expression * build_constantChar( std::string & str );172 Expression * build_constantStr( std::string & str );174 Expression * build_constantInteger( std::string & str ); // these 4 routines modify the string 175 Expression * build_constantFloat( std::string & str ); 176 Expression * build_constantChar( std::string & str ); 177 Expression * build_constantStr( std::string & str ); 173 178 Expression * build_field_name_FLOATING_FRACTIONconstant( const std::string & str ); 174 179 Expression * build_field_name_FLOATING_DECIMALconstant( const std::string & str ); … … 179 184 180 185 Expression * build_cast( DeclarationNode * decl_node, ExpressionNode * expr_node ); 186 Expression * build_keyword_cast( KeywordCastExpr::Target target, ExpressionNode * expr_node ); 181 187 Expression * build_virtual_cast( DeclarationNode * decl_node, ExpressionNode * expr_node ); 182 188 Expression * build_fieldSel( ExpressionNode * expr_node, Expression * member ); … … 209 215 enum Length { Short, Long, LongLong, NoLength }; 210 216 static const char * lengthNames[]; 211 enum Aggregate { Struct, Union, Trait, Coroutine, Monitor, Thread, NoAggregate };217 enum Aggregate { Struct, Union, Exception, Trait, Coroutine, Monitor, Thread, NoAggregate }; 212 218 static const char * aggregateNames[]; 213 219 enum TypeClass { Otype, Dtype, Ftype, Ttype, NoTypeClass }; … … 225 231 static DeclarationNode * newBuiltinType( BuiltinType ); 226 232 static DeclarationNode * newForall( DeclarationNode * ); 227 static DeclarationNode * newFromTypedef( std::string * ); 228 static DeclarationNode * newFunction( std::string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body, bool newStyle = false ); 233 static DeclarationNode * newFromTypedef( const std::string * ); 234 static DeclarationNode * newFromGlobalScope(); 235 static DeclarationNode * newQualifiedType( DeclarationNode *, DeclarationNode * ); 236 static DeclarationNode * newFunction( const std::string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body ); 229 237 static DeclarationNode * newAggregate( Aggregate kind, const std::string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body ); 230 static DeclarationNode * newEnum( std::string * name, DeclarationNode * constants, bool body );231 static DeclarationNode * newEnumConstant( std::string * name, ExpressionNode * constant );232 static DeclarationNode * newName( std::string * );233 static DeclarationNode * newFromTypeGen( std::string *, ExpressionNode * params );234 static DeclarationNode * newTypeParam( TypeClass, std::string * );238 static DeclarationNode * newEnum( const std::string * name, DeclarationNode * constants, bool body ); 239 static DeclarationNode * newEnumConstant( const std::string * name, ExpressionNode * constant ); 240 static DeclarationNode * newName( const std::string * ); 241 static DeclarationNode * newFromTypeGen( const std::string *, ExpressionNode * params ); 242 static DeclarationNode * newTypeParam( TypeClass, const std::string * ); 235 243 static DeclarationNode * newTrait( const std::string * name, DeclarationNode * params, DeclarationNode * asserts ); 236 244 static DeclarationNode * newTraitUse( const std::string * name, ExpressionNode * params ); 237 static DeclarationNode * newTypeDecl( std::string * name, DeclarationNode * typeParams );245 static DeclarationNode * newTypeDecl( const std::string * name, DeclarationNode * typeParams ); 238 246 static DeclarationNode * newPointer( DeclarationNode * qualifiers, OperKinds kind ); 239 247 static DeclarationNode * newArray( ExpressionNode * size, DeclarationNode * qualifiers, bool isStatic ); … … 242 250 static DeclarationNode * newTuple( DeclarationNode * members ); 243 251 static DeclarationNode * newTypeof( ExpressionNode * expr ); 244 static DeclarationNode * newAttr( std::string *, ExpressionNode * expr ); // @ attributes245 static DeclarationNode * newAttr( std::string *, DeclarationNode * type ); // @ attributes246 static DeclarationNode * newAttribute( std::string *, ExpressionNode * expr = nullptr ); // gcc attributes252 static DeclarationNode * newAttr( const std::string *, ExpressionNode * expr ); // @ attributes 253 static DeclarationNode * newAttr( const std::string *, DeclarationNode * type ); // @ attributes 254 static DeclarationNode * newAttribute( const std::string *, ExpressionNode * expr = nullptr ); // gcc attributes 247 255 static DeclarationNode * newAsmStmt( StatementNode * stmt ); // gcc external asm statement 256 static DeclarationNode * newStaticAssert( ExpressionNode * condition, Expression * message ); 248 257 249 258 DeclarationNode(); … … 262 271 DeclarationNode * addBitfield( ExpressionNode * size ); 263 272 DeclarationNode * addVarArgs(); 264 DeclarationNode * addFunctionBody( StatementNode * body, StatementNode * with = nullptr );273 DeclarationNode * addFunctionBody( StatementNode * body, ExpressionNode * with = nullptr ); 265 274 DeclarationNode * addOldDeclList( DeclarationNode * list ); 266 275 DeclarationNode * setBase( TypeData * newType ); … … 282 291 } 283 292 284 virtual void print( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const override;285 virtual void printList( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const override;293 virtual void print( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const override; 294 virtual void printList( __attribute__((unused)) std::ostream & os, __attribute__((unused)) int indent = 0 ) const override; 286 295 287 296 Declaration * build() const; 288 297 Type * buildType() const; 289 298 290 bool get_hasEllipsis() const;291 299 LinkageSpec::Spec get_linkage() const { return linkage; } 292 300 DeclarationNode * extractAggregate() const; … … 296 304 bool get_extension() const { return extension; } 297 305 DeclarationNode * set_extension( bool exten ) { extension = exten; return this; } 306 307 bool get_inLine() const { return inLine; } 308 DeclarationNode * set_inLine( bool inL ) { inLine = inL; return this; } 298 309 public: 299 310 DeclarationNode * get_last() { return (DeclarationNode *)ParseNode::get_last(); } … … 314 325 Attr_t attr; 315 326 316 BuiltinType builtin; 317 318 TypeData * type; 319 327 struct StaticAssert_t { 328 ExpressionNode * condition; 329 Expression * message; 330 }; 331 StaticAssert_t assert; 332 333 BuiltinType builtin = NoBuiltinType; 334 335 TypeData * type = nullptr; 336 337 bool inLine = false; 320 338 Type::FuncSpecifiers funcSpecs; 321 339 Type::StorageClasses storageClasses; 322 340 323 ExpressionNode * bitfieldWidth ;341 ExpressionNode * bitfieldWidth = nullptr; 324 342 std::unique_ptr<ExpressionNode> enumeratorValue; 325 bool hasEllipsis ;343 bool hasEllipsis = false; 326 344 LinkageSpec::Spec linkage; 327 Expression * asmName;345 Expression * asmName = nullptr; 328 346 std::list< Attribute * > attributes; 329 InitializerNode * initializer ;347 InitializerNode * initializer = nullptr; 330 348 bool extension = false; 331 349 std::string error; 332 StatementNode * asmStmt ;350 StatementNode * asmStmt = nullptr; 333 351 334 352 static UniqueName anonymous; … … 364 382 virtual StatementNode * append_last_case( StatementNode * ); 365 383 366 virtual void print( std::ostream & os, __attribute__((unused)) int indent = 0 ) const override {384 virtual void print( std::ostream & os, __attribute__((unused)) int indent = 0 ) const override { 367 385 os << stmt.get() << std::endl; 368 386 } … … 373 391 Statement * build_expr( ExpressionNode * ctl ); 374 392 375 struct IfCt l {376 IfCt l( DeclarationNode * decl, ExpressionNode * condition ) :393 struct IfCtrl { 394 IfCtrl( DeclarationNode * decl, ExpressionNode * condition ) : 377 395 init( decl ? new StatementNode( decl ) : nullptr ), condition( condition ) {} 378 396 … … 381 399 }; 382 400 383 struct ForCt l {384 ForCt l( ExpressionNode * expr, ExpressionNode * condition, ExpressionNode * change ) :401 struct ForCtrl { 402 ForCtrl( ExpressionNode * expr, ExpressionNode * condition, ExpressionNode * change ) : 385 403 init( new StatementNode( build_expr( expr ) ) ), condition( condition ), change( change ) {} 386 ForCt l( DeclarationNode * decl, ExpressionNode * condition, ExpressionNode * change ) :404 ForCtrl( DeclarationNode * decl, ExpressionNode * condition, ExpressionNode * change ) : 387 405 init( new StatementNode( decl ) ), condition( condition ), change( change ) {} 388 406 … … 392 410 }; 393 411 394 Statement * build_if( IfCtl * ctl, StatementNode * then_stmt, StatementNode * else_stmt ); 395 Statement * build_switch( ExpressionNode * ctl, StatementNode * stmt ); 412 Expression * build_if_control( IfCtrl * ctl, std::list< Statement * > & init ); 413 Statement * build_if( IfCtrl * ctl, StatementNode * then_stmt, StatementNode * else_stmt ); 414 Statement * build_switch( bool isSwitch, ExpressionNode * ctl, StatementNode * stmt ); 396 415 Statement * build_case( ExpressionNode * ctl ); 397 416 Statement * build_default(); 398 Statement * build_while( ExpressionNode * ctl, StatementNode * stmt, bool kind = false ); 399 Statement * build_for( ForCtl * forctl, StatementNode * stmt ); 417 Statement * build_while( IfCtrl * ctl, StatementNode * stmt ); 418 Statement * build_do_while( ExpressionNode * ctl, StatementNode * stmt ); 419 Statement * build_for( ForCtrl * forctl, StatementNode * stmt ); 400 420 Statement * build_branch( BranchStmt::Type kind ); 401 421 Statement * build_branch( std::string * identifier, BranchStmt::Type kind ); … … 409 429 Statement * build_finally( StatementNode * stmt ); 410 430 Statement * build_compound( StatementNode * first ); 411 Statement * build_asmstmt( bool voltile, Expression * instruction, ExpressionNode * output = nullptr, ExpressionNode * input = nullptr, ExpressionNode * clobber = nullptr, LabelNode * gotolabels = nullptr ); 431 Statement * build_asm( bool voltile, Expression * instruction, ExpressionNode * output = nullptr, ExpressionNode * input = nullptr, ExpressionNode * clobber = nullptr, LabelNode * gotolabels = nullptr ); 432 Statement * build_directive( std::string * directive ); 412 433 WaitForStmt * build_waitfor( ExpressionNode * target, StatementNode * stmt, ExpressionNode * when ); 413 434 WaitForStmt * build_waitfor( ExpressionNode * target, StatementNode * stmt, ExpressionNode * when, WaitForStmt * existing ); … … 419 440 420 441 template< typename SynTreeType, typename NodeType, template< typename, typename...> class Container, typename... Args > 421 void buildList( const NodeType * firstNode, Container< SynTreeType *, Args... > & outputList ) {422 SemanticError errors;442 void buildList( const NodeType * firstNode, Container< SynTreeType *, Args... > & outputList ) { 443 SemanticErrorException errors; 423 444 std::back_insert_iterator< Container< SynTreeType *, Args... > > out( outputList ); 424 445 const NodeType * cur = firstNode; … … 433 454 assertf(false, "buildList unknown type"); 434 455 } // if 435 } catch( SemanticError &e ) { 436 e.set_location( cur->location ); 456 } catch( SemanticErrorException & e ) { 437 457 errors.append( e ); 438 458 } // try … … 445 465 446 466 // in DeclarationNode.cc 447 void buildList( const DeclarationNode * firstNode, std::list< Declaration * > & outputList );448 void buildList( const DeclarationNode * firstNode, std::list< DeclarationWithType * > & outputList );449 void buildTypeList( const DeclarationNode * firstNode, std::list< Type * > & outputList );467 void buildList( const DeclarationNode * firstNode, std::list< Declaration * > & outputList ); 468 void buildList( const DeclarationNode * firstNode, std::list< DeclarationWithType * > & outputList ); 469 void buildTypeList( const DeclarationNode * firstNode, std::list< Type * > & outputList ); 450 470 451 471 template< typename SynTreeType, typename NodeType > 452 void buildMoveList( const NodeType * firstNode, std::list< SynTreeType * > & outputList ) {472 void buildMoveList( const NodeType * firstNode, std::list< SynTreeType * > & outputList ) { 453 473 buildList( firstNode, outputList ); 454 474 delete firstNode; -
src/Parser/StatementNode.cc
rf9feab8 r90152a4 10 10 // Created On : Sat May 16 14:59:41 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Sep 1 23:25:23 201713 // Update Count : 3 4612 // Last Modified On : Sat Aug 4 09:39:25 2018 13 // Update Count : 363 14 14 // 15 15 … … 33 33 34 34 35 StatementNode::StatementNode( DeclarationNode * decl ) {35 StatementNode::StatementNode( DeclarationNode * decl ) { 36 36 assert( decl ); 37 DeclarationNode * agg = decl->extractAggregate();37 DeclarationNode * agg = decl->extractAggregate(); 38 38 if ( agg ) { 39 StatementNode * nextStmt = new StatementNode( new DeclStmt( maybeBuild< Declaration >( decl ) ) );39 StatementNode * nextStmt = new StatementNode( new DeclStmt( maybeBuild< Declaration >( decl ) ) ); 40 40 set_next( nextStmt ); 41 41 if ( decl->get_next() ) { … … 53 53 } // StatementNode::StatementNode 54 54 55 StatementNode * StatementNode::append_last_case( StatementNode *stmt ) {56 StatementNode * prev = this;55 StatementNode * StatementNode::append_last_case( StatementNode * stmt ) { 56 StatementNode * prev = this; 57 57 // find end of list and maintain previous pointer 58 58 for ( StatementNode * curr = prev; curr != nullptr; curr = (StatementNode *)curr->get_next() ) { 59 StatementNode * node = strict_dynamic_cast< StatementNode * >(curr);59 StatementNode * node = strict_dynamic_cast< StatementNode * >(curr); 60 60 assert( dynamic_cast< CaseStmt * >(node->stmt.get()) ); 61 61 prev = curr; 62 62 } // for 63 63 // convert from StatementNode list to Statement list 64 StatementNode * node = dynamic_cast< StatementNode * >(prev);64 StatementNode * node = dynamic_cast< StatementNode * >(prev); 65 65 std::list< Statement * > stmts; 66 66 buildMoveList( stmt, stmts ); … … 69 69 caseStmt->get_statements().splice( caseStmt->get_statements().end(), stmts ); 70 70 return this; 71 } 72 73 Statement *build_expr( ExpressionNode *ctl ) { 74 Expression *e = maybeMoveBuild< Expression >( ctl ); 75 76 if ( e ) 77 return new ExprStmt( e ); 78 else 79 return new NullStmt(); 80 } 81 82 Statement *build_if( IfCtl * ctl, StatementNode *then_stmt, StatementNode *else_stmt ) { 83 Statement *thenb, *elseb = 0; 84 std::list< Statement * > branches; 85 buildMoveList< Statement, StatementNode >( then_stmt, branches ); 86 assert( branches.size() == 1 ); 87 thenb = branches.front(); 88 89 if ( else_stmt ) { 90 std::list< Statement * > branches; 91 buildMoveList< Statement, StatementNode >( else_stmt, branches ); 92 assert( branches.size() == 1 ); 93 elseb = branches.front(); 94 } // if 95 96 std::list< Statement * > init; 71 } // StatementNode::append_last_case 72 73 Statement * build_expr( ExpressionNode * ctl ) { 74 Expression * e = maybeMoveBuild< Expression >( ctl ); 75 76 if ( e ) return new ExprStmt( e ); 77 else return new NullStmt(); 78 } // build_expr 79 80 Expression * build_if_control( IfCtrl * ctl, std::list< Statement * > & init ) { 97 81 if ( ctl->init != 0 ) { 98 82 buildMoveList( ctl->init, init ); … … 102 86 if ( ctl->condition ) { 103 87 // compare the provided condition against 0 104 cond = 88 cond = notZeroExpr( maybeMoveBuild< Expression >(ctl->condition) ); 105 89 } else { 106 90 for ( Statement * stmt : init ) { … … 113 97 } 114 98 delete ctl; 99 return cond; 100 } // build_if_control 101 102 Statement * build_if( IfCtrl * ctl, StatementNode * then_stmt, StatementNode * else_stmt ) { 103 Statement * thenb, * elseb = nullptr; 104 std::list< Statement * > branches; 105 buildMoveList< Statement, StatementNode >( then_stmt, branches ); 106 assert( branches.size() == 1 ); 107 thenb = branches.front(); 108 109 if ( else_stmt ) { 110 std::list< Statement * > branches; 111 buildMoveList< Statement, StatementNode >( else_stmt, branches ); 112 assert( branches.size() == 1 ); 113 elseb = branches.front(); 114 } // if 115 116 std::list< Statement * > init; 117 Expression * cond = build_if_control( ctl, init ); 115 118 return new IfStmt( cond, thenb, elseb, init ); 116 } 117 118 Statement *build_switch( ExpressionNode *ctl, StatementNode *stmt ) { 119 std::list< Statement * > branches; 120 buildMoveList< Statement, StatementNode >( stmt, branches ); 119 } // build_if 120 121 Statement * build_switch( bool isSwitch, ExpressionNode * ctl, StatementNode * stmt ) { 122 std::list< Statement * > branches; 123 buildMoveList< Statement, StatementNode >( stmt, branches ); 124 if ( ! isSwitch ) { // choose statement 125 for ( Statement * stmt : branches ) { 126 CaseStmt * caseStmt = strict_dynamic_cast< CaseStmt * >( stmt ); 127 if ( ! caseStmt->stmts.empty() ) { // code after "case" => end of case list 128 CompoundStmt * block = strict_dynamic_cast< CompoundStmt * >( caseStmt->stmts.front() ); 129 block->kids.push_back( new BranchStmt( "", BranchStmt::Break ) ); 130 } // if 131 } // for 132 } // if 121 133 // branches.size() == 0 for switch (...) {}, i.e., no declaration or statements 122 134 return new SwitchStmt( maybeMoveBuild< Expression >(ctl), branches ); 123 } 124 Statement *build_case( ExpressionNode *ctl ) { 135 } // build_switch 136 137 Statement * build_case( ExpressionNode * ctl ) { 125 138 std::list< Statement * > branches; 126 139 return new CaseStmt( maybeMoveBuild< Expression >(ctl), branches ); 127 } 128 Statement *build_default() { 140 } // build_case 141 142 Statement * build_default() { 129 143 std::list< Statement * > branches; 130 144 return new CaseStmt( nullptr, branches, true ); 131 } 132 133 Statement *build_while( ExpressionNode *ctl, StatementNode *stmt, bool kind ) { 134 std::list< Statement * > branches; 135 buildMoveList< Statement, StatementNode >( stmt, branches ); 136 assert( branches.size() == 1 ); 137 return new WhileStmt( notZeroExpr( maybeMoveBuild< Expression >(ctl) ), branches.front(), kind ); 138 } 139 140 Statement *build_for( ForCtl *forctl, StatementNode *stmt ) { 145 } // build_default 146 147 Statement * build_while( IfCtrl * ctl, StatementNode * stmt ) { 148 std::list< Statement * > branches; 149 buildMoveList< Statement, StatementNode >( stmt, branches ); 150 assert( branches.size() == 1 ); 151 152 std::list< Statement * > init; 153 Expression * cond = build_if_control( ctl, init ); 154 return new WhileStmt( cond, branches.front(), init, false ); 155 } // build_while 156 157 Statement * build_do_while( ExpressionNode * ctl, StatementNode * stmt ) { 158 std::list< Statement * > branches; 159 buildMoveList< Statement, StatementNode >( stmt, branches ); 160 assert( branches.size() == 1 ); 161 162 std::list< Statement * > init; 163 return new WhileStmt( notZeroExpr( maybeMoveBuild< Expression >(ctl) ), branches.front(), init, true ); 164 } // build_do_while 165 166 Statement * build_for( ForCtrl * forctl, StatementNode * stmt ) { 141 167 std::list< Statement * > branches; 142 168 buildMoveList< Statement, StatementNode >( stmt, branches ); … … 148 174 } // if 149 175 150 Expression * cond = 0;176 Expression * cond = 0; 151 177 if ( forctl->condition != 0 ) 152 178 cond = notZeroExpr( maybeMoveBuild< Expression >(forctl->condition) ); 153 179 154 Expression * incr = 0;180 Expression * incr = 0; 155 181 if ( forctl->change != 0 ) 156 182 incr = maybeMoveBuild< Expression >(forctl->change); … … 158 184 delete forctl; 159 185 return new ForStmt( init, cond, incr, branches.front() ); 160 } 161 162 Statement * build_branch( BranchStmt::Type kind ) {186 } // build_for 187 188 Statement * build_branch( BranchStmt::Type kind ) { 163 189 Statement * ret = new BranchStmt( "", kind ); 164 190 return ret; 165 } 166 Statement *build_branch( std::string *identifier, BranchStmt::Type kind ) { 167 Statement * ret = new BranchStmt( *identifier, kind ); 191 } // build_branch 192 193 Statement * build_branch( std::string * identifier, BranchStmt::Type kind ) { 194 Statement * ret = new BranchStmt( * identifier, kind ); 168 195 delete identifier; // allocated by lexer 169 196 return ret; 170 } 171 Statement *build_computedgoto( ExpressionNode *ctl ) { 197 } // build_branch 198 199 Statement * build_computedgoto( ExpressionNode * ctl ) { 172 200 return new BranchStmt( maybeMoveBuild< Expression >(ctl), BranchStmt::Goto ); 173 } 174 175 Statement * build_return( ExpressionNode *ctl ) {201 } // build_computedgoto 202 203 Statement * build_return( ExpressionNode * ctl ) { 176 204 std::list< Expression * > exps; 177 205 buildMoveList( ctl, exps ); 178 206 return new ReturnStmt( exps.size() > 0 ? exps.back() : nullptr ); 179 } 180 181 Statement * build_throw( ExpressionNode *ctl ) {207 } // build_return 208 209 Statement * build_throw( ExpressionNode * ctl ) { 182 210 std::list< Expression * > exps; 183 211 buildMoveList( ctl, exps ); 184 212 assertf( exps.size() < 2, "This means we are leaking memory"); 185 213 return new ThrowStmt( ThrowStmt::Terminate, !exps.empty() ? exps.back() : nullptr ); 186 } 187 188 Statement * build_resume( ExpressionNode *ctl ) {214 } // build_throw 215 216 Statement * build_resume( ExpressionNode * ctl ) { 189 217 std::list< Expression * > exps; 190 218 buildMoveList( ctl, exps ); 191 219 assertf( exps.size() < 2, "This means we are leaking memory"); 192 220 return new ThrowStmt( ThrowStmt::Resume, !exps.empty() ? exps.back() : nullptr ); 193 } 194 195 Statement * build_resume_at( ExpressionNode *ctl, ExpressionNode *target ) {221 } // build_resume 222 223 Statement * build_resume_at( ExpressionNode * ctl, ExpressionNode * target ) { 196 224 (void)ctl; 197 225 (void)target; 198 226 assertf( false, "resume at (non-local throw) is not yet supported," ); 199 } 200 201 Statement * build_try( StatementNode *try_stmt, StatementNode *catch_stmt, StatementNode *finally_stmt ) {227 } // build_resume_at 228 229 Statement * build_try( StatementNode * try_stmt, StatementNode * catch_stmt, StatementNode * finally_stmt ) { 202 230 std::list< CatchStmt * > branches; 203 231 buildMoveList< CatchStmt, StatementNode >( catch_stmt, branches ); 204 CompoundStmt * tryBlock = strict_dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >(try_stmt));205 FinallyStmt * finallyBlock = dynamic_cast< FinallyStmt * >(maybeMoveBuild< Statement >(finally_stmt) );232 CompoundStmt * tryBlock = strict_dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >(try_stmt)); 233 FinallyStmt * finallyBlock = dynamic_cast< FinallyStmt * >(maybeMoveBuild< Statement >(finally_stmt) ); 206 234 return new TryStmt( tryBlock, branches, finallyBlock ); 207 } 208 Statement *build_catch( CatchStmt::Kind kind, DeclarationNode *decl, ExpressionNode *cond, StatementNode *body ) { 235 } // build_try 236 237 Statement * build_catch( CatchStmt::Kind kind, DeclarationNode * decl, ExpressionNode * cond, StatementNode * body ) { 209 238 std::list< Statement * > branches; 210 239 buildMoveList< Statement, StatementNode >( body, branches ); 211 240 assert( branches.size() == 1 ); 212 241 return new CatchStmt( kind, maybeMoveBuild< Declaration >(decl), maybeMoveBuild< Expression >(cond), branches.front() ); 213 } 214 Statement *build_finally( StatementNode *stmt ) { 242 } // build_catch 243 244 Statement * build_finally( StatementNode * stmt ) { 215 245 std::list< Statement * > branches; 216 246 buildMoveList< Statement, StatementNode >( stmt, branches ); 217 247 assert( branches.size() == 1 ); 218 248 return new FinallyStmt( dynamic_cast< CompoundStmt * >( branches.front() ) ); 219 } 249 } // build_finally 220 250 221 251 WaitForStmt * build_waitfor( ExpressionNode * targetExpr, StatementNode * stmt, ExpressionNode * when ) { … … 238 268 239 269 return node; 240 } 270 } // build_waitfor 241 271 242 272 WaitForStmt * build_waitfor( ExpressionNode * targetExpr, StatementNode * stmt, ExpressionNode * when, WaitForStmt * node ) { … … 257 287 258 288 return node; 259 } 289 } // build_waitfor 260 290 261 291 WaitForStmt * build_waitfor_timeout( ExpressionNode * timeout, StatementNode * stmt, ExpressionNode * when ) { … … 266 296 node->timeout.statement = maybeMoveBuild<Statement >( stmt ); 267 297 node->timeout.condition = notZeroExpr( maybeMoveBuild<Expression>( when ) ); 268 } 269 else { 298 } else { 270 299 node->orelse.statement = maybeMoveBuild<Statement >( stmt ); 271 300 node->orelse.condition = notZeroExpr( maybeMoveBuild<Expression>( when ) ); 272 } 301 } // if 273 302 274 303 return node; 275 } 304 } // build_waitfor_timeout 276 305 277 306 WaitForStmt * build_waitfor_timeout( ExpressionNode * timeout, StatementNode * stmt, ExpressionNode * when, StatementNode * else_stmt, ExpressionNode * else_when ) { … … 286 315 287 316 return node; 288 } 317 } // build_waitfor_timeout 289 318 290 319 WithStmt * build_with( ExpressionNode * exprs, StatementNode * stmt ) { … … 293 322 Statement * s = maybeMoveBuild<Statement>( stmt ); 294 323 return new WithStmt( e, s ); 295 } 296 297 Statement * build_compound( StatementNode *first ) {298 CompoundStmt * cs = new CompoundStmt();324 } // build_with 325 326 Statement * build_compound( StatementNode * first ) { 327 CompoundStmt * cs = new CompoundStmt(); 299 328 buildMoveList( first, cs->get_kids() ); 300 329 return cs; 301 } 302 303 Statement * build_asmstmt( bool voltile, Expression *instruction, ExpressionNode *output, ExpressionNode *input, ExpressionNode *clobber, LabelNode *gotolabels ) {330 } // build_compound 331 332 Statement * build_asm( bool voltile, Expression * instruction, ExpressionNode * output, ExpressionNode * input, ExpressionNode * clobber, LabelNode * gotolabels ) { 304 333 std::list< Expression * > out, in; 305 334 std::list< ConstantExpr * > clob; … … 309 338 buildMoveList( clobber, clob ); 310 339 return new AsmStmt( voltile, instruction, out, in, clob, gotolabels ? gotolabels->labels : noLabels ); 311 } 340 } // build_asm 341 342 Statement * build_directive( string * directive ) { 343 return new DirectiveStmt( *directive ); 344 } // build_directive 312 345 313 346 // Local Variables: // -
src/Parser/TypeData.cc
rf9feab8 r90152a4 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 25 18:33:41 201713 // Update Count : 58712 // Last Modified On : Fri Jul 20 14:39:31 2018 13 // Update Count : 622 14 14 // 15 15 … … 31 31 using namespace std; 32 32 33 TypeData::TypeData( Kind k ) : kind( k ), base( nullptr ), forall( nullptr ) /*, PTR1( (void*)(0xdeadbeefdeadbeef)), PTR2( (void*)(0xdeadbeefdeadbeef) ) */ {33 TypeData::TypeData( Kind k ) : location( yylloc ), kind( k ), base( nullptr ), forall( nullptr ) /*, PTR1( (void*)(0xdeadbeefdeadbeef)), PTR2( (void*)(0xdeadbeefdeadbeef) ) */ { 34 34 switch ( kind ) { 35 35 case Unknown: … … 37 37 case Reference: 38 38 case EnumConstant: 39 case GlobalScope: 39 40 // nothing else to initialize 40 41 break; … … 54 55 function.oldDeclList = nullptr; 55 56 function.body = nullptr; 56 function. newStyle = false;57 function.withExprs = nullptr; 57 58 break; 58 59 // Enum is an Aggregate, so both structures are initialized together. … … 62 63 enumeration.constants = nullptr; 63 64 enumeration.body = false; 65 enumeration.anon = false; 66 break; 64 67 case Aggregate: 65 68 // aggregate = new Aggregate_t; 69 aggregate.kind = DeclarationNode::NoAggregate; 66 70 aggregate.name = nullptr; 67 71 aggregate.params = nullptr; … … 69 73 aggregate.fields = nullptr; 70 74 aggregate.body = false; 75 aggregate.tagged = false; 76 aggregate.parent = nullptr; 77 aggregate.anon = false; 71 78 break; 72 79 case AggregateInst: … … 74 81 aggInst.aggregate = nullptr; 75 82 aggInst.params = nullptr; 76 aggInst.hoistType = false; ;83 aggInst.hoistType = false; 77 84 break; 78 85 case Symbolic: … … 94 101 case Builtin: 95 102 // builtin = new Builtin_t; 103 case Qualified: 104 qualified.parent = nullptr; 105 qualified.child = nullptr; 96 106 break; 97 107 } // switch … … 108 118 case Reference: 109 119 case EnumConstant: 120 case GlobalScope: 110 121 // nothing to destroy 111 122 break; … … 122 133 delete function.oldDeclList; 123 134 delete function.body; 135 delete function.withExprs; 124 136 // delete function; 125 137 break; … … 160 172 // delete builtin; 161 173 break; 174 case Qualified: 175 delete qualified.parent; 176 delete qualified.child; 162 177 } // switch 163 178 } // TypeData::~TypeData … … 175 190 case Pointer: 176 191 case Reference: 192 case GlobalScope: 177 193 // nothing else to copy 178 194 break; … … 193 209 newtype->function.oldDeclList = maybeClone( function.oldDeclList ); 194 210 newtype->function.body = maybeClone( function.body ); 195 newtype->function. newStyle = function.newStyle;211 newtype->function.withExprs = maybeClone( function.withExprs ); 196 212 break; 197 213 case Aggregate: 214 newtype->aggregate.kind = aggregate.kind; 198 215 newtype->aggregate.name = aggregate.name ? new string( *aggregate.name ) : nullptr; 199 216 newtype->aggregate.params = maybeClone( aggregate.params ); 200 217 newtype->aggregate.actuals = maybeClone( aggregate.actuals ); 201 218 newtype->aggregate.fields = maybeClone( aggregate.fields ); 202 newtype->aggregate.kind = aggregate.kind;203 219 newtype->aggregate.body = aggregate.body; 220 newtype->aggregate.anon = aggregate.anon; 204 221 newtype->aggregate.tagged = aggregate.tagged; 205 222 newtype->aggregate.parent = aggregate.parent ? new string( *aggregate.parent ) : nullptr; … … 214 231 newtype->enumeration.constants = maybeClone( enumeration.constants ); 215 232 newtype->enumeration.body = enumeration.body; 233 newtype->enumeration.anon = enumeration.anon; 216 234 break; 217 235 case Symbolic: … … 233 251 newtype->builtintype = builtintype; 234 252 break; 253 case Qualified: 254 newtype->qualified.parent = maybeClone( qualified.parent ); 255 newtype->qualified.child = maybeClone( qualified.child ); 256 break; 235 257 } // switch 236 258 return newtype; … … 249 271 250 272 switch ( kind ) { 251 case Unknown: 252 os << "entity of unknown type "; 273 case Basic: 274 if ( signedness != DeclarationNode::NoSignedness ) os << DeclarationNode::signednessNames[ signedness ] << " "; 275 if ( length != DeclarationNode::NoLength ) os << DeclarationNode::lengthNames[ length ] << " "; 276 if ( complextype == DeclarationNode::NoComplexType ) { // basic type 277 assert( basictype != DeclarationNode::NoBasicType ); 278 os << DeclarationNode::basicTypeNames[ basictype ] << " "; 279 } else { // complex type 280 // handle double _Complex 281 if ( basictype != DeclarationNode::NoBasicType ) os << DeclarationNode::basicTypeNames[ basictype ] << " "; 282 os << DeclarationNode::complexTypeNames[ complextype ] << " "; 283 } // if 253 284 break; 254 285 case Pointer: … … 259 290 } // if 260 291 break; 261 case EnumConstant: 262 os << "enumeration constant "; 263 break; 264 case Basic: 265 if ( signedness != DeclarationNode::NoSignedness ) os << DeclarationNode::signednessNames[ signedness ] << " "; 266 if ( length != DeclarationNode::NoLength ) os << DeclarationNode::lengthNames[ length ] << " "; 267 assert( basictype != DeclarationNode::NoBasicType ); 268 os << DeclarationNode::basicTypeNames[ basictype ] << " "; 269 if ( complextype != DeclarationNode::NoComplexType ) os << DeclarationNode::complexTypeNames[ complextype ] << " "; 292 case Reference: 293 os << "reference "; 294 if ( base ) { 295 os << "to "; 296 base->print( os, indent ); 297 } // if 270 298 break; 271 299 case Array: … … 353 381 } // if 354 382 break; 355 case SymbolicInst: 356 os << "instance of type " << *symbolic.name; 357 if ( symbolic.actuals ) { 358 os << " with parameters" << endl; 359 symbolic.actuals->printList( os, indent + 2 ); 360 } // if 383 case EnumConstant: 384 os << "enumeration constant "; 361 385 break; 362 386 case Symbolic: … … 380 404 } // if 381 405 break; 406 case SymbolicInst: 407 os << *symbolic.name; 408 if ( symbolic.actuals ) { 409 os << "("; 410 symbolic.actuals->printList( os, indent + 2 ); 411 os << ")"; 412 } // if 413 break; 382 414 case Tuple: 383 415 os << "tuple "; … … 394 426 break; 395 427 case Builtin: 396 os << "gcc builtin type"; 428 os << DeclarationNode::builtinTypeNames[builtintype]; 429 break; 430 case GlobalScope: 431 break; 432 case Qualified: 433 qualified.parent->print( os ); 434 os << "."; 435 qualified.child->print( os ); 436 break; 437 case Unknown: 438 os << "entity of unknown type "; 397 439 break; 398 440 default: … … 401 443 } // switch 402 444 } // TypeData::print 445 446 const std::string * TypeData::leafName() const { 447 switch ( kind ) { 448 case Unknown: 449 case Pointer: 450 case Reference: 451 case EnumConstant: 452 case GlobalScope: 453 case Array: 454 case Basic: 455 case Function: 456 case AggregateInst: 457 case Tuple: 458 case Typeof: 459 case Builtin: 460 assertf(false, "Tried to get leaf name from kind without a name: %d", kind); 461 break; 462 case Aggregate: 463 return aggregate.name; 464 case Enum: 465 return enumeration.name; 466 case Symbolic: 467 case SymbolicInst: 468 return symbolic.name; 469 case Qualified: 470 return qualified.child->leafName(); 471 } // switch 472 assert(false); 473 } 403 474 404 475 … … 460 531 return new EnumInstType( buildQualifiers( td ), "" ); 461 532 case TypeData::SymbolicInst: 462 return buildSymbolicInst( td ); ;533 return buildSymbolicInst( td ); 463 534 case TypeData::Tuple: 464 535 return buildTuple( td ); … … 475 546 return new VarArgsType( buildQualifiers( td ) ); 476 547 } 548 case TypeData::GlobalScope: 549 return new GlobalScopeType(); 550 case TypeData::Qualified: 551 return new QualifiedType( buildQualifiers( td ), typebuild( td->qualified.parent ), typebuild( td->qualified.child ) ); 477 552 case TypeData::Symbolic: 478 553 case TypeData::Enum: … … 480 555 assert( false ); 481 556 } // switch 557 482 558 return nullptr; 483 559 } // typebuild … … 489 565 switch ( td->kind ) { 490 566 case TypeData::Aggregate: 491 if ( ! toplevel && td->aggregate. fields) {567 if ( ! toplevel && td->aggregate.body ) { 492 568 ret = td->clone(); 493 569 } // if 494 570 break; 495 571 case TypeData::Enum: 496 if ( ! toplevel && td->enumeration. constants) {572 if ( ! toplevel && td->enumeration.body ) { 497 573 ret = td->clone(); 498 574 } // if … … 518 594 519 595 static string genTSError( string msg, DeclarationNode::BasicType basictype ) { 520 throw SemanticError(string( "invalid type specifier \"" ) + msg + "\" for type \"" + DeclarationNode::basicTypeNames[basictype] + "\"." );596 SemanticError( yylloc, string( "invalid type specifier \"" ) + msg + "\" for type \"" + DeclarationNode::basicTypeNames[basictype] + "\"." ); 521 597 } // genTSError 522 598 … … 573 649 574 650 case DeclarationNode::Int128: 575 ret = td->signedness == 1? BasicType::UnsignedInt128 : BasicType::SignedInt128;651 ret = td->signedness == DeclarationNode::Unsigned ? BasicType::UnsignedInt128 : BasicType::SignedInt128; 576 652 if ( td->length != DeclarationNode::NoLength ) { 577 653 genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype ); … … 597 673 genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype ); 598 674 } // if 599 if ( td->basictype == DeclarationNode::Float&& td->length == DeclarationNode::Long ) {675 if ( td->basictype != DeclarationNode::Double && td->length == DeclarationNode::Long ) { 600 676 genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype ); 601 677 } // if … … 603 679 const_cast<TypeData *>(td)->basictype = DeclarationNode::LongDouble; 604 680 } // if 681 682 if ( td->basictype == DeclarationNode::Float80 || td->basictype == DeclarationNode::Float128 ) { 683 // if ( td->complextype != DeclarationNode::NoComplexType ) { 684 // genTSError( DeclarationNode::complexTypeNames[ td->complextype ], td->basictype ); 685 // } 686 if ( td->basictype == DeclarationNode::Float80 ) ret = BasicType::Float80; 687 else ret = BasicType::Float128; 688 break; 689 } 605 690 606 691 ret = floattype[ td->complextype ][ td->basictype - DeclarationNode::Float ]; … … 797 882 assert( td->base ); 798 883 if ( td->symbolic.isTypedef ) { 799 ret = new TypedefDecl( name, scs, typebuild( td->base ), linkage );884 ret = new TypedefDecl( name, td->location, scs, typebuild( td->base ), linkage ); 800 885 } else { 801 886 ret = new TypeDecl( name, scs, typebuild( td->base ), TypeDecl::Dtype, true ); … … 861 946 CompoundStmt * body = dynamic_cast< CompoundStmt * >( stmt ); 862 947 decl = new FunctionDecl( name, scs, linkage, buildFunction( td ), body, attributes, funcSpec ); 948 buildList( td->function.withExprs, decl->withExprs ); 863 949 return decl->set_asmName( asmName ); 864 950 } else if ( td->kind == TypeData::Aggregate ) { … … 877 963 FunctionType * buildFunction( const TypeData * td ) { 878 964 assert( td->kind == TypeData::Function ); 879 bool hasEllipsis = td->function.params ? td->function.params->get_hasEllipsis() : true; 880 if ( ! td->function.params ) hasEllipsis = ! td->function.newStyle; 881 FunctionType * ft = new FunctionType( buildQualifiers( td ), hasEllipsis ); 882 buildList( td->function.params, ft->get_parameters() ); 883 buildForall( td->forall, ft->get_forall() ); 965 FunctionType * ft = new FunctionType( buildQualifiers( td ), ! td->function.params || td->function.params->hasEllipsis ); 966 buildList( td->function.params, ft->parameters ); 967 buildForall( td->forall, ft->forall ); 884 968 if ( td->base ) { 885 969 switch ( td->base->kind ) { 886 970 case TypeData::Tuple: 887 buildList( td->base->tuple, ft-> get_returnVals());971 buildList( td->base->tuple, ft->returnVals ); 888 972 break; 889 973 default: … … 919 1003 // type set => parameter name already transformed by a declaration names so there is a duplicate 920 1004 // declaration name attempting a second transformation 921 if ( param->type ) throw SemanticError(string( "duplicate declaration name " ) + *param->name );1005 if ( param->type ) SemanticError( param->location, string( "duplicate declaration name " ) + *param->name ); 922 1006 // declaration type reset => declaration already transformed by a parameter name so there is a duplicate 923 1007 // parameter name attempting a second transformation 924 if ( ! decl->type ) throw SemanticError(string( "duplicate parameter name " ) + *param->name );1008 if ( ! decl->type ) SemanticError( param->location, string( "duplicate parameter name " ) + *param->name ); 925 1009 param->type = decl->type; // set copy declaration type to parameter type 926 1010 decl->type = nullptr; // reset declaration type … … 929 1013 } // for 930 1014 // declaration type still set => type not moved to a matching parameter so there is a missing parameter name 931 if ( decl->type ) throw SemanticError(string( "missing name in parameter list " ) + *decl->name );1015 if ( decl->type ) SemanticError( decl->location, string( "missing name in parameter list " ) + *decl->name ); 932 1016 } // for 933 1017 -
src/Parser/TypeData.h
rf9feab8 r90152a4 10 10 // Created On : Sat May 16 15:18:36 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Sep 1 23:33:45 201713 // Update Count : 19 012 // Last Modified On : Fri Jul 20 13:56:40 2018 13 // Update Count : 195 14 14 // 15 15 … … 26 26 27 27 struct TypeData { 28 enum Kind { Basic, Pointer, Array, Reference, Function, Aggregate, AggregateInst, Enum, EnumConstant, Symbolic,29 SymbolicInst, Tuple, Typeof, Builtin, Unknown };28 enum Kind { Basic, Pointer, Reference, Array, Function, Aggregate, AggregateInst, Enum, EnumConstant, Symbolic, 29 SymbolicInst, Tuple, Typeof, Builtin, GlobalScope, Qualified, Unknown }; 30 30 31 31 struct Aggregate_t { … … 36 36 DeclarationNode * fields; 37 37 bool body; 38 bool anon; 38 39 39 40 bool tagged; … … 57 58 DeclarationNode * constants; 58 59 bool body; 60 bool anon; 59 61 }; 60 62 … … 64 66 mutable DeclarationNode * oldDeclList; 65 67 StatementNode * body; 66 bool newStyle;68 ExpressionNode * withExprs; // expressions from function's with_clause 67 69 }; 68 70 … … 74 76 DeclarationNode * assertions; 75 77 }; 78 79 struct Qualified_t { // qualified type S.T 80 TypeData * parent; 81 TypeData * child; 82 }; 83 84 CodeLocation location; 76 85 77 86 Kind kind; … … 86 95 DeclarationNode * forall; 87 96 88 // Basic_t basic;89 97 Aggregate_t aggregate; 90 98 AggInst_t aggInst; 91 99 Array_t array; 92 100 Enumeration_t enumeration; 93 // Variable_t variable;94 101 Function_t function; 95 102 Symbolic_t symbolic; 103 Qualified_t qualified; 96 104 DeclarationNode * tuple; 97 105 ExpressionNode * typeexpr; … … 101 109 void print( std::ostream &, int indent = 0 ) const; 102 110 TypeData * clone() const; 111 112 const std::string * leafName() const; 103 113 }; 104 114 … … 118 128 TupleType * buildTuple( const TypeData * ); 119 129 TypeofType * buildTypeof( const TypeData * ); 120 Declaration * buildDecl( const TypeData *, const std::string &, Type::StorageClasses, Expression *, Type::FuncSpecifiers funcSpec, LinkageSpec::Spec, Expression * asmName, Initializer * init = nullptr, std::list< class Attribute * > attributes = std::list< class Attribute * >() ); 130 Declaration * buildDecl( const TypeData *, const std::string &, Type::StorageClasses, Expression *, Type::FuncSpecifiers funcSpec, LinkageSpec::Spec, Expression * asmName, 131 Initializer * init = nullptr, std::list< class Attribute * > attributes = std::list< class Attribute * >() ); 121 132 FunctionType * buildFunction( const TypeData * ); 122 133 void buildKRFunction( const TypeData::Function_t & function ); -
src/Parser/TypedefTable.cc
rf9feab8 r90152a4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // TypedefTable.cc -- 7 // TypedefTable.cc -- 8 8 // 9 // Author : Rodolfo G. Esteves9 // Author : Peter A. Buhr 10 10 // Created On : Sat May 16 15:20:13 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Aug 15 18:24:42 201613 // Update Count : 25 12 // Last Modified On : Wed Jul 25 15:32:35 2018 13 // Update Count : 258 14 14 // 15 15 16 #include <ext/alloc_traits.h> // for __alloc_traits<>::value_type17 #include <cassert> // for assert18 #include <list> // for list, _List_iterator, list<>::iterator19 #include <map> // for _Rb_tree_iterator, _Rb_tree_const_it...20 #include <memory> // for allocator_traits<>::value_type21 #include <utility> // for pair22 16 23 #include "Parser/ParserTypes.h" // for typedefTable24 #include "Parser/parser.hh" // for IDENTIFIER25 17 #include "TypedefTable.h" 26 27 using namespace std; 18 #include <cassert> // for assert 19 #include <iostream> 28 20 29 21 #if 0 30 #include <iostream> 31 32 #define debugPrint( x ) cerr << x 22 #define debugPrint( code ) code 33 23 #else 34 #define debugPrint( x)24 #define debugPrint( code ) 35 25 #endif 36 26 37 TypedefTable::TypedefTable() : currentScope( 0 ) {} 27 using namespace std; // string, iostream 38 28 39 bool TypedefTable::exists( const string &identifier ) { 40 return table.count( identifier ) > 0; 41 } 29 debugPrint( 30 static const char *kindName( int kind ) { 31 switch ( kind ) { 32 case IDENTIFIER: return "identifier"; 33 case TYPEDEFname: return "typedef"; 34 case TYPEGENname: return "typegen"; 35 default: 36 cerr << "Error: cfa-cpp internal error, invalid kind of identifier" << endl; 37 abort(); 38 } // switch 39 } // kindName 40 ) 42 41 43 int TypedefTable::isKind( const string &identifier ) const { 44 tableType::const_iterator id_pos = table.find( identifier ); 42 TypedefTable::~TypedefTable() { 43 if ( ! SemanticErrorThrow && kindTable.currentScope() != 0 ) { 44 cerr << "Error: cfa-cpp internal error, scope failure " << kindTable.currentScope() << endl; 45 abort(); 46 } // if 47 } // TypedefTable::~TypedefTable 48 49 bool TypedefTable::exists( const string & identifier ) { 50 return kindTable.find( identifier ) != kindTable.end(); 51 } // TypedefTable::exists 52 53 bool TypedefTable::existsCurr( const string & identifier ) { 54 return kindTable.findAt( kindTable.currentScope() - 1, identifier ) != kindTable.end(); 55 } // TypedefTable::exists 56 57 int TypedefTable::isKind( const string & identifier ) const { 58 KindTable::const_iterator posn = kindTable.find( identifier ); 45 59 // Name lookup defaults to identifier, and then the identifier's kind is set by the parser. 46 if ( id_pos == table.end() ) return IDENTIFIER; 47 return id_pos->second.begin()->kind; 48 } 49 50 void TypedefTable::changeKind( const string &identifier, kind_t kind ) { 51 tableType::iterator id_pos = table.find( identifier ); 52 if ( id_pos == table.end() ) return; 53 id_pos->second.begin()->kind = kind; 54 } 60 if ( posn == kindTable.end() ) return IDENTIFIER; 61 return posn->second; 62 } // TypedefTable::isKind 55 63 56 64 // SKULLDUGGERY: Generate a typedef for the aggregate name so the aggregate does not have to be qualified by 57 // "struct". Only generate the typedef, if the name is not in use. The typedef is implicitly (silently) removed 58 // if the name is explicitly used. 59 void TypedefTable::makeTypedef( const string &name ) { 65 // "struct". Only generate the typedef, if the name is not in use. The typedef is implicitly (silently) removed if the 66 // name is explicitly used. 67 void TypedefTable::makeTypedef( const string & name, int kind ) { 68 // Check for existence is necessary to handle: 69 // struct Fred {}; 70 // void Fred(); 71 // void fred() { 72 // struct Fred act; // do not add as type in this scope 73 // Fred(); 74 // } 60 75 if ( ! typedefTable.exists( name ) ) { 61 typedefTable.addToEnclosingScope( name, TypedefTable::TD);76 typedefTable.addToEnclosingScope( name, kind, "MTD" ); 62 77 } // if 63 } 78 } // TypedefTable::makeTypedef 64 79 65 void TypedefTable::addToScope( const std::string &identifier, kind_t kind, int scope ) { 66 if ( currentTrait != "" && scope == contextScope ) { 67 DeferredEntry entry = { identifier, kind }; 68 contexts[currentTrait].push_back( entry ); 69 } else { 70 debugPrint( "Adding " << identifier << " as kind " << kind << " scope " << scope << " from scope " << currentScope << endl ); 71 Entry newEntry = { scope, kind }; 72 tableType::iterator curPos = table.find( identifier ); 73 if ( curPos == table.end()) { 74 list< Entry > newList; 75 newList.push_front( newEntry ); 76 table[identifier] = newList; 77 } else { 78 list< Entry >::iterator listPos = (*curPos ).second.begin(); 79 while ( listPos != (*curPos ).second.end() && listPos->scope > scope ) { 80 listPos++; 81 } // while 82 (*curPos ).second.insert( listPos, newEntry ); 83 } // if 84 } // if 85 } 80 void TypedefTable::addToScope( const string & identifier, int kind, const char * locn __attribute__((unused)) ) { 81 auto scope = kindTable.currentScope(); 82 debugPrint( cerr << "Adding current at " << locn << " " << identifier << " as " << kindName( kind ) << " scope " << scope << endl ); 83 kindTable.insertAt( scope, identifier, kind ); 84 } // TypedefTable::addToScope 86 85 87 void TypedefTable::addToCurrentScope( const std::string &identifier, kind_t kind ) { 88 addToScope( identifier, kind, currentScope ); 89 } 90 91 void TypedefTable::addToCurrentScope( kind_t kind ) { 92 addToCurrentScope( nextIdentifiers.top(), kind ); 93 } 94 95 void TypedefTable::addToEnclosingScope( const std::string &identifier, kind_t kind ) { 96 assert( currentScope >= 1 ); 97 addToScope( identifier, kind, currentScope - 1 ); 98 } 99 100 void TypedefTable::addToEnclosingScope( kind_t kind ) { 101 addToEnclosingScope( nextIdentifiers.top(), kind ); 102 } 103 104 void TypedefTable::addToEnclosingScope2( const std::string &identifier, kind_t kind ) { 105 assert( currentScope >= 2 ); 106 addToScope( identifier, kind, currentScope - 2 ); 107 } 108 109 void TypedefTable::addToEnclosingScope2( kind_t kind ) { 110 addToEnclosingScope2( nextIdentifiers.top(), kind ); 111 } 112 113 void TypedefTable::setNextIdentifier( const std::string &identifier ) { 114 nextIdentifiers.top() = identifier; 115 } 116 117 void TypedefTable::openTrait( const std::string &contextName ) { 118 map< string, deferListType >::iterator i = contexts.find( contextName ); 119 if ( i != contexts.end() ) { 120 deferListType &entries = i->second; 121 for ( deferListType::iterator i = entries.begin(); i != entries.end(); i++) { 122 addToEnclosingScope( i->identifier, i->kind ); 123 } // for 124 } // if 125 } 86 void TypedefTable::addToEnclosingScope( const string & identifier, int kind, const char * locn __attribute__((unused)) ) { 87 auto scope = kindTable.currentScope() - 1 - kindTable.getNote( kindTable.currentScope() - 1 ).level; 88 // auto scope = level - kindTable.getNote( kindTable.currentScope() - 1 ).level; 89 debugPrint( cerr << "Adding enclosing at " << locn << " " << identifier << " as " << kindName( kind ) << " scope " << scope << " level " << level << " note " << kindTable.getNote( kindTable.currentScope() - 1 ).level << endl ); 90 auto ret = kindTable.insertAt( scope, identifier, kind ); 91 if ( ! ret.second ) ret.first->second = kind; // exists => update 92 } // TypedefTable::addToEnclosingScope 126 93 127 94 void TypedefTable::enterScope() { 128 currentScope += 1; 129 deferListStack.push( deferListType() ); 130 nextIdentifiers.push( "" ); 131 debugPrint( "Entering scope " << currentScope << ", nextIdentifiers size is " << nextIdentifiers.size() << endl ); 132 } 95 kindTable.beginScope( (Note){ 0, false } ); 96 debugPrint( cerr << "Entering scope " << kindTable.currentScope() << " level " << level << endl; print() ); 97 } // TypedefTable::enterScope 133 98 134 99 void TypedefTable::leaveScope() { 135 debugPrint( "Leaving scope " << currentScope << endl ); 136 for ( tableType::iterator i = table.begin(); i != table.end(); ) { 137 list< Entry > &declList = (*i).second; 138 while ( ! declList.empty() && declList.front().scope == currentScope ) { 139 declList.pop_front(); 140 } 141 if ( declList.empty() ) { // standard idom for erasing during traversal 142 table.erase( i++ ); 143 } else 144 ++i; 145 } // for 146 currentScope -= 1; 147 for ( deferListType::iterator i = deferListStack.top().begin(); i != deferListStack.top().end(); i++ ) { 148 addToCurrentScope( i->identifier, i->kind ); 149 } // for 150 deferListStack.pop(); 151 debugPrint( "nextIdentifiers size is " << nextIdentifiers.size() << " top is " << nextIdentifiers.top() << endl ); 152 nextIdentifiers.pop(); 153 } 100 debugPrint( cerr << "Leaving scope " << kindTable.currentScope() << endl; print() ); 101 kindTable.endScope(); 102 } // TypedefTable::leaveScope 154 103 155 void TypedefTable::enterTrait( const std::string &contextName ) { 156 currentTrait = contextName; 157 contextScope = currentScope; 158 } 104 void TypedefTable::up( bool forall ) { 105 level += 1; 106 kindTable.getNote( kindTable.currentScope() ) = (Note){ level, forall || getEnclForall() }; 107 debugPrint( cerr << "Up " << " level " << level << " note " << kindTable.getNote( level ).level << ", " << kindTable.getNote( level ).forall << endl; ); 108 } // TypedefTable::up 159 109 160 void TypedefTable::leaveTrait() { 161 currentTrait = ""; 162 } 110 void TypedefTable::down() { 111 level -= 1; 112 debugPrint( cerr << "Down " << " level " << level << " note " << kindTable.getNote( level ).level << endl; ); 113 } // TypedefTable::down 163 114 164 115 void TypedefTable::print( void ) const { 165 for ( tableType::const_iterator i = table.begin(); i != table.end(); i++) { 166 debugPrint( (*i ).first << ": " ); 167 list< Entry > declList = (*i).second; 168 for ( list< Entry >::const_iterator j = declList.begin(); j != declList.end(); j++ ) { 169 debugPrint( "(" << (*j).scope << " " << (*j).kind << ") " ); 170 } 171 debugPrint( endl ); 116 KindTable::size_type scope = kindTable.currentScope(); 117 debugPrint( cerr << "[" << scope << "] " << kindTable.getNote( scope ).level << ", " << kindTable.getNote( scope ).forall << ":" ); 118 for ( KindTable::const_iterator i = kindTable.begin(); i != kindTable.end(); i++ ) { 119 while ( i.get_level() != scope ) { 120 --scope; 121 debugPrint( cerr << endl << "[" << scope << "] " << kindTable.getNote( scope ).level << ", " << kindTable.getNote( scope ).forall << ":" ); 122 } // while 123 debugPrint( cerr << " " << (*i).first << ":" << kindName( (*i).second ) ); 172 124 } // for 173 } 125 while ( scope > 0 ) { 126 --scope; 127 debugPrint( cerr << endl << "[" << scope << "] " << kindTable.getNote( scope ).level << ", " << kindTable.getNote( scope ).forall << ":" ); 128 } // while 129 debugPrint( cerr << endl ); 130 } // TypedefTable::print 174 131 175 132 // Local Variables: // -
src/Parser/TypedefTable.h
rf9feab8 r90152a4 7 7 // TypedefTable.h -- 8 8 // 9 // Author : Rodolfo G. Esteves9 // Author : Peter A. Buhr 10 10 // Created On : Sat May 16 15:24:36 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 22 09:33:14 201713 // Update Count : 3412 // Last Modified On : Wed Jul 25 15:33:55 2018 13 // Update Count : 114 14 14 // 15 15 16 16 #pragma once 17 17 18 #include <list> // for list 19 #include <map> // for map, map<>::value_compare 20 #include <stack> // for stack 21 #include <string> // for string 18 #include <string> // for string 22 19 20 #include "Common/ScopedMap.h" // for ScopedMap 23 21 #include "ParserTypes.h" 24 #include "parser.hh" 22 #include "parser.hh" // for IDENTIFIER, TYPEDEFname, TYPEGENname 25 23 26 24 class TypedefTable { 25 struct Note { size_t level; bool forall; }; 26 typedef ScopedMap< std::string, int, Note > KindTable; 27 KindTable kindTable; 28 unsigned int level = 0; 27 29 public: 28 enum kind_t { ID = IDENTIFIER, TD = TYPEDEFname, TG = TYPEGENname }; 29 private: 30 struct Entry { 31 int scope; 32 kind_t kind; 33 }; 30 ~TypedefTable(); 34 31 35 struct DeferredEntry { 36 std::string identifier; 37 kind_t kind; 38 }; 39 40 typedef std::map< std::string, std::list< Entry > > tableType; 41 tableType table; 42 43 int currentScope; 44 std::string currentTrait; 45 int contextScope; 46 47 typedef std::list< DeferredEntry > deferListType; 48 std::stack< deferListType > deferListStack; 49 std::map< std::string, deferListType > contexts; 50 51 std::stack< std::string > nextIdentifiers; 52 53 void addToScope( const std::string &identifier, kind_t kind, int scope ); 54 public: 55 TypedefTable(); 56 57 bool exists( const std::string &identifier ); 58 int isKind( const std::string &identifier ) const; 59 void changeKind( const std::string &identifier, kind_t kind ); 60 61 void makeTypedef( const std::string &name ); 62 63 // "addToCurrentScope" adds the identifier/type pair to the current scope. This does less than you think it does, 64 // since each declaration is within its own scope. Mostly useful for type parameters. 65 void addToCurrentScope( const std::string &identifier, kind_t kind ); 66 void addToCurrentScope( kind_t kind ); // use nextIdentifiers.top() 67 68 // "addToEnclosingScope" adds the identifier/type pair to the scope that encloses the current one. This is the 69 // right way to handle type and typedef names 70 void addToEnclosingScope( const std::string &identifier, kind_t kind ); 71 void addToEnclosingScope( kind_t kind ); // use nextIdentifiers.top() 72 73 // "addToEnclosingScope2" adds the identifier/type pair to the scope that encloses the scope enclosing the the 74 // current one. This is the right way to handle assertion names 75 void addToEnclosingScope2( const std::string &identifier, kind_t kind ); 76 void addToEnclosingScope2( kind_t kind ); // use nextIdentifiers.top() 77 78 // set the next identifier to be used by an "add" operation without an identifier parameter within the current scope 79 void setNextIdentifier( const std::string &identifier ); 80 81 // dump the definitions from a pre-defined context into the current scope 82 void openTrait( const std::string &contextName ); 32 bool exists( const std::string & identifier ); 33 bool existsCurr( const std::string & identifier ); 34 int isKind( const std::string & identifier ) const; 35 void makeTypedef( const std::string & name, int kind = TYPEDEFname ); 36 void addToScope( const std::string & identifier, int kind, const char * ); 37 void addToEnclosingScope( const std::string & identifier, int kind, const char * ); 38 bool getEnclForall() { return kindTable.getNote( kindTable.currentScope() - 1 ).forall; } 83 39 84 40 void enterScope(); 85 41 void leaveScope(); 86 void enterTrait( const std::string &contextName );87 void leaveTrait();88 42 89 void print() const; 90 }; 43 void up( bool ); 44 void down(); 45 46 void print( void ) const; 47 }; // TypedefTable 91 48 92 49 // Local Variables: // -
src/Parser/lex.ll
rf9feab8 r90152a4 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Wed Oct 25 13:53:56 201713 * Update Count : 6 3412 * Last Modified On : Wed Aug 8 17:23:17 2018 13 * Update Count : 685 14 14 */ 15 15 … … 25 25 //**************************** Includes and Defines **************************** 26 26 27 // trigger before each matching rule's action 28 #define YY_USER_ACTION \ 29 yylloc.first_line = yylineno; \ 30 yylloc.first_column = column; \ 31 column += yyleng; \ 32 yylloc.last_column = column; \ 33 yylloc.last_line = yylineno; \ 34 yylloc.filename = yyfilename ? yyfilename : ""; 27 35 unsigned int column = 0; // position of the end of the last token parsed 28 #define YY_USER_ACTION yylloc.first_line = yylineno; yylloc.first_column = column; column += yyleng; yylloc.last_column = column; yylloc.last_line = yylineno; yylloc.filename = yyfilename ? yyfilename : ""; // trigger before each matching rule's action29 36 30 37 #include <string> … … 49 56 #define NUMERIC_RETURN(x) rm_underscore(); RETURN_VAL( x ) // numeric constant 50 57 #define KEYWORD_RETURN(x) RETURN_CHAR( x ) // keyword 51 #define QKEYWORD_RETURN(x) typedefTable.isKind( yytext ); RETURN_VAL(x);// quasi-keyword58 #define QKEYWORD_RETURN(x) RETURN_VAL(x); // quasi-keyword 52 59 #define IDENTIFIER_RETURN() RETURN_VAL( typedefTable.isKind( yytext ) ) 53 60 #define ATTRIBUTE_RETURN() RETURN_VAL( ATTR_IDENTIFIER ) 54 61 55 62 void rm_underscore() { 56 // Remove underscores in numeric constant by copying the non-underscore characters to the front of the string.63 // SKULLDUGGERY: remove underscores (ok to shorten?) 57 64 yyleng = 0; 58 for ( int i = 0; yytext[i] != '\0'; i += 1 ) { 59 if ( yytext[i] == '`' ) { 60 // copy user suffix 61 for ( ; yytext[i] != '\0'; i += 1 ) { 62 yytext[yyleng] = yytext[i]; 63 yyleng += 1; 64 } // for 65 break; 66 } // if 65 for ( int i = 0; yytext[i] != '\0'; i += 1 ) { // copying non-underscore characters to front of string 67 66 if ( yytext[i] != '_' ) { 68 67 yytext[yyleng] = yytext[i]; … … 71 70 } // for 72 71 yytext[yyleng] = '\0'; 73 } 72 } // rm_underscore 74 73 75 74 // Stop warning due to incorrectly generated flex code. … … 77 76 %} 78 77 78 binary [0-1] 79 79 octal [0-7] 80 80 nonzero [1-9] … … 89 89 attr_identifier "@"{identifier} 90 90 91 user_suffix_opt ("`"{identifier})?92 93 91 // numeric constants, CFA: '_' in constant 94 92 hex_quad {hex}("_"?{hex}){3} 95 93 size_opt (8|16|32|64|128)? 96 94 length ("ll"|"LL"|[lL]{size_opt})|("hh"|"HH"|[hH]) 97 integer_suffix_opt ("_"?(([uU]({length}?[iI]?)|([iI]{length}))|([iI]({length}?[uU]?)|([uU]{length}))|({length}([iI]?[uU]?)|([uU][iI]))|[zZ]))? {user_suffix_opt}95 integer_suffix_opt ("_"?(([uU]({length}?[iI]?)|([iI]{length}))|([iI]({length}?[uU]?)|([uU]{length}))|({length}([iI]?[uU]?)|([uU][iI]))|[zZ]))? 98 96 99 97 octal_digits ({octal})|({octal}({octal}|"_")*{octal}) … … 103 101 nonzero_digits ({nonzero})|({nonzero}({decimal}|"_")*{decimal}) 104 102 decimal_constant {nonzero_digits}{integer_suffix_opt} 103 104 binary_digits ({binary})|({binary}({binary}|"_")*{binary}) 105 binary_prefix "0"[bB]"_"? 106 binary_constant {binary_prefix}{binary_digits}{integer_suffix_opt} 105 107 106 108 hex_digits ({hex})|({hex}({hex}|"_")*{hex}) … … 113 115 floating_length ([fFdDlL]|[lL]{floating_size}) 114 116 floating_suffix ({floating_length}?[iI]?)|([iI]{floating_length}) 115 floating_suffix_opt ("_"?({floating_suffix}|"DL"))? {user_suffix_opt}117 floating_suffix_opt ("_"?({floating_suffix}|"DL"))? 116 118 decimal_digits ({decimal})|({decimal}({decimal}|"_")*{decimal}) 117 119 floating_decimal {decimal_digits}"."{exponent}?{floating_suffix_opt} … … 120 122 121 123 binary_exponent "_"?[pP]"_"?[+-]?{decimal_digits} 122 hex_floating_suffix_opt ("_"?({floating_suffix}))? {user_suffix_opt}124 hex_floating_suffix_opt ("_"?({floating_suffix}))? 123 125 hex_floating_fraction ({hex_digits}?"."{hex_digits})|({hex_digits}".") 124 126 hex_floating_constant {hex_prefix}(({hex_floating_fraction}{binary_exponent})|({hex_digits}{binary_exponent})){hex_floating_suffix_opt} … … 179 181 } 180 182 181 /* ignore preprocessor directives (for now)*/182 ^{h_white}*"#"[^\n]*"\n" ;183 /* preprocessor-style directives */ 184 ^{h_white}*"#"[^\n]*"\n" { RETURN_VAL( DIRECTIVE ); } 183 185 184 186 /* ignore C style comments (ALSO HANDLED BY CPP) */ … … 203 205 __asm { KEYWORD_RETURN(ASM); } // GCC 204 206 __asm__ { KEYWORD_RETURN(ASM); } // GCC 205 _At { KEYWORD_RETURN(AT); } // CFA206 207 _Atomic { KEYWORD_RETURN(ATOMIC); } // C11 207 208 __attribute { KEYWORD_RETURN(ATTRIBUTE); } // GCC … … 232 233 enum { KEYWORD_RETURN(ENUM); } 233 234 __extension__ { KEYWORD_RETURN(EXTENSION); } // GCC 235 exception { KEYWORD_RETURN(EXCEPTION); } // CFA 234 236 extern { KEYWORD_RETURN(EXTERN); } 237 fallthrough { KEYWORD_RETURN(FALLTHROUGH); } // CFA 235 238 fallthru { KEYWORD_RETURN(FALLTHRU); } // CFA 236 fallthrough { KEYWORD_RETURN(FALLTHROUGH); } // CFA237 239 finally { KEYWORD_RETURN(FINALLY); } // CFA 238 240 float { KEYWORD_RETURN(FLOAT); } 241 _Float32 { KEYWORD_RETURN(FLOAT); } // GCC 242 _Float32x { KEYWORD_RETURN(FLOAT); } // GCC 243 _Float64 { KEYWORD_RETURN(DOUBLE); } // GCC 244 _Float64x { KEYWORD_RETURN(DOUBLE); } // GCC 239 245 __float80 { KEYWORD_RETURN(FLOAT80); } // GCC 240 246 float80 { KEYWORD_RETURN(FLOAT80); } // GCC 247 _Float128 { KEYWORD_RETURN(FLOAT128); } // GCC 248 _Float128x { KEYWORD_RETURN(FLOAT128); } // GCC 241 249 __float128 { KEYWORD_RETURN(FLOAT128); } // GCC 242 250 float128 { KEYWORD_RETURN(FLOAT128); } // GCC … … 264 272 __builtin_offsetof { KEYWORD_RETURN(OFFSETOF); } // GCC 265 273 one_t { NUMERIC_RETURN(ONE_T); } // CFA 274 or { QKEYWORD_RETURN(WOR); } // CFA 266 275 otype { KEYWORD_RETURN(OTYPE); } // CFA 267 276 register { KEYWORD_RETURN(REGISTER); } … … 300 309 __volatile__ { KEYWORD_RETURN(VOLATILE); } // GCC 301 310 waitfor { KEYWORD_RETURN(WAITFOR); } 302 or { QKEYWORD_RETURN(WOR); } // CFA303 311 when { KEYWORD_RETURN(WHEN); } 304 312 while { KEYWORD_RETURN(WHILE); } … … 308 316 /* identifier */ 309 317 {identifier} { IDENTIFIER_RETURN(); } 318 "`"{identifier}"`" { // CFA 319 yytext[yyleng - 1] = '\0'; yytext += 1; // SKULLDUGGERY: remove backquotes (ok to shorten?) 320 IDENTIFIER_RETURN(); 321 } 310 322 {attr_identifier} { ATTRIBUTE_RETURN(); } 311 "`" { BEGIN BKQUOTE; }312 <BKQUOTE>{identifier} { IDENTIFIER_RETURN(); }313 <BKQUOTE>"`" { BEGIN 0; }314 323 315 324 /* numeric constants */ 325 {binary_constant} { NUMERIC_RETURN(INTEGERconstant); } 326 {octal_constant} { NUMERIC_RETURN(INTEGERconstant); } 316 327 {decimal_constant} { NUMERIC_RETURN(INTEGERconstant); } 317 {octal_constant} { NUMERIC_RETURN(INTEGERconstant); }318 328 {hex_constant} { NUMERIC_RETURN(INTEGERconstant); } 319 329 {floating_decimal} { NUMERIC_RETURN(FLOATING_DECIMALconstant); } // must appear before floating_constant … … 325 335 ({cwide_prefix}[_]?)?['] { BEGIN QUOTE; rm_underscore(); strtext = new string( yytext, yyleng ); } 326 336 <QUOTE>[^'\\\n]* { strtext->append( yytext, yyleng ); } 327 <QUOTE>['\n] {user_suffix_opt}{ BEGIN 0; strtext->append( yytext, yyleng ); RETURN_STR(CHARACTERconstant); }337 <QUOTE>['\n] { BEGIN 0; strtext->append( yytext, yyleng ); RETURN_STR(CHARACTERconstant); } 328 338 /* ' stop editor highlighting */ 329 339 … … 331 341 ({swide_prefix}[_]?)?["] { BEGIN STRING; rm_underscore(); strtext = new string( yytext, yyleng ); } 332 342 <STRING>[^"\\\n]* { strtext->append( yytext, yyleng ); } 333 <STRING>["\n] {user_suffix_opt}{ BEGIN 0; strtext->append( yytext, yyleng ); RETURN_STR(STRINGliteral); }343 <STRING>["\n] { BEGIN 0; strtext->append( yytext, yyleng ); RETURN_STR(STRINGliteral); } 334 344 /* " stop editor highlighting */ 335 345 … … 341 351 /* punctuation */ 342 352 "@" { ASCIIOP_RETURN(); } 353 "`" { ASCIIOP_RETURN(); } 343 354 "[" { ASCIIOP_RETURN(); } 344 355 "]" { ASCIIOP_RETURN(); } … … 399 410 ">>=" { NAMEDOP_RETURN(RSassign); } 400 411 412 "~=" { NAMEDOP_RETURN(Erange); } // CFA 401 413 "@=" { NAMEDOP_RETURN(ATassign); } // CFA 402 414 … … 405 417 "?"({op_unary_pre_post}|"()"|"[?]"|"{}") { IDENTIFIER_RETURN(); } 406 418 "^?{}" { IDENTIFIER_RETURN(); } 407 "?`"{identifier} { IDENTIFIER_RETURN(); } // unitoperator419 "?`"{identifier} { IDENTIFIER_RETURN(); } // postfix operator 408 420 "?"{op_binary_over}"?" { IDENTIFIER_RETURN(); } // binary 409 421 /* … … 448 460 449 461 %% 462 450 463 // ----end of lexer---- 451 464 452 465 void yyerror( const char * errmsg ) { 453 cout << (yyfilename ? yyfilename : "*unknown file*") << ':' << yylineno << ':' << column - yyleng + 1 454 << ": " << SemanticError::error_str() << errmsg << " at token \"" << (yytext[0] == '\0' ? "EOF" : yytext) << '"' << endl; 466 SemanticErrorThrow = true; 467 cerr << (yyfilename ? yyfilename : "*unknown file*") << ':' << yylineno << ':' << column - yyleng + 1 468 << ": " << ErrorHelpers::error_str() << errmsg << " at token \"" << (yytext[0] == '\0' ? "EOF" : yytext) << '"' << endl; 455 469 } 456 470 -
src/Parser/module.mk
rf9feab8 r90152a4 6 6 ## file "LICENCE" distributed with Cforall. 7 7 ## 8 ## module.mk -- 8 ## module.mk -- 9 9 ## 10 10 ## Author : Peter A. Buhr … … 31 31 Parser/parserutility.cc 32 32 33 M AINTAINERCLEANFILES +=Parser/parser.output33 MOSTLYCLEANFILES += Parser/parser.hh Parser/parser.output -
src/Parser/parser.yy
rf9feab8 r90152a4 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Nov 27 17:23:35 201713 // Update Count : 299212 // Last Modified On : Wed Aug 8 17:50:07 2018 13 // Update Count : 3998 14 14 // 15 15 … … 115 115 } // distExt 116 116 117 void distInl( DeclarationNode * declaration ) { 118 // distribute EXTENSION across all declarations 119 for ( DeclarationNode *iter = declaration; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) { 120 iter->set_inLine( true ); 121 } // for 122 } // distInl 123 124 void distQual( DeclarationNode * declaration, DeclarationNode * qualifiers ) { 125 // distribute qualifiers across all non-variable declarations in a distribution statemement 126 for ( DeclarationNode * iter = declaration; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) { 127 // SKULLDUGGERY: Distributions are parsed inside out, so qualifiers are added to declarations inside out. Since 128 // addQualifiers appends to the back of the list, the forall clauses are in the wrong order (right to left). To 129 // get the qualifiers in the correct order and still use addQualifiers (otherwise, 90% of addQualifiers has to 130 // be copied to add to front), the appropriate forall pointers are interchanged before calling addQualifiers. 131 DeclarationNode * clone = qualifiers->clone(); 132 if ( qualifiers->type ) { // forall clause ? (handles SC) 133 if ( iter->type->kind == TypeData::Aggregate ) { // struct/union ? 134 swap( clone->type->forall, iter->type->aggregate.params ); 135 iter->addQualifiers( clone ); 136 } else if ( iter->type->kind == TypeData::AggregateInst && iter->type->aggInst.aggregate->aggregate.body ) { // struct/union ? 137 // Create temporary node to hold aggregate, call addQualifiers as above, then put nodes back together. 138 DeclarationNode newnode; 139 swap( newnode.type, iter->type->aggInst.aggregate ); 140 swap( clone->type->forall, newnode.type->aggregate.params ); 141 newnode.addQualifiers( clone ); 142 swap( newnode.type, iter->type->aggInst.aggregate ); 143 } else if ( iter->type->kind == TypeData::Function ) { // routines ? 144 swap( clone->type->forall, iter->type->forall ); 145 iter->addQualifiers( clone ); 146 } // if 147 } else { // just SC qualifiers 148 iter->addQualifiers( clone ); 149 } // if 150 } // for 151 delete qualifiers; 152 } // distQual 153 117 154 // There is an ambiguity for inline generic-routine return-types and generic routines. 118 155 // forall( otype T ) struct S { int i; } bar( T ) {} 119 156 // Does the forall bind to the struct or the routine, and how would it be possible to explicitly specify the binding. 120 157 // forall( otype T ) struct S { int T; } forall( otype W ) bar( W ) {} 158 // Currently, the forall is associated with the routine, and the generic type has to be separately defined: 159 // forall( otype T ) struct S { int T; }; 160 // forall( otype W ) bar( W ) {} 121 161 122 162 void rebindForall( DeclarationNode * declSpec, DeclarationNode * funcDecl ) { 123 if ( declSpec->type->kind == TypeData::Aggregate ) { // return isaggregate definition163 if ( declSpec->type->kind == TypeData::Aggregate ) { // ignore aggregate definition 124 164 funcDecl->type->forall = declSpec->type->aggregate.params; // move forall from aggregate to function type 125 165 declSpec->type->aggregate.params = nullptr; … … 127 167 } // rebindForall 128 168 129 bool forall = false; // aggregate have one or more forall qualifiers ? 169 NameExpr * build_postfix_name( const string * name ) { 170 NameExpr * new_name = build_varref( new string( "?`" + *name ) ); 171 delete name; 172 return new_name; 173 } // build_postfix_name 174 175 DeclarationNode * fieldDecl( DeclarationNode * typeSpec, DeclarationNode * fieldList ) { 176 if ( ! fieldList ) { // field declarator ? 177 if ( ! ( typeSpec->type && typeSpec->type->kind == TypeData::Aggregate ) ) { 178 stringstream ss; 179 typeSpec->type->print( ss ); 180 SemanticWarning( yylloc, Warning::SuperfluousDecl, ss.str().c_str() ); 181 return nullptr; 182 } // if 183 fieldList = DeclarationNode::newName( nullptr ); 184 } // if 185 return distAttr( typeSpec, fieldList ); // mark all fields in list 186 } // fieldDecl 187 188 ForCtrl * forCtrl( ExpressionNode * type, string * index, ExpressionNode * start, enum OperKinds compop, ExpressionNode * comp, ExpressionNode * inc ) { 189 return new ForCtrl( 190 distAttr( DeclarationNode::newTypeof( type ), DeclarationNode::newName( index )->addInitializer( new InitializerNode( start ) ) ), 191 new ExpressionNode( build_binary_val( compop, new ExpressionNode( build_varref( new string( *index ) ) ), comp ) ), 192 new ExpressionNode( build_binary_val( OperKinds::PlusAssn, new ExpressionNode( build_varref( new string( *index ) ) ), inc ) ) ); 193 } // forCtrl 194 195 196 bool forall = false, yyy = false; // aggregate have one or more forall qualifiers ? 130 197 131 198 // https://www.gnu.org/software/bison/manual/bison.html#Location-Type … … 158 225 WaitForStmt * wfs; 159 226 Expression * constant; 160 IfCtl * ifctl; 161 ForCtl * fctl; 227 IfCtrl * ifctl; 228 ForCtrl * fctl; 229 enum OperKinds compop; 162 230 LabelNode * label; 163 231 InitializerNode * in; … … 166 234 bool flag; 167 235 CatchStmt::Kind catch_kind; 236 GenericExpr * genexpr; 168 237 } 169 238 … … 187 256 %token TYPEOF LABEL // GCC 188 257 %token ENUM STRUCT UNION 258 %token EXCEPTION // CFA 189 259 %token COROUTINE MONITOR THREAD // CFA 190 260 %token OTYPE FTYPE DTYPE TTYPE TRAIT // CFA … … 201 271 %token<tok> ATTR_IDENTIFIER ATTR_TYPEDEFname ATTR_TYPEGENname 202 272 %token<tok> INTEGERconstant CHARACTERconstant STRINGliteral 273 %token<tok> DIRECTIVE 203 274 // Floating point constant is broken into three kinds of tokens because of the ambiguity with tuple indexing and 204 275 // overloading constants 0/1, e.g., x.1 is lexed as (x)(.1), where (.1) is a factional constant, but is semantically … … 219 290 %token ANDassign ERassign ORassign // &= ^= |= 220 291 292 %token Erange // ~= 221 293 %token ATassign // @= 222 294 … … 241 313 %type<ifctl> if_control_expression 242 314 %type<fctl> for_control_expression 315 %type<compop> inclexcl 243 316 %type<en> subrange 244 317 %type<decl> asm_name_opt … … 248 321 %type<flag> asm_volatile_opt 249 322 %type<en> handler_predicate_opt 323 %type<genexpr> generic_association generic_assoc_list 250 324 251 325 // statements 252 326 %type<sn> statement labeled_statement compound_statement 253 327 %type<sn> statement_decl statement_decl_list statement_list_nodecl 254 %type<sn> selection_statement 255 %type<sn> switch_clause_list_opt switch_clause_list choose_clause_list_opt choose_clause_list328 %type<sn> selection_statement if_statement 329 %type<sn> switch_clause_list_opt switch_clause_list 256 330 %type<en> case_value 257 331 %type<sn> case_clause case_value_list case_label case_label_list 258 %type<sn> fall_through fall_through_opt259 332 %type<sn> iteration_statement jump_statement 260 333 %type<sn> expression_statement asm_statement 261 %type<sn> with_statement with_clause_opt 334 %type<sn> with_statement 335 %type<en> with_clause_opt 262 336 %type<sn> exception_statement handler_clause finally_clause 263 337 %type<catch_kind> handler_key … … 275 349 %type<decl> aggregate_type aggregate_type_nobody 276 350 277 %type<decl> assertion assertion_list _opt351 %type<decl> assertion assertion_list assertion_list_opt 278 352 279 353 %type<en> bit_subrange_size_opt bit_subrange_size … … 291 365 %type<en> enumerator_value_opt 292 366 293 %type<decl> exception_declaration external_definition external_definition_list external_definition_list_opt 294 295 %type<decl> field_declaration field_declaration_list field_declarator field_declaring_list 296 %type<en> field field_list field_name fraction_constants 367 %type<decl> external_definition external_definition_list external_definition_list_opt 368 369 %type<decl> exception_declaration 370 371 %type<decl> field_declaration_list_opt field_declaration field_declaring_list_opt field_declarator field_abstract_list_opt field_abstract 372 %type<en> field field_name_list field_name fraction_constants_opt 297 373 298 374 %type<decl> external_function_definition function_definition function_array function_declarator function_no_ptr function_ptr … … 307 383 %type<decl> cfa_array_parameter_1st_dimension 308 384 309 %type<decl> cfa_trait_declaring_list cfa_declaration cfa_field_declaring_list 385 %type<decl> cfa_trait_declaring_list cfa_declaration cfa_field_declaring_list cfa_field_abstract_list 310 386 %type<decl> cfa_function_declaration cfa_function_return cfa_function_specifier 311 387 … … 313 389 %type<decl> cfa_identifier_parameter_declarator_tuple cfa_identifier_parameter_ptr 314 390 315 %type<decl> cfa_parameter_declaration cfa_parameter_list cfa_parameter_ type_list cfa_parameter_type_list_opt391 %type<decl> cfa_parameter_declaration cfa_parameter_list cfa_parameter_ellipsis_list_opt 316 392 317 393 %type<decl> cfa_typedef_declaration cfa_variable_declaration cfa_variable_specifier 318 394 319 %type<decl> c_declaration 395 %type<decl> c_declaration static_assert 320 396 %type<decl> KR_function_declarator KR_function_no_ptr KR_function_ptr KR_function_array 321 %type<decl> KR_declaration_list KR_declaration_list_opt 322 323 %type<decl> parameter_declaration parameter_list parameter_type_list 324 %type<decl> parameter_type_list_opt 397 %type<decl> KR_parameter_list KR_parameter_list_opt 398 399 %type<decl> parameter_declaration parameter_list parameter_type_list_opt 325 400 326 401 %type<decl> paren_identifier paren_type … … 343 418 %type<decl> type_parameter type_parameter_list type_initializer_opt 344 419 345 %type<en> type_ list420 %type<en> type_parameters_opt type_list 346 421 347 422 %type<decl> type_qualifier type_qualifier_name forall type_qualifier_list_opt type_qualifier_list … … 354 429 355 430 // initializers 356 %type<in> initializer initializer_list initializer_opt431 %type<in> initializer initializer_list_opt initializer_opt 357 432 358 433 // designators … … 378 453 // Foo ( *fp )( int ); 379 454 // `---' matches start of TYPEGENname '(' 380 // Must be:455 // must be: 381 456 // Foo( int ) ( *fp )( int ); 457 // The same problem occurs here: 458 // forall( otype T ) struct Foo { T v; } ( *fp )( int ); 459 // must be: 460 // forall( otype T ) struct Foo { T v; } ( int ) ( *fp )( int ); 382 461 383 462 // Order of these lines matters (low-to-high precedence). 384 463 %precedence TYPEGENname 464 %precedence '}' 385 465 %precedence '(' 386 466 387 %locations // support location tracking for error messages467 %locations // support location tracking for error messages 388 468 389 469 %start translation_unit // parse-tree root … … 392 472 //************************* Namespace Management ******************************** 393 473 394 // The grammar in the ANSI C standard is not strictly context-free, since it relies upon the distinct terminal symbols395 // "identifier", "TYPEDEFname", and "TYPEGENname" that are lexically identical. While it is possible to write a purely396 // context-free grammar, such a grammar would obscure the relationship between syntactic and semantic constructs.397 // Hence, this grammar uses the ANSI style.398 // 399 // Cforall compounds this problem by introducing type names local to the scope of a declaration (for instance, those400 // introduced through "forall" qualifiers), and by introducing "type generators" -- parameterized types. This latter401 // type name creates a third class of identifiers that must be distinguished by the scanner.402 // 403 // Since the scanner cannot distinguish among the different classes of identifiers without some context information, it404 // accesses a data structure (TypedefTable) to allow classification of an identifier that it has just read. Semantic405 // actions during the parser update this data structure when the class of identifiers change.406 // 407 // Because the Cforall language is block-scoped, there is the possibility that an identifier can change its class in a408 // local scope; it must revert to its original class at the end of the block. Since type names can be local to a409 // particular declaration, each declaration is itself a scope. This requires distinguishing between type names that are410 // local to the current declaration scope and those that persist past the end of the declaration (i.e., names defined in411 // "typedef" or "otype" declarations).412 // 413 // The non-terminals "push" and "pop" derive the empty string; their only use is to denote the opening and closing of414 // scopes. Every push must have a matching pop, although it is regrettable the matching pairs do not always occur415 // within the same rule. These non-terminals may appear in more contexts than strictly necessary from a semantic point416 // of view. Unfortunately, these extra rules are necessary to prevent parsing conflicts -- the parser may not have417 // enough context and look-ahead information to decide whether a new scope is necessary, so the effect of these extra418 // rules is to open a new scope unconditionally. As the grammar evolves, it may be neccesary to add or move around419 // "push" and "pop" nonterminals to resolve conflicts of this sort.474 // The C grammar is not context free because it relies on the distinct terminal symbols "identifier" and "TYPEDEFname", 475 // which are lexically identical. 476 // 477 // typedef int foo; // identifier foo must now be scanned as TYPEDEFname 478 // foo f; // to allow it to appear in this context 479 // 480 // While it may be possible to write a purely context-free grammar, such a grammar would obscure the relationship 481 // between syntactic and semantic constructs. Cforall compounds this problem by introducing type names local to the 482 // scope of a declaration (for instance, those introduced through "forall" qualifiers), and by introducing "type 483 // generators" -- parameterized types. This latter type name creates a third class of identifiers, "TYPEGENname", which 484 // must be distinguished by the lexical scanner. 485 // 486 // Since the scanner cannot distinguish among the different classes of identifiers without some context information, 487 // there is a type table (typedefTable), which holds type names and identifiers that override type names, for each named 488 // scope. During parsing, semantic actions update the type table by adding new identifiers in the current scope. For 489 // each context that introduces a name scope, a new level is created in the type table and that level is popped on 490 // exiting the scope. Since type names can be local to a particular declaration, each declaration is itself a scope. 491 // This requires distinguishing between type names that are local to the current declaration scope and those that 492 // persist past the end of the declaration (i.e., names defined in "typedef" or "otype" declarations). 493 // 494 // The non-terminals "push" and "pop" denote the opening and closing of named scopes. Every push has a matching pop in 495 // the production rule. There are multiple lists of declarations, where each declaration is a named scope, so pop/push 496 // around the list separator. 497 // 498 // int f( forall(T) T (*f1) T , forall( S ) S (*f2)( S ) ); 499 // push pop push pop 420 500 421 501 push: … … 443 523 ; 444 524 445 identifier:446 IDENTIFIER447 | ATTR_IDENTIFIER // CFA448 | quasi_keyword449 ;450 451 525 no_attr_identifier: 452 526 IDENTIFIER 453 527 | quasi_keyword 528 | '@' // CFA 529 { Token tok = { new string( DeclarationNode::anonymous.newName() ), yylval.tok.loc }; $$ = tok; } 530 ; 531 532 identifier: 533 no_attr_identifier 534 | ATTR_IDENTIFIER // CFA 454 535 ; 455 536 … … 480 561 | '(' compound_statement ')' // GCC, lambda expression 481 562 { $$ = new ExpressionNode( new StmtExpr( dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >($2) ) ) ); } 563 | constant '`' IDENTIFIER // CFA, postfix call 564 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); } 565 | string_literal '`' IDENTIFIER // CFA, postfix call 566 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), new ExpressionNode( $1 ) ) ); } 567 | IDENTIFIER '`' IDENTIFIER // CFA, postfix call 568 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), new ExpressionNode( build_varref( $1 ) ) ) ); } 569 | tuple '`' IDENTIFIER // CFA, postfix call 570 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); } 571 | '(' comma_expression ')' '`' IDENTIFIER // CFA, postfix call 572 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $5 ) ), $2 ) ); } 482 573 | type_name '.' no_attr_identifier // CFA, nested type 483 { throw SemanticError("Qualified names are currently unimplemented."); $$ = nullptr; } // FIX ME 484 | type_name '.' '[' push field_list pop ']' // CFA, nested type / tuple field selector 485 { throw SemanticError("Qualified names are currently unimplemented."); $$ = nullptr; } // FIX ME 574 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; } 575 | type_name '.' '[' field_name_list ']' // CFA, nested type / tuple field selector 576 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; } 577 | GENERIC '(' assignment_expression ',' generic_assoc_list ')' // C11 578 { 579 // add the missing control expression to the GenericExpr and return it 580 $5->control = maybeMoveBuild<Expression>( $3 ); 581 $$ = new ExpressionNode( $5 ); 582 } 583 ; 584 585 generic_assoc_list: // C11 586 generic_association 587 | generic_assoc_list ',' generic_association 588 { 589 // steal the association node from the singleton and delete the wrapper 590 $1->associations.splice($1->associations.end(), $3->associations); 591 delete $3; 592 $$ = $1; 593 } 594 ; 595 596 generic_association: // C11 597 type_no_function ':' assignment_expression 598 { 599 // create a GenericExpr wrapper with one association pair 600 $$ = new GenericExpr( nullptr, { { maybeMoveBuildType($1), maybeMoveBuild<Expression>($3) } } ); 601 } 602 | DEFAULT ':' assignment_expression 603 { $$ = new GenericExpr( nullptr, { { maybeMoveBuild<Expression>($3) } } ); } 486 604 ; 487 605 488 606 postfix_expression: 489 607 primary_expression 490 | postfix_expression '[' push assignment_expression pop']'608 | postfix_expression '[' assignment_expression ']' 491 609 // CFA, comma_expression disallowed in this context because it results in a common user error: subscripting a 492 610 // matrix with x[i,j] instead of x[i][j]. While this change is not backwards compatible, there seems to be 493 611 // little advantage to this feature and many disadvantages. It is possible to write x[(i,j)] in CFA, which is 494 612 // equivalent to the old x[i,j]. 495 { $$ = new ExpressionNode( build_binary_val( OperKinds::Index, $1, $ 4) ); }613 { $$ = new ExpressionNode( build_binary_val( OperKinds::Index, $1, $3 ) ); } 496 614 | postfix_expression '{' argument_expression_list '}' // CFA, constructor call 497 615 { … … 504 622 | postfix_expression '.' no_attr_identifier 505 623 { $$ = new ExpressionNode( build_fieldSel( $1, build_varref( $3 ) ) ); } 506 | postfix_expression '.' '[' push field_list pop ']' // CFA, tuple field selector507 { $$ = new ExpressionNode( build_fieldSel( $1, build_ tuple( $5) ) ); }624 | postfix_expression '.' INTEGERconstant // CFA, tuple index 625 { $$ = new ExpressionNode( build_fieldSel( $1, build_constantInteger( *$3 ) ) ); } 508 626 | postfix_expression FLOATING_FRACTIONconstant // CFA, tuple index 509 627 { $$ = new ExpressionNode( build_fieldSel( $1, build_field_name_FLOATING_FRACTIONconstant( *$2 ) ) ); } 628 | postfix_expression '.' '[' field_name_list ']' // CFA, tuple field selector 629 { $$ = new ExpressionNode( build_fieldSel( $1, build_tuple( $4 ) ) ); } 510 630 | postfix_expression ARROW no_attr_identifier 511 631 { 512 632 $$ = new ExpressionNode( build_pfieldSel( $1, *$3 == "0" || *$3 == "1" ? build_constantInteger( *$3 ) : build_varref( $3 ) ) ); 513 633 } 514 | postfix_expression ARROW '[' push field_list pop ']' // CFA, tuple field selector515 { $$ = new ExpressionNode( build_pfieldSel( $1, build_tuple( $5 ) ) ); }516 634 | postfix_expression ARROW INTEGERconstant // CFA, tuple index 517 635 { $$ = new ExpressionNode( build_pfieldSel( $1, build_constantInteger( *$3 ) ) ); } 636 | postfix_expression ARROW '[' field_name_list ']' // CFA, tuple field selector 637 { $$ = new ExpressionNode( build_pfieldSel( $1, build_tuple( $4 ) ) ); } 518 638 | postfix_expression ICR 519 639 { $$ = new ExpressionNode( build_unary_ptr( OperKinds::IncrPost, $1 ) ); } 520 640 | postfix_expression DECR 521 641 { $$ = new ExpressionNode( build_unary_ptr( OperKinds::DecrPost, $1 ) ); } 522 | '(' type_no_function ')' '{' initializer_list comma_opt '}' // C99, compound-literal642 | '(' type_no_function ')' '{' initializer_list_opt comma_opt '}' // C99, compound-literal 523 643 { $$ = new ExpressionNode( build_compoundLiteral( $2, new InitializerNode( $5, true ) ) ); } 644 | '(' type_no_function ')' '@' '{' initializer_list_opt comma_opt '}' // CFA, explicit C compound-literal 645 { $$ = new ExpressionNode( build_compoundLiteral( $2, (new InitializerNode( $6, true ))->set_maybeConstructed( false ) ) ); } 524 646 | '^' primary_expression '{' argument_expression_list '}' // CFA 525 647 { … … 539 661 // empty 540 662 { $$ = nullptr; } 541 // | '@' // use default argument 542 // { $$ = new ExpressionNode( build_constantInteger( *new string( "2" ) ) ); } 663 | '?' // CFA, default parameter 664 { SemanticError( yylloc, "Default parameter for argument is currently unimplemented." ); $$ = nullptr; } 665 // { $$ = new ExpressionNode( build_constantInteger( *new string( "2" ) ) ); } 543 666 | assignment_expression 544 667 ; 545 668 546 field_ list:// CFA, tuple field selector669 field_name_list: // CFA, tuple field selector 547 670 field 548 | field_ list ',' field{ $$ = (ExpressionNode *)$1->set_last( $3 ); }671 | field_name_list ',' field { $$ = (ExpressionNode *)$1->set_last( $3 ); } 549 672 ; 550 673 … … 553 676 | FLOATING_DECIMALconstant field 554 677 { $$ = new ExpressionNode( build_fieldSel( new ExpressionNode( build_field_name_FLOATING_DECIMALconstant( *$1 ) ), maybeMoveBuild<Expression>( $2 ) ) ); } 555 | FLOATING_DECIMALconstant '[' push field_list pop']'556 { $$ = new ExpressionNode( build_fieldSel( new ExpressionNode( build_field_name_FLOATING_DECIMALconstant( *$1 ) ), build_tuple( $ 4) ) ); }678 | FLOATING_DECIMALconstant '[' field_name_list ']' 679 { $$ = new ExpressionNode( build_fieldSel( new ExpressionNode( build_field_name_FLOATING_DECIMALconstant( *$1 ) ), build_tuple( $3 ) ) ); } 557 680 | field_name '.' field 558 681 { $$ = new ExpressionNode( build_fieldSel( $1, maybeMoveBuild<Expression>( $3 ) ) ); } 559 | field_name '.' '[' push field_list pop']'560 { $$ = new ExpressionNode( build_fieldSel( $1, build_tuple( $ 5) ) ); }682 | field_name '.' '[' field_name_list ']' 683 { $$ = new ExpressionNode( build_fieldSel( $1, build_tuple( $4 ) ) ); } 561 684 | field_name ARROW field 562 685 { $$ = new ExpressionNode( build_pfieldSel( $1, maybeMoveBuild<Expression>( $3 ) ) ); } 563 | field_name ARROW '[' push field_list pop']'564 { $$ = new ExpressionNode( build_pfieldSel( $1, build_tuple( $ 5) ) ); }686 | field_name ARROW '[' field_name_list ']' 687 { $$ = new ExpressionNode( build_pfieldSel( $1, build_tuple( $4 ) ) ); } 565 688 ; 566 689 567 690 field_name: 568 INTEGERconstant fraction_constants 691 INTEGERconstant fraction_constants_opt 569 692 { $$ = new ExpressionNode( build_field_name_fraction_constants( build_constantInteger( *$1 ), $2 ) ); } 570 | FLOATINGconstant fraction_constants 693 | FLOATINGconstant fraction_constants_opt 571 694 { $$ = new ExpressionNode( build_field_name_fraction_constants( build_field_name_FLOATINGconstant( *$1 ), $2 ) ); } 572 | no_attr_identifier fraction_constants 695 | no_attr_identifier fraction_constants_opt 573 696 { 574 697 $$ = new ExpressionNode( build_field_name_fraction_constants( build_varref( $1 ), $2 ) ); … … 576 699 ; 577 700 578 fraction_constants :701 fraction_constants_opt: 579 702 // empty 580 703 { $$ = nullptr; } 581 | fraction_constants FLOATING_FRACTIONconstant704 | fraction_constants_opt FLOATING_FRACTIONconstant 582 705 { 583 706 Expression * constant = build_field_name_FLOATING_FRACTIONconstant( *$2 ); … … 591 714 // semantics checks, e.g., ++3, 3--, *3, &&3 592 715 | constant 593 { $$ = $1; }594 716 | string_literal 595 717 { $$ = new ExpressionNode( $1 ); } … … 657 779 | '(' type_no_function ')' cast_expression 658 780 { $$ = new ExpressionNode( build_cast( $2, $4 ) ); } 781 | '(' COROUTINE '&' ')' cast_expression // CFA 782 { $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Coroutine, $5 ) ); } 783 | '(' THREAD '&' ')' cast_expression // CFA 784 { $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Thread, $5 ) ); } 785 | '(' MONITOR '&' ')' cast_expression // CFA 786 { $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Monitor, $5 ) ); } 659 787 // VIRTUAL cannot be opt because of look ahead issues 660 | '(' VIRTUAL ')' cast_expression 788 | '(' VIRTUAL ')' cast_expression // CFA 661 789 { $$ = new ExpressionNode( new VirtualCastExpr( maybeMoveBuild< Expression >( $4 ), maybeMoveBuildType( nullptr ) ) ); } 662 | '(' VIRTUAL type_no_function ')' cast_expression 790 | '(' VIRTUAL type_no_function ')' cast_expression // CFA 663 791 { $$ = new ExpressionNode( new VirtualCastExpr( maybeMoveBuild< Expression >( $5 ), maybeMoveBuildType( $3 ) ) ); } 664 792 // | '(' type_no_function ')' tuple … … 752 880 | logical_OR_expression '?' comma_expression ':' conditional_expression 753 881 { $$ = new ExpressionNode( build_cond( $1, $3, $5 ) ); } 754 // FIX ME: this hackcomputes $1 twice882 // FIX ME: computes $1 twice 755 883 | logical_OR_expression '?' /* empty */ ':' conditional_expression // GCC, omitted first operand 756 884 { $$ = new ExpressionNode( build_cond( $1, $1, $4 ) ); } … … 766 894 | unary_expression assignment_operator assignment_expression 767 895 { $$ = new ExpressionNode( build_binary_val( $2, $1, $3 ) ); } 896 | unary_expression '=' '{' initializer_list_opt comma_opt '}' 897 { SemanticError( yylloc, "Initializer assignment is currently unimplemented." ); $$ = nullptr; } 768 898 ; 769 899 … … 795 925 // '[' ']' 796 926 // { $$ = new ExpressionNode( build_tuple() ); } 797 // '[' push assignment_expression pop ']'927 // | '[' push assignment_expression pop ']' 798 928 // { $$ = new ExpressionNode( build_tuple( $3 ) ); } 799 '[' push ',' tuple_expression_list pop']'800 { $$ = new ExpressionNode( build_tuple( (ExpressionNode *)(new ExpressionNode( nullptr ) )->set_last( $ 4) ) ); }801 | '[' push assignment_expression ',' tuple_expression_list pop']'802 { $$ = new ExpressionNode( build_tuple( (ExpressionNode *)$3->set_last( $ 5) ) ); }929 '[' ',' tuple_expression_list ']' 930 { $$ = new ExpressionNode( build_tuple( (ExpressionNode *)(new ExpressionNode( nullptr ) )->set_last( $3 ) ) ); } 931 | '[' push assignment_expression pop ',' tuple_expression_list ']' 932 { $$ = new ExpressionNode( build_tuple( (ExpressionNode *)$3->set_last( $6 ) ) ); } 803 933 ; 804 934 … … 826 956 labeled_statement 827 957 | compound_statement 828 | expression_statement { $$ = $1; }958 | expression_statement 829 959 | selection_statement 830 960 | iteration_statement … … 834 964 | waitfor_statement 835 965 | exception_statement 966 | enable_disable_statement 967 { SemanticError( yylloc, "enable/disable statement is currently unimplemented." ); $$ = nullptr; } 836 968 | asm_statement 969 | DIRECTIVE 970 { $$ = new StatementNode( build_directive( $1 ) ); } 971 ; 837 972 838 973 labeled_statement: … … 847 982 '{' '}' 848 983 { $$ = new StatementNode( build_compound( (StatementNode *)0 ) ); } 849 | '{' 850 // Two scopes are necessary because the block itself has a scope, but every declaration within the block also 851 // requires its own scope. 852 push push 984 | '{' push 853 985 local_label_declaration_opt // GCC, local labels 854 986 statement_decl_list // C99, intermix declarations and statements 855 987 pop '}' 856 { $$ = new StatementNode( build_compound( $ 5) ); }988 { $$ = new StatementNode( build_compound( $4 ) ); } 857 989 ; 858 990 859 991 statement_decl_list: // C99 860 992 statement_decl 861 | statement_decl_list pushstatement_decl862 { if ( $1 != 0 ) { $1->set_last( $ 3); $$ = $1; } }993 | statement_decl_list statement_decl 994 { if ( $1 != 0 ) { $1->set_last( $2 ); $$ = $1; } } 863 995 ; 864 996 … … 878 1010 $$ = new StatementNode( $2 ); 879 1011 } 880 | statement pop1012 | statement 881 1013 ; 882 1014 … … 893 1025 894 1026 selection_statement: 895 IF '(' push if_control_expression ')' statement %prec THEN 896 // explicitly deal with the shift/reduce conflict on if/else 897 { $$ = new StatementNode( build_if( $4, $6, nullptr ) ); } 898 | IF '(' push if_control_expression ')' statement ELSE statement 899 { $$ = new StatementNode( build_if( $4, $6, $8 ) ); } 1027 // pop causes a S/R conflict without separating the IF statement into a non-terminal even after resolving 1028 // the inherent S/R conflict with THEN/ELSE. 1029 push if_statement pop 1030 { $$ = $2; } 900 1031 | SWITCH '(' comma_expression ')' case_clause 901 { $$ = new StatementNode( build_switch( $3, $5 ) ); }902 | SWITCH '(' comma_expression ')' '{' push declaration_list_opt switch_clause_list_opt '}' // CFA903 { 904 StatementNode *sw = new StatementNode( build_switch( $3, $8 ) );1032 { $$ = new StatementNode( build_switch( true, $3, $5 ) ); } 1033 | SWITCH '(' comma_expression ')' '{' push declaration_list_opt switch_clause_list_opt pop '}' // CFA 1034 { 1035 StatementNode *sw = new StatementNode( build_switch( true, $3, $8 ) ); 905 1036 // The semantics of the declaration list is changed to include associated initialization, which is performed 906 1037 // *before* the transfer to the appropriate case clause by hoisting the declarations into a compound … … 911 1042 } 912 1043 | CHOOSE '(' comma_expression ')' case_clause // CFA 913 { $$ = new StatementNode( build_switch( $3, $5 ) ); }914 | CHOOSE '(' comma_expression ')' '{' push declaration_list_opt choose_clause_list_opt'}' // CFA915 { 916 StatementNode *sw = new StatementNode( build_switch( $3, $8 ) );1044 { $$ = new StatementNode( build_switch( false, $3, $5 ) ); } 1045 | CHOOSE '(' comma_expression ')' '{' push declaration_list_opt switch_clause_list_opt pop '}' // CFA 1046 { 1047 StatementNode *sw = new StatementNode( build_switch( false, $3, $8 ) ); 917 1048 $$ = $7 ? new StatementNode( build_compound( (StatementNode *)((new StatementNode( $7 ))->set_last( sw )) ) ) : sw; 918 1049 } 919 1050 ; 920 1051 1052 if_statement: 1053 IF '(' if_control_expression ')' statement %prec THEN 1054 // explicitly deal with the shift/reduce conflict on if/else 1055 { $$ = new StatementNode( build_if( $3, $5, nullptr ) ); } 1056 | IF '(' if_control_expression ')' statement ELSE statement 1057 { $$ = new StatementNode( build_if( $3, $5, $7 ) ); } 1058 ; 1059 921 1060 if_control_expression: 922 comma_expression pop923 { $$ = new IfCt l( nullptr, $1 ); }924 | c_declaration pop// no semi-colon925 { $$ = new IfCt l( $1, nullptr ); }926 | cfa_declaration pop// no semi-colon927 { $$ = new IfCt l( $1, nullptr ); }1061 comma_expression 1062 { $$ = new IfCtrl( nullptr, $1 ); } 1063 | c_declaration // no semi-colon 1064 { $$ = new IfCtrl( $1, nullptr ); } 1065 | cfa_declaration // no semi-colon 1066 { $$ = new IfCtrl( $1, nullptr ); } 928 1067 | declaration comma_expression // semi-colon separated 929 { $$ = new IfCt l( $1, $2 ); }1068 { $$ = new IfCtrl( $1, $2 ); } 930 1069 ; 931 1070 … … 952 1091 ; 953 1092 1093 //label_list_opt: 1094 // // empty 1095 // | identifier_or_type_name ':' 1096 // | label_list_opt identifier_or_type_name ':' 1097 // ; 1098 954 1099 case_label_list: // CFA 955 1100 case_label … … 974 1119 ; 975 1120 976 choose_clause_list_opt: // CFA977 // empty978 { $$ = nullptr; }979 | choose_clause_list980 ;981 982 choose_clause_list: // CFA983 case_label_list fall_through984 { $$ = $1->append_last_case( $2 ); }985 | case_label_list statement_list_nodecl fall_through_opt986 { $$ = $1->append_last_case( new StatementNode( build_compound( (StatementNode *)$2->set_last( $3 ) ) ) ); }987 | choose_clause_list case_label_list fall_through988 { $$ = (StatementNode *)( $1->set_last( $2->append_last_case( $3 ))); }989 | choose_clause_list case_label_list statement_list_nodecl fall_through_opt990 { $$ = (StatementNode *)( $1->set_last( $2->append_last_case( new StatementNode( build_compound( (StatementNode *)$3->set_last( $4 ) ) ) ) ) ); }991 ;992 993 fall_through_opt: // CFA994 // empty995 { $$ = new StatementNode( build_branch( BranchStmt::Break ) ); } // insert implicit break996 | fall_through997 ;998 999 fall_through_name: // CFA1000 FALLTHRU1001 | FALLTHROUGH1002 ;1003 1004 fall_through: // CFA1005 fall_through_name1006 { $$ = nullptr; }1007 | fall_through_name ';'1008 { $$ = nullptr; }1009 ;1010 1011 1121 iteration_statement: 1012 WHILE '(' comma_expression ')' statement 1013 { $$ = new StatementNode( build_while( $3, $5 ) ); } 1122 WHILE '(' push if_control_expression ')' statement pop 1123 { $$ = new StatementNode( build_while( $4, $6 ) ); } 1124 | WHILE '(' ')' statement // CFA => while ( 1 ) 1125 { $$ = new StatementNode( build_while( new IfCtrl( nullptr, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ), $4 ) ); } 1014 1126 | DO statement WHILE '(' comma_expression ')' ';' 1015 { $$ = new StatementNode( build_while( $5, $2, true ) ); } 1016 | FOR '(' push for_control_expression ')' statement 1127 { $$ = new StatementNode( build_do_while( $5, $2 ) ); } 1128 | DO statement WHILE '(' ')' ';' // CFA => do while( 1 ) 1129 { $$ = new StatementNode( build_do_while( new ExpressionNode( build_constantInteger( *new string( "1" ) ) ), $2 ) ); } 1130 | FOR '(' push for_control_expression ')' statement pop 1017 1131 { $$ = new StatementNode( build_for( $4, $6 ) ); } 1018 1132 ; 1019 1133 1020 1134 for_control_expression: 1021 comma_expression_opt pop ';' comma_expression_opt ';' comma_expression_opt 1022 { $$ = new ForCtl( $1, $4, $6 ); } 1023 | declaration comma_expression_opt ';' comma_expression_opt // C99 1024 { $$ = new ForCtl( $1, $2, $4 ); } 1135 comma_expression_opt // CFA 1136 { 1137 if ( ! $1 ) { // => for ( ;; ) 1138 $$ = new ForCtrl( (ExpressionNode * )nullptr, (ExpressionNode * )nullptr, (ExpressionNode * )nullptr ); 1139 } else { 1140 $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), OperKinds::LThan, $1->clone(), 1141 new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); 1142 } // if 1143 } 1144 | constant_expression inclexcl constant_expression // CFA 1145 { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), $1->clone(), $2, $3, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); } 1146 | constant_expression inclexcl constant_expression '~' constant_expression // CFA 1147 { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), $1->clone(), $2, $3, $5 ); } 1148 | comma_expression_opt ';' comma_expression // CFA 1149 { 1150 if ( ! $1 ) { 1151 SemanticError( yylloc, "Missing loop index." ); $$ = nullptr; 1152 } else if ( ! $3 ) { 1153 SemanticError( yylloc, "Missing loop range." ); $$ = nullptr; 1154 } else { 1155 if ( NameExpr *identifier = dynamic_cast<NameExpr *>($1->get_expr()) ) { 1156 $$ = forCtrl( $3, new string( identifier->name ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), OperKinds::LThan, $3->clone(), 1157 new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); 1158 } else { 1159 SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed" ); $$ = nullptr; 1160 } // if 1161 } // if 1162 } 1163 | comma_expression_opt ';' constant_expression inclexcl constant_expression // CFA 1164 { 1165 if ( ! $1 ) { 1166 SemanticError( yylloc, "Missing loop index." ); $$ = nullptr; 1167 } else { 1168 if ( NameExpr *identifier = dynamic_cast<NameExpr *>($1->get_expr()) ) { 1169 $$ = forCtrl( $3, new string( identifier->name ), $3->clone(), $4, $5, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); 1170 } else { 1171 SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed" ); $$ = nullptr; 1172 } // if 1173 } // if 1174 } 1175 | comma_expression_opt ';' constant_expression inclexcl constant_expression '~' constant_expression // CFA 1176 { 1177 if ( ! $1 ) { 1178 SemanticError( yylloc, "Missing loop index." ); $$ = nullptr; 1179 } else { 1180 if ( NameExpr *identifier = dynamic_cast<NameExpr *>($1->get_expr()) ) { 1181 $$ = forCtrl( $3, new string( identifier->name ), $3->clone(), $4, $5, $7 ); 1182 } else { 1183 SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed" ); $$ = nullptr; 1184 } // if 1185 } // if 1186 } 1187 | comma_expression_opt ';' comma_expression_opt ';' comma_expression_opt 1188 { $$ = new ForCtrl( $1, $3, $5 ); } 1189 | declaration comma_expression_opt ';' comma_expression_opt // C99, declaration has ';' 1190 { $$ = new ForCtrl( $1, $2, $4 ); } 1191 ; 1192 1193 inclexcl: 1194 '~' 1195 { $$ = OperKinds::LThan; } 1196 | Erange 1197 { $$ = OperKinds::LEThan; } 1025 1198 ; 1026 1199 … … 1032 1205 // whereas normal operator precedence yields goto (*i)+3; 1033 1206 { $$ = new StatementNode( build_computedgoto( $3 ) ); } 1207 // A semantic check is required to ensure fallthru appears only in the body of a choose statement. 1208 | fall_through_name ';' // CFA 1209 { $$ = new StatementNode( build_branch( BranchStmt::FallThrough ) ); } 1210 | fall_through_name identifier_or_type_name ';' // CFA 1211 { $$ = new StatementNode( build_branch( $2, BranchStmt::FallThrough ) ); } 1212 | fall_through_name DEFAULT ';' // CFA 1213 { $$ = new StatementNode( build_branch( BranchStmt::FallThroughDefault ) ); } 1034 1214 | CONTINUE ';' 1035 1215 // A semantic check is required to ensure this statement appears only in the body of an iteration statement. … … 1048 1228 | RETURN comma_expression_opt ';' 1049 1229 { $$ = new StatementNode( build_return( $2 ) ); } 1230 | RETURN '{' initializer_list_opt comma_opt '}' 1231 { SemanticError( yylloc, "Initializer return is currently unimplemented." ); $$ = nullptr; } 1050 1232 | THROW assignment_expression_opt ';' // handles rethrow 1051 1233 { $$ = new StatementNode( build_throw( $2 ) ); } … … 1056 1238 ; 1057 1239 1240 fall_through_name: // CFA 1241 FALLTHRU 1242 | FALLTHROUGH 1243 ; 1244 1058 1245 with_statement: 1059 1246 WITH '(' tuple_expression_list ')' statement … … 1066 1253 mutex_statement: 1067 1254 MUTEX '(' argument_expression_list ')' statement 1068 { throw SemanticError("Mutex statement is currently unimplemented."); $$ = nullptr; } // FIX ME1255 { SemanticError( yylloc, "Mutex statement is currently unimplemented." ); $$ = nullptr; } 1069 1256 ; 1070 1257 1071 1258 when_clause: 1072 WHEN '(' comma_expression ')' 1073 { $$ = $3; } 1259 WHEN '(' comma_expression ')' { $$ = $3; } 1074 1260 ; 1075 1261 … … 1081 1267 1082 1268 waitfor: 1083 WAITFOR '(' identifier ')' 1084 { 1085 $$ = new ExpressionNode( new NameExpr( *$3 ) ); 1086 delete $3; 1087 } 1088 | WAITFOR '(' identifier ',' argument_expression_list ')' 1089 { 1090 $$ = new ExpressionNode( new NameExpr( *$3 ) ); 1091 $$->set_last( $5 ); 1092 delete $3; 1093 } 1269 WAITFOR '(' cast_expression ')' 1270 { $$ = $3; } 1271 | WAITFOR '(' cast_expression ',' argument_expression_list ')' 1272 { $$ = (ExpressionNode *)$3->set_last( $5 ); } 1094 1273 ; 1095 1274 1096 1275 timeout: 1097 TIMEOUT '(' comma_expression ')' 1098 { $$ = $3; } 1276 TIMEOUT '(' comma_expression ')' { $$ = $3; } 1099 1277 ; 1100 1278 … … 1109 1287 { $$ = build_waitfor_timeout( nullptr, $3, $1 ); } 1110 1288 // "else" must be conditional after timeout or timeout is never triggered (i.e., it is meaningless) 1289 | when_clause_opt timeout statement WOR ELSE statement 1290 { SemanticError( yylloc, "else clause must be conditional after timeout or timeout never triggered." ); $$ = nullptr; } 1111 1291 | when_clause_opt timeout statement WOR when_clause ELSE statement 1112 1292 { $$ = build_waitfor_timeout( $2, $3, $1, $7, $5 ); } … … 1130 1310 1131 1311 handler_clause: 1132 handler_key '(' push pushexception_declaration pop handler_predicate_opt ')' compound_statement pop1133 { $$ = new StatementNode( build_catch( $1, $ 5, $7, $9) ); }1134 | handler_clause handler_key '(' push pushexception_declaration pop handler_predicate_opt ')' compound_statement pop1135 { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( $2, $ 6, $8, $10) ) ); }1312 handler_key '(' push exception_declaration pop handler_predicate_opt ')' compound_statement pop 1313 { $$ = new StatementNode( build_catch( $1, $4, $6, $8 ) ); } 1314 | handler_clause handler_key '(' push exception_declaration pop handler_predicate_opt ')' compound_statement pop 1315 { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( $2, $5, $7, $9 ) ) ); } 1136 1316 ; 1137 1317 1138 1318 handler_predicate_opt: 1139 // empty1319 // empty 1140 1320 { $$ = nullptr; } 1141 | ';' conditional_expression 1142 { $$ = $2; } 1321 | ';' conditional_expression { $$ = $2; } 1143 1322 ; 1144 1323 1145 1324 handler_key: 1146 CATCH 1147 { $$ = CatchStmt::Terminate; } 1148 | CATCHRESUME 1149 { $$ = CatchStmt::Resume; } 1325 CATCH { $$ = CatchStmt::Terminate; } 1326 | CATCHRESUME { $$ = CatchStmt::Resume; } 1150 1327 ; 1151 1328 1152 1329 finally_clause: 1153 FINALLY compound_statement 1154 { 1155 $$ = new StatementNode( build_finally( $2 ) ); 1156 } 1330 FINALLY compound_statement { $$ = new StatementNode( build_finally( $2 ) ); } 1157 1331 ; 1158 1332 … … 1161 1335 type_specifier_nobody 1162 1336 | type_specifier_nobody declarator 1163 { 1164 typedefTable.addToEnclosingScope( TypedefTable::ID ); 1165 $$ = $2->addType( $1 ); 1166 } 1337 { $$ = $2->addType( $1 ); } 1167 1338 | type_specifier_nobody variable_abstract_declarator 1168 1339 { $$ = $2->addType( $1 ); } 1169 1340 | cfa_abstract_declarator_tuple no_attr_identifier // CFA 1170 { 1171 typedefTable.addToEnclosingScope( TypedefTable::ID ); 1172 $$ = $1->addName( $2 ); 1173 } 1341 { $$ = $1->addName( $2 ); } 1174 1342 | cfa_abstract_declarator_tuple // CFA 1343 ; 1344 1345 enable_disable_statement: 1346 enable_disable_key identifier_list compound_statement 1347 ; 1348 1349 enable_disable_key: 1350 ENABLE 1351 | DISABLE 1175 1352 ; 1176 1353 1177 1354 asm_statement: 1178 1355 ASM asm_volatile_opt '(' string_literal ')' ';' 1179 { $$ = new StatementNode( build_asm stmt( $2, $4, 0 ) ); }1356 { $$ = new StatementNode( build_asm( $2, $4, 0 ) ); } 1180 1357 | ASM asm_volatile_opt '(' string_literal ':' asm_operands_opt ')' ';' // remaining GCC 1181 { $$ = new StatementNode( build_asm stmt( $2, $4, $6 ) ); }1358 { $$ = new StatementNode( build_asm( $2, $4, $6 ) ); } 1182 1359 | ASM asm_volatile_opt '(' string_literal ':' asm_operands_opt ':' asm_operands_opt ')' ';' 1183 { $$ = new StatementNode( build_asm stmt( $2, $4, $6, $8 ) ); }1360 { $$ = new StatementNode( build_asm( $2, $4, $6, $8 ) ); } 1184 1361 | ASM asm_volatile_opt '(' string_literal ':' asm_operands_opt ':' asm_operands_opt ':' asm_clobbers_list_opt ')' ';' 1185 { $$ = new StatementNode( build_asm stmt( $2, $4, $6, $8, $10 ) ); }1362 { $$ = new StatementNode( build_asm( $2, $4, $6, $8, $10 ) ); } 1186 1363 | ASM asm_volatile_opt GOTO '(' string_literal ':' ':' asm_operands_opt ':' asm_clobbers_list_opt ':' label_list ')' ';' 1187 { $$ = new StatementNode( build_asm stmt( $2, $5, 0, $8, $10, $12 ) ); }1364 { $$ = new StatementNode( build_asm( $2, $5, 0, $8, $10, $12 ) ); } 1188 1365 ; 1189 1366 … … 1240 1417 1241 1418 declaration_list_opt: // used at beginning of switch statement 1242 pop1419 // empty 1243 1420 { $$ = nullptr; } 1244 1421 | declaration_list … … 1247 1424 declaration_list: 1248 1425 declaration 1249 | declaration_list pushdeclaration1250 { $$ = $1->appendList( $ 3); }1251 ; 1252 1253 KR_ declaration_list_opt:// used to declare parameter types in K&R style functions1426 | declaration_list declaration 1427 { $$ = $1->appendList( $2 ); } 1428 ; 1429 1430 KR_parameter_list_opt: // used to declare parameter types in K&R style functions 1254 1431 // empty 1255 1432 { $$ = nullptr; } 1256 | KR_ declaration_list1257 ; 1258 1259 KR_ declaration_list:1433 | KR_parameter_list 1434 ; 1435 1436 KR_parameter_list: 1260 1437 push c_declaration pop ';' 1261 1438 { $$ = $2; } 1262 | KR_ declaration_list push c_declaration pop ';'1439 | KR_parameter_list push c_declaration pop ';' 1263 1440 { $$ = $1->appendList( $3 ); } 1264 1441 ; … … 1275 1452 1276 1453 local_label_list: // GCC, local label 1277 no_attr_identifier_or_type_name {}1278 | local_label_list ',' no_attr_identifier_or_type_name {}1454 no_attr_identifier_or_type_name 1455 | local_label_list ',' no_attr_identifier_or_type_name 1279 1456 ; 1280 1457 1281 1458 declaration: // old & new style declarations 1282 c_declaration pop ';' 1283 | cfa_declaration pop ';' // CFA 1284 | STATICASSERT '(' constant_expression ',' string_literal ')' ';' // C11 1285 { throw SemanticError("Static assert is currently unimplemented."); $$ = nullptr; } // FIX ME 1286 ; 1459 c_declaration ';' 1460 | cfa_declaration ';' // CFA 1461 | static_assert // C11 1462 ; 1463 1464 static_assert: 1465 STATICASSERT '(' constant_expression ',' string_literal ')' ';' // C11 1466 { $$ = DeclarationNode::newStaticAssert( $3, $5 ); } 1467 | STATICASSERT '(' constant_expression ')' ';' // CFA 1468 { $$ = DeclarationNode::newStaticAssert( $3, build_constantStr( *new string( "\"\"" ) ) ); } 1287 1469 1288 1470 // C declaration syntax is notoriously confusing and error prone. Cforall provides its own type, variable and function … … 1307 1489 cfa_variable_declaration: // CFA 1308 1490 cfa_variable_specifier initializer_opt 1309 { 1310 typedefTable.addToEnclosingScope( TypedefTable::ID ); 1311 $$ = $1->addInitializer( $2 ); 1312 } 1491 { $$ = $1->addInitializer( $2 ); } 1313 1492 | declaration_qualifier_list cfa_variable_specifier initializer_opt 1314 1493 // declaration_qualifier_list also includes type_qualifier_list, so a semantic check is necessary to preclude 1315 1494 // them as a type_qualifier cannot appear in that context. 1316 { 1317 typedefTable.addToEnclosingScope( TypedefTable::ID ); 1318 $$ = $2->addQualifiers( $1 )->addInitializer( $3 );; 1319 } 1495 { $$ = $2->addQualifiers( $1 )->addInitializer( $3 ); } 1320 1496 | cfa_variable_declaration pop ',' push identifier_or_type_name initializer_opt 1321 { 1322 typedefTable.addToEnclosingScope( *$5, TypedefTable::ID ); 1323 $$ = $1->appendList( $1->cloneType( $5 )->addInitializer( $6 ) ); 1324 } 1497 { $$ = $1->appendList( $1->cloneType( $5 )->addInitializer( $6 ) ); } 1325 1498 ; 1326 1499 … … 1329 1502 // storage-class 1330 1503 cfa_abstract_declarator_no_tuple identifier_or_type_name asm_name_opt 1331 { 1332 typedefTable.setNextIdentifier( *$2 ); 1333 $$ = $1->addName( $2 )->addAsmName( $3 ); 1334 } 1504 { $$ = $1->addName( $2 )->addAsmName( $3 ); } 1335 1505 | cfa_abstract_tuple identifier_or_type_name asm_name_opt 1336 { 1337 typedefTable.setNextIdentifier( *$2 ); 1338 $$ = $1->addName( $2 )->addAsmName( $3 ); 1339 } 1506 { $$ = $1->addName( $2 )->addAsmName( $3 ); } 1340 1507 | type_qualifier_list cfa_abstract_tuple identifier_or_type_name asm_name_opt 1341 { 1342 typedefTable.setNextIdentifier( *$3 ); 1343 $$ = $2->addQualifiers( $1 )->addName( $3 )->addAsmName( $4 ); 1344 } 1508 { $$ = $2->addQualifiers( $1 )->addName( $3 )->addAsmName( $4 ); } 1345 1509 ; 1346 1510 1347 1511 cfa_function_declaration: // CFA 1348 1512 cfa_function_specifier 1349 {1350 typedefTable.addToEnclosingScope( TypedefTable::ID );1351 $$ = $1;1352 }1353 1513 | type_qualifier_list cfa_function_specifier 1354 { 1355 typedefTable.addToEnclosingScope( TypedefTable::ID ); 1356 $$ = $2->addQualifiers( $1 ); 1357 } 1514 { $$ = $2->addQualifiers( $1 ); } 1358 1515 | declaration_qualifier_list cfa_function_specifier 1359 { 1360 typedefTable.addToEnclosingScope( TypedefTable::ID ); 1361 $$ = $2->addQualifiers( $1 ); 1362 } 1516 { $$ = $2->addQualifiers( $1 ); } 1363 1517 | declaration_qualifier_list type_qualifier_list cfa_function_specifier 1364 { 1365 typedefTable.addToEnclosingScope( TypedefTable::ID ); 1366 $$ = $3->addQualifiers( $1 )->addQualifiers( $2 ); 1367 } 1368 | cfa_function_declaration pop ',' push identifier_or_type_name '(' push cfa_parameter_type_list_opt pop ')' 1518 { $$ = $3->addQualifiers( $1 )->addQualifiers( $2 ); } 1519 | cfa_function_declaration ',' identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' 1369 1520 { 1370 1521 // Append the return type at the start (left-hand-side) to each identifier in the list. 1371 1522 DeclarationNode * ret = new DeclarationNode; 1372 1523 ret->type = maybeClone( $1->type->base ); 1373 $$ = $1->appendList( DeclarationNode::newFunction( $ 5, ret, $8, nullptr, true) );1524 $$ = $1->appendList( DeclarationNode::newFunction( $3, ret, $6, nullptr ) ); 1374 1525 } 1375 1526 ; 1376 1527 1377 1528 cfa_function_specifier: // CFA 1378 // '[' ']' identifier_or_type_name '(' push cfa_parameter_ type_list_opt pop ')' // S/R conflict1529 // '[' ']' identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' // S/R conflict 1379 1530 // { 1380 1531 // $$ = DeclarationNode::newFunction( $3, DeclarationNode::newTuple( 0 ), $6, 0, true ); 1381 1532 // } 1382 // '[' ']' identifier '(' push cfa_parameter_ type_list_opt pop ')'1533 // '[' ']' identifier '(' push cfa_parameter_ellipsis_list_opt pop ')' 1383 1534 // { 1384 1535 // typedefTable.setNextIdentifier( *$5 ); 1385 1536 // $$ = DeclarationNode::newFunction( $5, DeclarationNode::newTuple( 0 ), $8, 0, true ); 1386 1537 // } 1387 // | '[' ']' TYPEDEFname '(' push cfa_parameter_ type_list_opt pop ')'1538 // | '[' ']' TYPEDEFname '(' push cfa_parameter_ellipsis_list_opt pop ')' 1388 1539 // { 1389 1540 // typedefTable.setNextIdentifier( *$5 ); … … 1393 1544 // identifier_or_type_name must be broken apart because of the sequence: 1394 1545 // 1395 // '[' ']' identifier_or_type_name '(' cfa_parameter_ type_list_opt ')'1546 // '[' ']' identifier_or_type_name '(' cfa_parameter_ellipsis_list_opt ')' 1396 1547 // '[' ']' type_specifier 1397 1548 // 1398 1549 // type_specifier can resolve to just TYPEDEFname (e.g., typedef int T; int f( T );). Therefore this must be 1399 1550 // flattened to allow lookahead to the '(' without having to reduce identifier_or_type_name. 1400 cfa_abstract_tuple identifier_or_type_name '(' push cfa_parameter_ type_list_opt pop ')'1551 cfa_abstract_tuple identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' 1401 1552 // To obtain LR(1 ), this rule must be factored out from function return type (see cfa_abstract_declarator). 1402 { 1403 $$ = DeclarationNode::newFunction( $2, $1, $5, 0, true ); 1404 } 1405 | cfa_function_return identifier_or_type_name '(' push cfa_parameter_type_list_opt pop ')' 1406 { 1407 $$ = DeclarationNode::newFunction( $2, $1, $5, 0, true ); 1408 } 1553 { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 ); } 1554 | cfa_function_return identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' 1555 { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 ); } 1409 1556 ; 1410 1557 … … 1413 1560 { $$ = DeclarationNode::newTuple( $3 ); } 1414 1561 | '[' push cfa_parameter_list pop ',' push cfa_abstract_parameter_list pop ']' 1415 // To obtain LR(1 ), the last cfa_abstract_parameter_list is added into this flattened rule to lookahead to the 1416 // ']'. 1562 // To obtain LR(1 ), the last cfa_abstract_parameter_list is added into this flattened rule to lookahead to the ']'. 1417 1563 { $$ = DeclarationNode::newTuple( $3->appendList( $7 ) ); } 1418 1564 ; … … 1421 1567 TYPEDEF cfa_variable_specifier 1422 1568 { 1423 typedefTable.addToEnclosingScope( TypedefTable::TD);1569 typedefTable.addToEnclosingScope( *$2->name, TYPEDEFname, "1" ); 1424 1570 $$ = $2->addTypedef(); 1425 1571 } 1426 1572 | TYPEDEF cfa_function_specifier 1427 1573 { 1428 typedefTable.addToEnclosingScope( TypedefTable::TD);1574 typedefTable.addToEnclosingScope( *$2->name, TYPEDEFname, "2" ); 1429 1575 $$ = $2->addTypedef(); 1430 1576 } 1431 1577 | cfa_typedef_declaration pop ',' push no_attr_identifier 1432 1578 { 1433 typedefTable.addToEnclosingScope( *$5, T ypedefTable::TD);1579 typedefTable.addToEnclosingScope( *$5, TYPEDEFname, "3" ); 1434 1580 $$ = $1->appendList( $1->cloneType( $5 ) ); 1435 1581 } … … 1442 1588 TYPEDEF type_specifier declarator 1443 1589 { 1444 typedefTable.addToEnclosingScope( TypedefTable::TD);1590 typedefTable.addToEnclosingScope( *$3->name, TYPEDEFname, "4" ); 1445 1591 $$ = $3->addType( $2 )->addTypedef(); 1446 1592 } 1447 1593 | typedef_declaration pop ',' push declarator 1448 1594 { 1449 typedefTable.addToEnclosingScope( TypedefTable::TD);1595 typedefTable.addToEnclosingScope( *$5->name, TYPEDEFname, "5" ); 1450 1596 $$ = $1->appendList( $1->cloneBaseType( $5 )->addTypedef() ); 1451 1597 } 1452 1598 | type_qualifier_list TYPEDEF type_specifier declarator // remaining OBSOLESCENT (see 2 ) 1453 1599 { 1454 typedefTable.addToEnclosingScope( TypedefTable::TD);1600 typedefTable.addToEnclosingScope( *$4->name, TYPEDEFname, "6" ); 1455 1601 $$ = $4->addType( $3 )->addQualifiers( $1 )->addTypedef(); 1456 1602 } 1457 1603 | type_specifier TYPEDEF declarator 1458 1604 { 1459 typedefTable.addToEnclosingScope( TypedefTable::TD);1605 typedefTable.addToEnclosingScope( *$3->name, TYPEDEFname, "7" ); 1460 1606 $$ = $3->addType( $1 )->addTypedef(); 1461 1607 } 1462 1608 | type_specifier TYPEDEF type_qualifier_list declarator 1463 1609 { 1464 typedefTable.addToEnclosingScope( TypedefTable::TD);1610 typedefTable.addToEnclosingScope( *$4->name, TYPEDEFname, "8" ); 1465 1611 $$ = $4->addQualifiers( $1 )->addTypedef()->addType( $1 ); 1466 1612 } … … 1471 1617 TYPEDEF no_attr_identifier '=' assignment_expression 1472 1618 { 1473 typedefTable.addToEnclosingScope( *$2, TypedefTable::TD );1474 $$ = DeclarationNode::newName( 0 ); // unimplemented1619 // $$ = DeclarationNode::newName( 0 ); // unimplemented 1620 SemanticError( yylloc, "Typedef expression is currently unimplemented." ); $$ = nullptr; 1475 1621 } 1476 1622 | typedef_expression pop ',' push no_attr_identifier '=' assignment_expression 1477 1623 { 1478 typedefTable.addToEnclosingScope( *$5, TypedefTable::TD );1479 $$ = DeclarationNode::newName( 0 ); // unimplemented1624 // $$ = DeclarationNode::newName( 0 ); // unimplemented 1625 SemanticError( yylloc, "Typedef expression is currently unimplemented." ); $$ = nullptr; 1480 1626 } 1481 1627 ; … … 1493 1639 // declarator asm_name_opt initializer_opt 1494 1640 // { 1495 // typedefTable.addToEnclosingScope( TypedefTable::ID);1641 // typedefTable.addToEnclosingScope( IDENTIFIER ); 1496 1642 // $$ = ( $2->addType( $1 ))->addAsmName( $3 )->addInitializer( $4 ); 1497 1643 // } 1498 1644 // | declaring_list ',' attribute_list_opt declarator asm_name_opt initializer_opt 1499 1645 // { 1500 // typedefTable.addToEnclosingScope( TypedefTable::ID);1646 // typedefTable.addToEnclosingScope( IDENTIFIER ); 1501 1647 // $$ = $1->appendList( $1->cloneBaseType( $4->addAsmName( $5 )->addInitializer( $6 ) ) ); 1502 1648 // } … … 1505 1651 c_declaration: 1506 1652 declaration_specifier declaring_list 1507 { 1508 $$ = distAttr( $1, $2 ); 1509 } 1653 { $$ = distAttr( $1, $2 ); } 1510 1654 | typedef_declaration 1511 1655 | typedef_expression // GCC, naming expression type … … 1517 1661 // storage-class 1518 1662 declarator asm_name_opt initializer_opt 1519 { 1520 typedefTable.addToEnclosingScope( TypedefTable::ID ); 1521 $$ = $1->addAsmName( $2 )->addInitializer( $3 ); 1522 } 1663 { $$ = $1->addAsmName( $2 )->addInitializer( $3 ); } 1523 1664 | declaring_list ',' attribute_list_opt declarator asm_name_opt initializer_opt 1524 { 1525 typedefTable.addToEnclosingScope( TypedefTable::ID ); 1526 $$ = $1->appendList( $4->addQualifiers( $3 )->addAsmName( $5 )->addInitializer( $6 ) ); 1527 } 1665 { $$ = $1->appendList( $4->addQualifiers( $3 )->addAsmName( $5 )->addInitializer( $6 ) ); } 1528 1666 ; 1529 1667 … … 1597 1735 1598 1736 forall: 1599 FORALL '(' 1600 { 1601 typedefTable.enterScope(); 1602 } 1603 type_parameter_list ')' // CFA 1604 { 1605 typedefTable.leaveScope(); 1606 $$ = DeclarationNode::newForall( $4 ); 1607 } 1737 FORALL '(' type_parameter_list ')' // CFA 1738 { $$ = DeclarationNode::newForall( $3 ); } 1608 1739 ; 1609 1740 … … 1678 1809 | LONG 1679 1810 { $$ = DeclarationNode::newLength( DeclarationNode::Long ); } 1680 | ZERO_T1681 { $$ = DeclarationNode::newBuiltinType( DeclarationNode::Zero ); }1682 | ONE_T1683 { $$ = DeclarationNode::newBuiltinType( DeclarationNode::One ); }1684 1811 | VALIST // GCC, __builtin_va_list 1685 1812 { $$ = DeclarationNode::newBuiltinType( DeclarationNode::Valist ); } … … 1701 1828 basic_type_specifier: 1702 1829 direct_type 1830 // Cannot have type modifiers, e.g., short, long, etc. 1703 1831 | type_qualifier_list_opt indirect_type type_qualifier_list_opt 1704 1832 { $$ = $2->addQualifiers( $1 )->addQualifiers( $3 ); } … … 1706 1834 1707 1835 direct_type: 1708 // A semantic check is necessary for conflicting type qualifiers.1709 1836 basic_type_name 1710 1837 | type_qualifier_list basic_type_name … … 1725 1852 | ATTR_TYPEGENname '(' comma_expression ')' // CFA: e.g., @type(a+b) y; 1726 1853 { $$ = DeclarationNode::newAttr( $1, $3 ); } 1854 | ZERO_T // CFA 1855 { $$ = DeclarationNode::newBuiltinType( DeclarationNode::Zero ); } 1856 | ONE_T // CFA 1857 { $$ = DeclarationNode::newBuiltinType( DeclarationNode::One ); } 1727 1858 ; 1728 1859 … … 1744 1875 { $$ = $3->addQualifiers( $1 ); } 1745 1876 | sue_type_specifier type_qualifier 1746 { $$ = $1->addQualifiers( $2 ); } 1877 { 1878 if ( $2->type != nullptr && $2->type->forall ) forall = true; // remember generic type 1879 $$ = $1->addQualifiers( $2 ); 1880 } 1747 1881 ; 1748 1882 … … 1787 1921 { $$ = DeclarationNode::newFromTypedef( $1 ); } 1788 1922 | '.' TYPEDEFname 1789 { $$ = DeclarationNode::new FromTypedef( $2 ); } // FIX ME1923 { $$ = DeclarationNode::newQualifiedType( DeclarationNode::newFromGlobalScope(), DeclarationNode::newFromTypedef( $2 ) ); } 1790 1924 | type_name '.' TYPEDEFname 1791 { $$ = DeclarationNode::new FromTypedef( $3 ); } // FIX ME1925 { $$ = DeclarationNode::newQualifiedType( $1, DeclarationNode::newFromTypedef( $3 ) ); } 1792 1926 | typegen_name 1793 1927 | '.' typegen_name 1794 { $$ = $2; } // FIX ME1928 { $$ = DeclarationNode::newQualifiedType( DeclarationNode::newFromGlobalScope(), $2 ); } 1795 1929 | type_name '.' typegen_name 1796 { $$ = $3; } // FIX ME1930 { $$ = DeclarationNode::newQualifiedType( $1, $3 ); } 1797 1931 ; 1798 1932 … … 1816 1950 ; 1817 1951 1952 fred: 1953 // empty 1954 { yyy = false; } 1955 ; 1956 1818 1957 aggregate_type: // struct, union 1819 aggregate_key attribute_list_opt '{' field_declaration_list '}' 1820 { $$ = DeclarationNode::newAggregate( $1, new string( DeclarationNode::anonymous.newName() ), nullptr, $4, true )->addQualifiers( $2 ); } 1821 | aggregate_key attribute_list_opt no_attr_identifier_or_type_name 1822 { 1823 typedefTable.makeTypedef( *$3 ); // create typedef 1824 if ( forall ) typedefTable.changeKind( *$3, TypedefTable::TG ); // possibly update 1958 aggregate_key attribute_list_opt 1959 { forall = false; } // reset 1960 '{' field_declaration_list_opt '}' type_parameters_opt 1961 { $$ = DeclarationNode::newAggregate( $1, nullptr, $7, $5, true )->addQualifiers( $2 ); } 1962 | aggregate_key attribute_list_opt no_attr_identifier fred 1963 { 1964 typedefTable.makeTypedef( *$3, forall || typedefTable.getEnclForall() ? TYPEGENname : TYPEDEFname ); // create typedef 1825 1965 forall = false; // reset 1826 1966 } 1827 '{' field_declaration_list '}' 1828 { $$ = DeclarationNode::newAggregate( $1, $3, nullptr, $6, true )->addQualifiers( $2 ); } 1829 | aggregate_key attribute_list_opt '(' type_list ')' '{' field_declaration_list '}' // CFA 1830 { $$ = DeclarationNode::newAggregate( $1, new string( DeclarationNode::anonymous.newName() ), $4, $7, false )->addQualifiers( $2 ); } 1967 '{' field_declaration_list_opt '}' type_parameters_opt 1968 { $$ = DeclarationNode::newAggregate( $1, $3, $9, $7, true )->addQualifiers( $2 ); } 1969 | aggregate_key attribute_list_opt type_name fred 1970 { 1971 // for type_name can be a qualified type name S.T, in which case only the last name in the chain needs a typedef (other names in the chain should already have one) 1972 typedefTable.makeTypedef( *$3->type->leafName(), forall || typedefTable.getEnclForall() ? TYPEGENname : TYPEDEFname ); // create typedef 1973 forall = false; // reset 1974 } 1975 '{' field_declaration_list_opt '}' type_parameters_opt 1976 { $$ = DeclarationNode::newAggregate( $1, $3->type->symbolic.name, $9, $7, true )->addQualifiers( $2 ); } 1831 1977 | aggregate_type_nobody 1832 1978 ; 1833 1979 1980 type_parameters_opt: 1981 // empty 1982 { $$ = nullptr; } %prec '}' 1983 | '(' type_list ')' 1984 { $$ = $2; } 1985 ; 1986 1834 1987 aggregate_type_nobody: // struct, union - {...} 1835 aggregate_key attribute_list_opt no_attr_identifier 1836 { 1837 typedefTable.makeTypedef( *$3 ); 1988 aggregate_key attribute_list_opt no_attr_identifier fred 1989 { 1990 typedefTable.makeTypedef( *$3, forall || typedefTable.getEnclForall() ? TYPEGENname : TYPEDEFname ); 1991 forall = false; // reset 1838 1992 $$ = DeclarationNode::newAggregate( $1, $3, nullptr, nullptr, false )->addQualifiers( $2 ); 1839 1993 } 1840 | aggregate_key attribute_list_opt TYPEDEFname 1841 { 1842 typedefTable.makeTypedef( *$3 ); 1843 $$ = DeclarationNode::newAggregate( $1, $3, nullptr, nullptr, false )->addQualifiers( $2 ); 1844 } 1845 | aggregate_key attribute_list_opt typegen_name // CFA 1846 { 1994 | aggregate_key attribute_list_opt type_name fred 1995 { 1996 forall = false; // reset 1847 1997 // Create new generic declaration with same name as previous forward declaration, where the IDENTIFIER is 1848 1998 // switched to a TYPEGENname. Link any generic arguments from typegen_name to new generic declaration and … … 1857 2007 aggregate_key: 1858 2008 STRUCT 1859 { $$ = DeclarationNode::Struct; }2009 { yyy = true; $$ = DeclarationNode::Struct; } 1860 2010 | UNION 1861 { $$ = DeclarationNode::Union; } 2011 { yyy = true; $$ = DeclarationNode::Union; } 2012 | EXCEPTION 2013 { yyy = true; $$ = DeclarationNode::Exception; } 1862 2014 | COROUTINE 1863 { $$ = DeclarationNode::Coroutine; }2015 { yyy = true; $$ = DeclarationNode::Coroutine; } 1864 2016 | MONITOR 1865 { $$ = DeclarationNode::Monitor; }2017 { yyy = true; $$ = DeclarationNode::Monitor; } 1866 2018 | THREAD 1867 { $$ = DeclarationNode::Thread; }1868 ; 1869 1870 field_declaration_list :2019 { yyy = true; $$ = DeclarationNode::Thread; } 2020 ; 2021 2022 field_declaration_list_opt: 1871 2023 // empty 1872 2024 { $$ = nullptr; } 1873 | field_declaration_list field_declaration2025 | field_declaration_list_opt field_declaration 1874 2026 { $$ = $1 ? $1->appendList( $2 ) : $2; } 1875 2027 ; 1876 2028 1877 2029 field_declaration: 1878 cfa_field_declaring_list ';' // CFA, new style field declaration 2030 type_specifier field_declaring_list_opt ';' 2031 { $$ = fieldDecl( $1, $2 ); } 2032 | EXTENSION type_specifier field_declaring_list_opt ';' // GCC 2033 { $$ = fieldDecl( $2, $3 ); distExt( $$ ); } 2034 | INLINE type_specifier field_abstract_list_opt ';' // CFA 2035 { 2036 if ( ! $3 ) { // field declarator ? 2037 $3 = DeclarationNode::newName( nullptr ); 2038 } // if 2039 $3->inLine = true; 2040 $$ = distAttr( $2, $3 ); // mark all fields in list 2041 distInl( $3 ); 2042 } 2043 | typedef_declaration ';' // CFA 2044 | cfa_field_declaring_list ';' // CFA, new style field declaration 1879 2045 | EXTENSION cfa_field_declaring_list ';' // GCC 1880 { 1881 distExt( $2 ); // mark all fields in list 1882 $$ = $2; 1883 } 1884 | type_specifier field_declaring_list ';' 1885 { 1886 $$ = distAttr( $1, $2 ); } 1887 | EXTENSION type_specifier field_declaring_list ';' // GCC 1888 { 1889 distExt( $3 ); // mark all fields in list 1890 $$ = distAttr( $2, $3 ); 1891 } 2046 { distExt( $2 ); $$ = $2; } // mark all fields in list 2047 | INLINE cfa_field_abstract_list ';' // CFA, new style field declaration 2048 { $$ = $2; } // mark all fields in list 2049 | cfa_typedef_declaration ';' // CFA 2050 | static_assert // C11 2051 ; 2052 2053 field_declaring_list_opt: 2054 // empty 2055 { $$ = nullptr; } 2056 | field_declarator 2057 | field_declaring_list_opt ',' attribute_list_opt field_declarator 2058 { $$ = $1->appendList( $4->addQualifiers( $3 ) ); } 2059 ; 2060 2061 field_declarator: 2062 bit_subrange_size // C special case, no field name 2063 { $$ = DeclarationNode::newBitfield( $1 ); } 2064 | variable_declarator bit_subrange_size_opt 2065 // A semantic check is required to ensure bit_subrange only appears on integral types. 2066 { $$ = $1->addBitfield( $2 ); } 2067 | variable_type_redeclarator bit_subrange_size_opt 2068 // A semantic check is required to ensure bit_subrange only appears on integral types. 2069 { $$ = $1->addBitfield( $2 ); } 2070 ; 2071 2072 field_abstract_list_opt: 2073 // empty 2074 { $$ = nullptr; } 2075 | field_abstract 2076 | field_abstract_list_opt ',' attribute_list_opt field_abstract 2077 { $$ = $1->appendList( $4->addQualifiers( $3 ) ); } 2078 ; 2079 2080 field_abstract: 2081 // no bit fields 2082 variable_abstract_declarator 1892 2083 ; 1893 2084 1894 2085 cfa_field_declaring_list: // CFA, new style field declaration 1895 cfa_abstract_declarator_tuple // CFA, no field name1896 |cfa_abstract_declarator_tuple no_attr_identifier_or_type_name2086 // bit-fields are handled by C declarations 2087 cfa_abstract_declarator_tuple no_attr_identifier_or_type_name 1897 2088 { $$ = $1->addName( $2 ); } 1898 2089 | cfa_field_declaring_list ',' no_attr_identifier_or_type_name 1899 2090 { $$ = $1->appendList( $1->cloneType( $3 ) ); } 1900 | cfa_field_declaring_list ',' // CFA, no field name 2091 ; 2092 2093 cfa_field_abstract_list: // CFA, new style field declaration 2094 // bit-fields are handled by C declarations 2095 cfa_abstract_declarator_tuple 2096 | cfa_field_abstract_list ',' 1901 2097 { $$ = $1->appendList( $1->cloneType( 0 ) ); } 1902 ;1903 1904 field_declaring_list:1905 field_declarator1906 | field_declaring_list ',' attribute_list_opt field_declarator1907 { $$ = $1->appendList( $4->addQualifiers( $3 ) ); }1908 ;1909 1910 field_declarator:1911 // empty1912 { $$ = DeclarationNode::newName( 0 ); /* XXX */ } // CFA, no field name1913 // '@'1914 // { $$ = DeclarationNode::newName( new string( DeclarationNode::anonymous.newName() ) ); } // CFA, no field name1915 | bit_subrange_size // no field name1916 { $$ = DeclarationNode::newBitfield( $1 ); }1917 | variable_declarator bit_subrange_size_opt1918 // A semantic check is required to ensure bit_subrange only appears on base type int.1919 { $$ = $1->addBitfield( $2 ); }1920 | variable_type_redeclarator bit_subrange_size_opt1921 // A semantic check is required to ensure bit_subrange only appears on base type int.1922 { $$ = $1->addBitfield( $2 ); }1923 | variable_abstract_declarator // CFA, no field name1924 2098 ; 1925 2099 … … 1928 2102 { $$ = nullptr; } 1929 2103 | bit_subrange_size 1930 { $$ = $1; }1931 2104 ; 1932 2105 … … 1938 2111 enum_type: // enum 1939 2112 ENUM attribute_list_opt '{' enumerator_list comma_opt '}' 1940 { $$ = DeclarationNode::newEnum( n ew string( DeclarationNode::anonymous.newName() ), $4, true )->addQualifiers( $2 ); }1941 | ENUM attribute_list_opt no_attr_identifier _or_type_name2113 { $$ = DeclarationNode::newEnum( nullptr, $4, true )->addQualifiers( $2 ); } 2114 | ENUM attribute_list_opt no_attr_identifier 1942 2115 { typedefTable.makeTypedef( *$3 ); } 1943 2116 '{' enumerator_list comma_opt '}' 1944 2117 { $$ = DeclarationNode::newEnum( $3, $6, true )->addQualifiers( $2 ); } 2118 | ENUM attribute_list_opt type_name 2119 '{' enumerator_list comma_opt '}' 2120 { $$ = DeclarationNode::newEnum( $3->type->symbolic.name, $5, true )->addQualifiers( $2 ); } 1945 2121 | enum_type_nobody 1946 2122 ; 1947 2123 1948 2124 enum_type_nobody: // enum - {...} 1949 ENUM attribute_list_opt no_attr_identifier _or_type_name2125 ENUM attribute_list_opt no_attr_identifier 1950 2126 { 1951 2127 typedefTable.makeTypedef( *$3 ); 1952 2128 $$ = DeclarationNode::newEnum( $3, 0, false )->addQualifiers( $2 ); 2129 } 2130 | ENUM attribute_list_opt type_name 2131 { 2132 typedefTable.makeTypedef( *$3->type->symbolic.name ); 2133 $$ = DeclarationNode::newEnum( $3->type->symbolic.name, 0, false )->addQualifiers( $2 ); 1953 2134 } 1954 2135 ; … … 1968 2149 ; 1969 2150 1970 // Minimum of one parameter after which ellipsis is allowed only at the end. 1971 1972 cfa_parameter_type_list_opt: // CFA 2151 cfa_parameter_ellipsis_list_opt: // CFA, abstract + real 1973 2152 // empty 2153 { $$ = DeclarationNode::newBasicType( DeclarationNode::Void ); } 2154 | ELLIPSIS 1974 2155 { $$ = nullptr; } 1975 | cfa_parameter_type_list 1976 ; 1977 1978 cfa_parameter_type_list: // CFA, abstract + real 1979 cfa_abstract_parameter_list 2156 | cfa_abstract_parameter_list 1980 2157 | cfa_parameter_list 1981 2158 | cfa_parameter_list pop ',' push cfa_abstract_parameter_list … … 2008 2185 // empty 2009 2186 { $$ = nullptr; } 2010 | parameter_type_list 2011 ; 2012 2013 parameter_type_list: 2014 parameter_list 2187 | ELLIPSIS 2188 { $$ = nullptr; } 2189 | parameter_list 2015 2190 | parameter_list pop ',' push ELLIPSIS 2016 2191 { $$ = $1->addVarArgs(); } … … 2054 2229 // No SUE declaration in parameter list. 2055 2230 declaration_specifier_nobody identifier_parameter_declarator default_initialize_opt 2056 { 2057 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2058 $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); 2059 } 2231 { $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); } 2060 2232 | declaration_specifier_nobody type_parameter_redeclarator default_initialize_opt 2061 { 2062 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2063 $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); 2064 } 2233 { $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); } 2065 2234 ; 2066 2235 … … 2113 2282 { $$ = $2; } 2114 2283 | '=' VOID 2115 { $$ = n ullptr; }2284 { $$ = new InitializerNode( true ); } 2116 2285 | ATassign initializer 2117 2286 { $$ = $2->set_maybeConstructed( false ); } … … 2120 2289 initializer: 2121 2290 assignment_expression { $$ = new InitializerNode( $1 ); } 2122 | '{' initializer_list comma_opt '}'{ $$ = new InitializerNode( $2, true ); }2123 ; 2124 2125 initializer_list :2291 | '{' initializer_list_opt comma_opt '}' { $$ = new InitializerNode( $2, true ); } 2292 ; 2293 2294 initializer_list_opt: 2126 2295 // empty 2127 2296 { $$ = nullptr; } 2128 2297 | initializer 2129 2298 | designation initializer { $$ = $2->set_designators( $1 ); } 2130 | initializer_list ',' initializer{ $$ = (InitializerNode *)( $1->set_last( $3 ) ); }2131 | initializer_list ',' designation initializer2299 | initializer_list_opt ',' initializer { $$ = (InitializerNode *)( $1->set_last( $3 ) ); } 2300 | initializer_list_opt ',' designation initializer 2132 2301 { $$ = (InitializerNode *)( $1->set_last( $4->set_designators( $3 ) ) ); } 2133 2302 ; … … 2166 2335 | '[' push constant_expression ELLIPSIS constant_expression pop ']' // GCC, multiple array elements 2167 2336 { $$ = new ExpressionNode( new RangeExpr( maybeMoveBuild< Expression >( $3 ), maybeMoveBuild< Expression >( $5 ) ) ); } 2168 | '.' '[' push field_ list pop ']'// CFA, tuple field selector2337 | '.' '[' push field_name_list pop ']' // CFA, tuple field selector 2169 2338 { $$ = $4; } 2170 2339 ; … … 2190 2359 type_parameter_list: // CFA 2191 2360 type_parameter 2192 { $$ = $1; }2193 2361 | type_parameter_list ',' type_parameter 2194 2362 { $$ = $1->appendList( $3 ); } … … 2204 2372 type_parameter: // CFA 2205 2373 type_class no_attr_identifier_or_type_name 2206 { typedefTable.addTo EnclosingScope( *$2, TypedefTable::TD); }2374 { typedefTable.addToScope( *$2, TYPEDEFname, "9" ); } 2207 2375 type_initializer_opt assertion_list_opt 2208 2376 { $$ = DeclarationNode::newTypeParam( $1, $2 )->addTypeInitializer( $4 )->addAssertions( $5 ); } 2209 2377 | type_specifier identifier_parameter_declarator 2378 | assertion_list 2379 { $$ = DeclarationNode::newTypeParam( DeclarationNode::Dtype, new string( DeclarationNode::anonymous.newName() ) )->addAssertions( $1 ); } 2210 2380 ; 2211 2381 … … 2224 2394 // empty 2225 2395 { $$ = nullptr; } 2226 | assertion_list_opt assertion 2396 | assertion_list 2397 ; 2398 2399 assertion_list: // CFA 2400 assertion 2401 | assertion_list assertion 2227 2402 { $$ = $1 ? $1->appendList( $2 ) : $2; } 2228 2403 ; … … 2230 2405 assertion: // CFA 2231 2406 '|' no_attr_identifier_or_type_name '(' type_list ')' 2232 { 2233 typedefTable.openTrait( *$2 ); 2234 $$ = DeclarationNode::newTraitUse( $2, $4 ); 2235 } 2236 | '|' '{' push trait_declaration_list '}' 2407 { $$ = DeclarationNode::newTraitUse( $2, $4 ); } 2408 | '|' '{' push trait_declaration_list pop '}' 2237 2409 { $$ = $4; } 2238 | '|' '(' push type_parameter_list pop ')' '{' push trait_declaration_list'}' '(' type_list ')'2239 {$$ = nullptr; }2410 // | '|' '(' push type_parameter_list pop ')' '{' push trait_declaration_list pop '}' '(' type_list ')' 2411 // { SemanticError( yylloc, "Generic data-type assertion is currently unimplemented." ); $$ = nullptr; } 2240 2412 ; 2241 2413 … … 2244 2416 { $$ = new ExpressionNode( new TypeExpr( maybeMoveBuildType( $1 ) ) ); } 2245 2417 | assignment_expression 2418 { SemanticError( yylloc, toString("Expression generic parameters are currently unimplemented: ", $1->build()) ); $$ = nullptr; } 2246 2419 | type_list ',' type 2247 2420 { $$ = (ExpressionNode *)( $1->set_last( new ExpressionNode( new TypeExpr( maybeMoveBuildType( $3 ) ) ) ) ); } 2248 2421 | type_list ',' assignment_expression 2249 { $$ = (ExpressionNode *)( $1->set_last( $3 )); } 2422 { SemanticError( yylloc, toString("Expression generic parameters are currently unimplemented: ", $3->build()) ); $$ = nullptr; } 2423 // { $$ = (ExpressionNode *)( $1->set_last( $3 )); } 2250 2424 ; 2251 2425 … … 2269 2443 no_attr_identifier_or_type_name 2270 2444 { 2271 typedefTable.addToEnclosingScope( *$1, T ypedefTable::TD);2445 typedefTable.addToEnclosingScope( *$1, TYPEDEFname, "10" ); 2272 2446 $$ = DeclarationNode::newTypeDecl( $1, 0 ); 2273 2447 } 2274 | no_attr_identifier_or_type_name '(' push type_parameter_list pop')'2275 { 2276 typedefTable.addToEnclosingScope( *$1, T ypedefTable::TG);2277 $$ = DeclarationNode::newTypeDecl( $1, $ 4);2448 | no_attr_identifier_or_type_name '(' type_parameter_list ')' 2449 { 2450 typedefTable.addToEnclosingScope( *$1, TYPEGENname, "11" ); 2451 $$ = DeclarationNode::newTypeDecl( $1, $3 ); 2278 2452 } 2279 2453 ; 2280 2454 2281 2455 trait_specifier: // CFA 2282 TRAIT no_attr_identifier_or_type_name '(' push type_parameter_list pop ')' '{' '}' 2283 { 2284 typedefTable.addToEnclosingScope( *$2, TypedefTable::ID ); 2285 $$ = DeclarationNode::newTrait( $2, $5, 0 ); 2286 } 2287 | TRAIT no_attr_identifier_or_type_name '(' push type_parameter_list pop ')' '{' 2288 { 2289 typedefTable.enterTrait( *$2 ); 2290 typedefTable.enterScope(); 2291 } 2292 trait_declaration_list '}' 2293 { 2294 typedefTable.leaveTrait(); 2295 typedefTable.addToEnclosingScope( *$2, TypedefTable::ID ); 2296 $$ = DeclarationNode::newTrait( $2, $5, $10 ); 2297 } 2456 TRAIT no_attr_identifier_or_type_name '(' type_parameter_list ')' '{' '}' 2457 { $$ = DeclarationNode::newTrait( $2, $4, 0 ); } 2458 | TRAIT no_attr_identifier_or_type_name '(' type_parameter_list ')' '{' push trait_declaration_list pop '}' 2459 { $$ = DeclarationNode::newTrait( $2, $4, $8 ); } 2298 2460 ; 2299 2461 2300 2462 trait_declaration_list: // CFA 2301 2463 trait_declaration 2302 | trait_declaration_list p ush trait_declaration2303 { $$ = $1->appendList( $ 3); }2464 | trait_declaration_list pop push trait_declaration 2465 { $$ = $1->appendList( $4 ); } 2304 2466 ; 2305 2467 2306 2468 trait_declaration: // CFA 2307 cfa_trait_declaring_list pop';'2308 | trait_declaring_list pop';'2469 cfa_trait_declaring_list ';' 2470 | trait_declaring_list ';' 2309 2471 ; 2310 2472 2311 2473 cfa_trait_declaring_list: // CFA 2312 2474 cfa_variable_specifier 2313 {2314 typedefTable.addToEnclosingScope2( TypedefTable::ID );2315 $$ = $1;2316 }2317 2475 | cfa_function_specifier 2318 {2319 typedefTable.addToEnclosingScope2( TypedefTable::ID );2320 $$ = $1;2321 }2322 2476 | cfa_trait_declaring_list pop ',' push identifier_or_type_name 2323 { 2324 typedefTable.addToEnclosingScope2( *$5, TypedefTable::ID ); 2325 $$ = $1->appendList( $1->cloneType( $5 ) ); 2326 } 2477 { $$ = $1->appendList( $1->cloneType( $5 ) ); } 2327 2478 ; 2328 2479 2329 2480 trait_declaring_list: // CFA 2330 2481 type_specifier declarator 2331 { 2332 typedefTable.addToEnclosingScope2( TypedefTable::ID ); 2333 $$ = $2->addType( $1 ); 2334 } 2482 { $$ = $2->addType( $1 ); } 2335 2483 | trait_declaring_list pop ',' push declarator 2336 { 2337 typedefTable.addToEnclosingScope2( TypedefTable::ID ); 2338 $$ = $1->appendList( $1->cloneBaseType( $5 ) ); 2339 } 2484 { $$ = $1->appendList( $1->cloneBaseType( $5 ) ); } 2340 2485 ; 2341 2486 … … 2343 2488 2344 2489 translation_unit: 2345 // empty 2346 {} // empty input file 2490 // empty, input file 2347 2491 | external_definition_list 2348 2492 { parseTree = parseTree ? parseTree->appendList( $1 ) : $1; } … … 2350 2494 2351 2495 external_definition_list: 2352 external_definition 2353 | external_definition_list push external_definition 2496 push external_definition pop 2497 { $$ = $2; } 2498 | external_definition_list push external_definition pop 2354 2499 { $$ = $1 ? $1->appendList( $3 ) : $3; } 2355 2500 ; … … 2361 2506 ; 2362 2507 2508 up: 2509 { typedefTable.up( forall ); forall = false; } 2510 ; 2511 2512 down: 2513 { typedefTable.down(); } 2514 ; 2515 2363 2516 external_definition: 2364 2517 declaration 2365 2518 | external_function_definition 2519 | EXTENSION external_definition // GCC, multiple __extension__ allowed, meaning unknown 2520 { 2521 distExt( $2 ); // mark all fields in list 2522 $$ = $2; 2523 } 2366 2524 | ASM '(' string_literal ')' ';' // GCC, global assembler statement 2367 2525 { 2368 $$ = DeclarationNode::newAsmStmt( new StatementNode( build_asm stmt( false, $3, 0 ) ) );2526 $$ = DeclarationNode::newAsmStmt( new StatementNode( build_asm( false, $3, 0 ) ) ); 2369 2527 } 2370 2528 | EXTERN STRINGliteral // C++-style linkage specifier 2371 2529 { 2372 2530 linkageStack.push( linkage ); // handle nested extern "C"/"Cforall" 2373 linkage = LinkageSpec::linkageUpdate( linkage, $2 );2374 } 2375 '{' external_definition_list_opt'}'2531 linkage = LinkageSpec::linkageUpdate( yylloc, linkage, $2 ); 2532 } 2533 '{' up external_definition_list_opt down '}' 2376 2534 { 2377 2535 linkage = linkageStack.top(); 2378 2536 linkageStack.pop(); 2537 $$ = $6; 2538 } 2539 | type_qualifier_list 2540 { 2541 if ( $1->type->qualifiers.val ) { SemanticError( yylloc, "CV qualifiers cannot be distributed; only storage-class and forall qualifiers." ); } 2542 if ( $1->type->forall ) forall = true; // remember generic type 2543 } 2544 '{' up external_definition_list_opt down '}' // CFA, namespace 2545 { 2546 distQual( $5, $1 ); 2547 forall = false; 2379 2548 $$ = $5; 2380 2549 } 2381 | EXTENSION external_definition // GCC, multiple __extension__ allowed, meaning unknown 2382 { 2383 distExt( $2 ); // mark all fields in list 2384 $$ = $2; 2385 } 2386 | forall '{' external_definition_list '}' // CFA, namespace 2550 | declaration_qualifier_list 2551 { 2552 if ( $1->type && $1->type->qualifiers.val ) { SemanticError( yylloc, "CV qualifiers cannot be distributed; only storage-class and forall qualifiers." ); } 2553 if ( $1->type && $1->type->forall ) forall = true; // remember generic type 2554 } 2555 '{' up external_definition_list_opt down '}' // CFA, namespace 2556 { 2557 distQual( $5, $1 ); 2558 forall = false; 2559 $$ = $5; 2560 } 2561 | declaration_qualifier_list type_qualifier_list 2562 { 2563 if ( ($1->type && $1->type->qualifiers.val) || $2->type->qualifiers.val ) { SemanticError( yylloc, "CV qualifiers cannot be distributed; only storage-class and forall qualifiers." ); } 2564 if ( ($1->type && $1->type->forall) || $2->type->forall ) forall = true; // remember generic type 2565 } 2566 '{' up external_definition_list_opt down '}' // CFA, namespace 2567 { 2568 distQual( $6, $1->addQualifiers( $2 ) ); 2569 forall = false; 2570 $$ = $6; 2571 } 2387 2572 ; 2388 2573 … … 2395 2580 // declaration must still have a type_specifier. OBSOLESCENT (see 1) 2396 2581 | function_declarator compound_statement 2397 { 2398 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2399 typedefTable.leaveScope(); 2400 $$ = $1->addFunctionBody( $2 ); 2401 } 2402 | KR_function_declarator KR_declaration_list_opt compound_statement 2403 { 2404 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2405 typedefTable.leaveScope(); 2406 $$ = $1->addOldDeclList( $2 )->addFunctionBody( $3 ); 2407 } 2582 { $$ = $1->addFunctionBody( $2 ); } 2583 | KR_function_declarator KR_parameter_list_opt compound_statement 2584 { $$ = $1->addOldDeclList( $2 )->addFunctionBody( $3 ); } 2408 2585 ; 2409 2586 2410 2587 with_clause_opt: 2411 2588 // empty 2412 { $$ = nullptr; }2589 { $$ = nullptr; forall = false; } 2413 2590 | WITH '(' tuple_expression_list ')' 2414 { $$ = new StatementNode( build_with( $3, nullptr ) ); }2591 { $$ = $3; forall = false; } 2415 2592 ; 2416 2593 … … 2418 2595 cfa_function_declaration with_clause_opt compound_statement // CFA 2419 2596 { 2420 typedefTable.addToEnclosingScope( TypedefTable::ID );2421 typedefTable.leaveScope();2422 2597 // Add the function body to the last identifier in the function definition list, i.e., foo3: 2423 2598 // [const double] foo1(), foo2( int ), foo3( double ) { return 3.0; } … … 2428 2603 { 2429 2604 rebindForall( $1, $2 ); 2430 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2431 typedefTable.leaveScope(); 2605 $$ = $2->addFunctionBody( $4, $3 )->addType( $1 ); 2606 } 2607 | declaration_specifier variable_type_redeclarator with_clause_opt compound_statement 2608 { 2609 rebindForall( $1, $2 ); 2432 2610 $$ = $2->addFunctionBody( $4, $3 )->addType( $1 ); 2433 2611 } 2434 2612 // handles default int return type, OBSOLESCENT (see 1) 2435 2613 | type_qualifier_list function_declarator with_clause_opt compound_statement 2436 { 2437 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2438 typedefTable.leaveScope(); 2439 $$ = $2->addFunctionBody( $4, $3 )->addQualifiers( $1 ); 2440 } 2614 { $$ = $2->addFunctionBody( $4, $3 )->addQualifiers( $1 ); } 2441 2615 // handles default int return type, OBSOLESCENT (see 1) 2442 2616 | declaration_qualifier_list function_declarator with_clause_opt compound_statement 2443 { 2444 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2445 typedefTable.leaveScope(); 2446 $$ = $2->addFunctionBody( $4, $3 )->addQualifiers( $1 ); 2447 } 2617 { $$ = $2->addFunctionBody( $4, $3 )->addQualifiers( $1 ); } 2448 2618 // handles default int return type, OBSOLESCENT (see 1) 2449 2619 | declaration_qualifier_list type_qualifier_list function_declarator with_clause_opt compound_statement 2450 { 2451 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2452 typedefTable.leaveScope(); 2453 $$ = $3->addFunctionBody( $5, $4 )->addQualifiers( $2 )->addQualifiers( $1 ); 2454 } 2620 { $$ = $3->addFunctionBody( $5, $4 )->addQualifiers( $2 )->addQualifiers( $1 ); } 2455 2621 2456 2622 // Old-style K&R function definition, OBSOLESCENT (see 4) 2457 | declaration_specifier KR_function_declarator KR_ declaration_list_opt with_clause_opt compound_statement2623 | declaration_specifier KR_function_declarator KR_parameter_list_opt with_clause_opt compound_statement 2458 2624 { 2459 2625 rebindForall( $1, $2 ); 2460 typedefTable.addToEnclosingScope( TypedefTable::ID );2461 typedefTable.leaveScope();2462 2626 $$ = $2->addOldDeclList( $3 )->addFunctionBody( $5, $4 )->addType( $1 ); 2463 2627 } 2464 2628 // handles default int return type, OBSOLESCENT (see 1) 2465 | type_qualifier_list KR_function_declarator KR_declaration_list_opt with_clause_opt compound_statement 2466 { 2467 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2468 typedefTable.leaveScope(); 2469 $$ = $2->addOldDeclList( $3 )->addFunctionBody( $5, $4 )->addQualifiers( $1 ); 2470 } 2629 | type_qualifier_list KR_function_declarator KR_parameter_list_opt with_clause_opt compound_statement 2630 { $$ = $2->addOldDeclList( $3 )->addFunctionBody( $5, $4 )->addQualifiers( $1 ); } 2471 2631 // handles default int return type, OBSOLESCENT (see 1) 2472 | declaration_qualifier_list KR_function_declarator KR_declaration_list_opt with_clause_opt compound_statement 2473 { 2474 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2475 typedefTable.leaveScope(); 2476 $$ = $2->addOldDeclList( $3 )->addFunctionBody( $5, $4 )->addQualifiers( $1 ); 2477 } 2632 | declaration_qualifier_list KR_function_declarator KR_parameter_list_opt with_clause_opt compound_statement 2633 { $$ = $2->addOldDeclList( $3 )->addFunctionBody( $5, $4 )->addQualifiers( $1 ); } 2478 2634 // handles default int return type, OBSOLESCENT (see 1) 2479 | declaration_qualifier_list type_qualifier_list KR_function_declarator KR_declaration_list_opt with_clause_opt compound_statement 2480 { 2481 typedefTable.addToEnclosingScope( TypedefTable::ID ); 2482 typedefTable.leaveScope(); 2483 $$ = $3->addOldDeclList( $4 )->addFunctionBody( $6, $5 )->addQualifiers( $2 )->addQualifiers( $1 ); 2484 } 2635 | declaration_qualifier_list type_qualifier_list KR_function_declarator KR_parameter_list_opt with_clause_opt compound_statement 2636 { $$ = $3->addOldDeclList( $4 )->addFunctionBody( $6, $5 )->addQualifiers( $2 )->addQualifiers( $1 ); } 2485 2637 ; 2486 2638 … … 2592 2744 paren_identifier: 2593 2745 identifier 2594 { 2595 typedefTable.setNextIdentifier( *$1 ); 2596 $$ = DeclarationNode::newName( $1 ); 2597 } 2746 { $$ = DeclarationNode::newName( $1 ); } 2598 2747 | '(' paren_identifier ')' // redundant parenthesis 2599 2748 { $$ = $2; } … … 2728 2877 paren_type: 2729 2878 typedef 2879 // hide type name in enclosing scope by variable name 2880 { 2881 // if ( ! typedefTable.existsCurr( *$1->name ) ) { 2882 typedefTable.addToEnclosingScope( *$1->name, IDENTIFIER, "ID" ); 2883 // } else { 2884 // SemanticError( yylloc, string("'") + *$1->name + "' redeclared as different kind of symbol." ); $$ = nullptr; 2885 // } // if 2886 } 2730 2887 | '(' paren_type ')' 2731 2888 { $$ = $2; } … … 2738 2895 { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); } 2739 2896 | '(' type_ptr ')' attribute_list_opt 2740 { $$ = $2->addQualifiers( $4 ); } 2897 { $$ = $2->addQualifiers( $4 ); } // redundant parenthesis 2741 2898 ; 2742 2899 … … 2830 2987 typedef: 2831 2988 TYPEDEFname 2832 { 2833 typedefTable.setNextIdentifier( *$1 ); 2834 $$ = DeclarationNode::newName( $1 ); 2835 } 2989 { $$ = DeclarationNode::newName( $1 ); } 2836 2990 | TYPEGENname 2837 { 2838 typedefTable.setNextIdentifier( *$1 ); 2839 $$ = DeclarationNode::newName( $1 ); 2840 } 2991 { $$ = DeclarationNode::newName( $1 ); } 2841 2992 ; 2842 2993 … … 3023 3174 '[' ']' 3024 3175 { $$ = DeclarationNode::newArray( 0, 0, false ); } 3025 // multi_array_dimension handles the '[' '*' ']' case3176 // multi_array_dimension handles the '[' '*' ']' case 3026 3177 | '[' push type_qualifier_list '*' pop ']' // remaining C99 3027 3178 { $$ = DeclarationNode::newVarArray( $3 ); } 3028 3179 | '[' push type_qualifier_list pop ']' 3029 3180 { $$ = DeclarationNode::newArray( 0, $3, false ); } 3030 // multi_array_dimension handles the '[' assignment_expression ']' case3181 // multi_array_dimension handles the '[' assignment_expression ']' case 3031 3182 | '[' push type_qualifier_list assignment_expression pop ']' 3032 3183 { $$ = DeclarationNode::newArray( $4, $3, false ); } … … 3164 3315 // 3165 3316 // cfa_abstract_tuple identifier_or_type_name 3166 // '[' cfa_parameter_list ']' identifier_or_type_name '(' cfa_parameter_ type_list_opt ')'3317 // '[' cfa_parameter_list ']' identifier_or_type_name '(' cfa_parameter_ellipsis_list_opt ')' 3167 3318 // 3168 3319 // since a function return type can be syntactically identical to a tuple type: … … 3223 3374 '[' push cfa_abstract_parameter_list pop ']' 3224 3375 { $$ = DeclarationNode::newTuple( $3 ); } 3376 | '[' push type_specifier_nobody ELLIPSIS pop ']' 3377 { SemanticError( yylloc, "Tuple array currently unimplemented." ); $$ = nullptr; } 3378 | '[' push type_specifier_nobody ELLIPSIS constant_expression pop ']' 3379 { SemanticError( yylloc, "Tuple array currently unimplemented." ); $$ = nullptr; } 3225 3380 ; 3226 3381 3227 3382 cfa_abstract_function: // CFA 3228 // '[' ']' '(' cfa_parameter_ type_list_opt ')'3383 // '[' ']' '(' cfa_parameter_ellipsis_list_opt ')' 3229 3384 // { $$ = DeclarationNode::newFunction( nullptr, DeclarationNode::newTuple( nullptr ), $4, nullptr ); } 3230 cfa_abstract_tuple '(' push cfa_parameter_ type_list_opt pop ')'3385 cfa_abstract_tuple '(' push cfa_parameter_ellipsis_list_opt pop ')' 3231 3386 { $$ = DeclarationNode::newFunction( nullptr, $1, $4, nullptr ); } 3232 | cfa_function_return '(' push cfa_parameter_ type_list_opt pop ')'3387 | cfa_function_return '(' push cfa_parameter_ellipsis_list_opt pop ')' 3233 3388 { $$ = DeclarationNode::newFunction( nullptr, $1, $4, nullptr ); } 3234 3389 ; … … 3261 3416 3262 3417 %% 3418 3263 3419 // ----end of grammar---- 3264 3420 -
src/ResolvExpr/AdjustExprType.cc
rf9feab8 r90152a4 24 24 class AdjustExprType : public WithShortCircuiting { 25 25 public: 26 AdjustExprType( const TypeEnvironment & env, const SymTab::Indexer &indexer );26 AdjustExprType( const TypeEnvironment & env, const SymTab::Indexer & indexer ); 27 27 void premutate( VoidType * ) { visit_children = false; } 28 28 void premutate( BasicType * ) { visit_children = false; } … … 45 45 46 46 private: 47 const TypeEnvironment & env;48 const SymTab::Indexer & indexer;47 const TypeEnvironment & env; 48 const SymTab::Indexer & indexer; 49 49 }; 50 50 … … 55 55 } 56 56 57 void adjustExprType( Type *& type ) { 58 TypeEnvironment env; 59 SymTab::Indexer indexer; 60 adjustExprType( type, env, indexer ); 61 } 62 57 63 AdjustExprType::AdjustExprType( const TypeEnvironment &env, const SymTab::Indexer &indexer ) 58 64 : env( env ), indexer( indexer ) { … … 60 66 61 67 Type * AdjustExprType::postmutate( ArrayType * arrayType ) { 62 PointerType *pointerType = new PointerType ( arrayType->get_qualifiers(), arrayType->base );68 PointerType *pointerType = new PointerType{ arrayType->get_qualifiers(), arrayType->base }; 63 69 arrayType->base = nullptr; 64 70 delete arrayType; … … 67 73 68 74 Type * AdjustExprType::postmutate( FunctionType * functionType ) { 69 return new PointerType ( Type::Qualifiers(), functionType );75 return new PointerType{ Type::Qualifiers(), functionType }; 70 76 } 71 77 72 78 Type * AdjustExprType::postmutate( TypeInstType * typeInst ) { 73 EqvClass eqvClass; 74 if ( env.lookup( typeInst->get_name(), eqvClass ) ) { 75 if ( eqvClass.data.kind == TypeDecl::Ftype ) { 76 PointerType *pointerType = new PointerType( Type::Qualifiers(), typeInst ); 77 return pointerType; 79 if ( const EqvClass* eqvClass = env.lookup( typeInst->get_name() ) ) { 80 if ( eqvClass->data.kind == TypeDecl::Ftype ) { 81 return new PointerType{ Type::Qualifiers(), typeInst }; 78 82 } 79 83 } else if ( NamedTypeDecl *ntDecl = indexer.lookupType( typeInst->get_name() ) ) { 80 84 if ( TypeDecl *tyDecl = dynamic_cast< TypeDecl* >( ntDecl ) ) { 81 85 if ( tyDecl->get_kind() == TypeDecl::Ftype ) { 82 PointerType *pointerType = new PointerType( Type::Qualifiers(), typeInst ); 83 return pointerType; 86 return new PointerType{ Type::Qualifiers(), typeInst }; 84 87 } // if 85 88 } // if -
src/ResolvExpr/Alternative.cc
rf9feab8 r90152a4 27 27 28 28 namespace ResolvExpr { 29 Alternative::Alternative() : cost( Cost::zero ), cvtCost( Cost::zero ), expr( 0) {}29 Alternative::Alternative() : cost( Cost::zero ), cvtCost( Cost::zero ), expr( nullptr ) {} 30 30 31 31 Alternative::Alternative( Expression *expr, const TypeEnvironment &env, const Cost& cost ) … … 48 48 } 49 49 50 Alternative::Alternative( Alternative && other ) : cost( other.cost ), cvtCost( other.cvtCost ), expr( other.expr ), env( other.env) {50 Alternative::Alternative( Alternative && other ) : cost( other.cost ), cvtCost( other.cvtCost ), expr( other.expr ), env( std::move( other.env ) ) { 51 51 other.expr = nullptr; 52 52 } … … 58 58 cvtCost = other.cvtCost; 59 59 expr = other.expr; 60 env = other.env;60 env = std::move( other.env ); 61 61 other.expr = nullptr; 62 62 return *this; -
src/ResolvExpr/Alternative.h
rf9feab8 r90152a4 57 57 /// Moves all elements from src to the beginning of dst 58 58 void spliceBegin( AltList& dst, AltList& src ); 59 60 static inline std::ostream & operator<<(std::ostream & os, const ResolvExpr::Alternative & alt) { 61 alt.print( os ); 62 return os; 63 } 59 64 } // namespace ResolvExpr 60 65 -
src/ResolvExpr/AlternativeFinder.cc
rf9feab8 r90152a4 10 10 // Created On : Sat May 16 23:52:08 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Aug 28 13:47:24 201713 // Update Count : 3 212 // Last Modified On : Sat Feb 17 11:19:39 2018 13 // Update Count : 33 14 14 // 15 15 … … 25 25 #include <vector> // for vector 26 26 27 #include "CompilationState.h" // for resolvep 27 28 #include "Alternative.h" // for AltList, Alternative 28 29 #include "AlternativeFinder.h" … … 49 50 #include "typeops.h" // for adjustExprType, polyCost, castCost 50 51 51 extern bool resolvep;52 52 #define PRINT( text ) if ( resolvep ) { text } 53 53 //#define DEBUG_COST … … 60 60 61 61 namespace ResolvExpr { 62 Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer, TypeEnvironment &env ) { 63 CastExpr *castToVoid = new CastExpr( expr ); 64 65 AlternativeFinder finder( indexer, env ); 66 finder.findWithAdjustment( castToVoid ); 67 68 // it's a property of the language that a cast expression has either 1 or 0 interpretations; if it has 0 69 // interpretations, an exception has already been thrown. 70 assert( finder.get_alternatives().size() == 1 ); 71 CastExpr *newExpr = dynamic_cast< CastExpr* >( finder.get_alternatives().front().expr ); 72 assert( newExpr ); 73 env = finder.get_alternatives().front().env; 74 return newExpr->get_arg()->clone(); 75 } 62 struct AlternativeFinder::Finder : public WithShortCircuiting { 63 Finder( AlternativeFinder & altFinder ) : altFinder( altFinder ), indexer( altFinder.indexer ), alternatives( altFinder.alternatives ), env( altFinder.env ), targetType( altFinder.targetType ) {} 64 65 void previsit( BaseSyntaxNode * ) { visit_children = false; } 66 67 void postvisit( ApplicationExpr * applicationExpr ); 68 void postvisit( UntypedExpr * untypedExpr ); 69 void postvisit( AddressExpr * addressExpr ); 70 void postvisit( LabelAddressExpr * labelExpr ); 71 void postvisit( CastExpr * castExpr ); 72 void postvisit( VirtualCastExpr * castExpr ); 73 void postvisit( UntypedMemberExpr * memberExpr ); 74 void postvisit( MemberExpr * memberExpr ); 75 void postvisit( NameExpr * variableExpr ); 76 void postvisit( VariableExpr * variableExpr ); 77 void postvisit( ConstantExpr * constantExpr ); 78 void postvisit( SizeofExpr * sizeofExpr ); 79 void postvisit( AlignofExpr * alignofExpr ); 80 void postvisit( UntypedOffsetofExpr * offsetofExpr ); 81 void postvisit( OffsetofExpr * offsetofExpr ); 82 void postvisit( OffsetPackExpr * offsetPackExpr ); 83 void postvisit( AttrExpr * attrExpr ); 84 void postvisit( LogicalExpr * logicalExpr ); 85 void postvisit( ConditionalExpr * conditionalExpr ); 86 void postvisit( CommaExpr * commaExpr ); 87 void postvisit( ImplicitCopyCtorExpr * impCpCtorExpr ); 88 void postvisit( ConstructorExpr * ctorExpr ); 89 void postvisit( RangeExpr * rangeExpr ); 90 void postvisit( UntypedTupleExpr * tupleExpr ); 91 void postvisit( TupleExpr * tupleExpr ); 92 void postvisit( TupleIndexExpr * tupleExpr ); 93 void postvisit( TupleAssignExpr * tupleExpr ); 94 void postvisit( UniqueExpr * unqExpr ); 95 void postvisit( StmtExpr * stmtExpr ); 96 void postvisit( UntypedInitExpr * initExpr ); 97 void postvisit( InitExpr * initExpr ); 98 void postvisit( DeletedExpr * delExpr ); 99 void postvisit( GenericExpr * genExpr ); 100 101 /// Adds alternatives for anonymous members 102 void addAnonConversions( const Alternative & alt ); 103 /// Adds alternatives for member expressions, given the aggregate, conversion cost for that aggregate, and name of the member 104 template< typename StructOrUnionType > void addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const TypeEnvironment & env, const std::string & name ); 105 /// Adds alternatives for member expressions where the left side has tuple type 106 void addTupleMembers( TupleType * tupleType, Expression *expr, const Cost &newCost, const TypeEnvironment & env, Expression * member ); 107 /// Adds alternatives for offsetof expressions, given the base type and name of the member 108 template< typename StructOrUnionType > void addOffsetof( StructOrUnionType *aggInst, const std::string &name ); 109 /// Takes a final result and checks if its assertions can be satisfied 110 template<typename OutputIterator> 111 void validateFunctionAlternative( const Alternative &func, ArgPack& result, const std::vector<ArgPack>& results, OutputIterator out ); 112 /// Finds matching alternatives for a function, given a set of arguments 113 template<typename OutputIterator> 114 void makeFunctionAlternatives( const Alternative &func, FunctionType *funcType, const ExplodedArgs& args, OutputIterator out ); 115 /// Checks if assertion parameters match for a new alternative 116 template< typename OutputIterator > 117 void inferParameters( const AssertionSet &need, AssertionSet &have, const Alternative &newAlt, OpenVarSet &openVars, OutputIterator out ); 118 private: 119 AlternativeFinder & altFinder; 120 const SymTab::Indexer &indexer; 121 AltList & alternatives; 122 const TypeEnvironment &env; 123 Type *& targetType; 124 }; 76 125 77 126 Cost sumCost( const AltList &in ) { … … 127 176 selected[ mangleName ] = current; 128 177 } else if ( candidate->cost == mapPlace->second.candidate->cost ) { 129 PRINT( 130 std::cerr << "marking ambiguous" << std::endl; 131 ) 132 mapPlace->second.isAmbiguous = true; 178 // if one of the candidates contains a deleted identifier, can pick the other, since 179 // deleted expressions should not be ambiguous if there is another option that is at least as good 180 if ( findDeletedExpr( candidate->expr ) ) { 181 // do nothing 182 PRINT( std::cerr << "candidate is deleted" << std::endl; ) 183 } else if ( findDeletedExpr( mapPlace->second.candidate->expr ) ) { 184 PRINT( std::cerr << "current is deleted" << std::endl; ) 185 selected[ mangleName ] = current; 186 } else { 187 PRINT( 188 std::cerr << "marking ambiguous" << std::endl; 189 ) 190 mapPlace->second.isAmbiguous = true; 191 } 133 192 } else { 134 193 PRINT( … … 152 211 153 212 void renameTypes( Expression *expr ) { 154 expr->get_result()->accept( global_renamer);213 renameTyVars( expr->result ); 155 214 } 156 215 } // namespace 157 216 158 void referenceToRvalueConversion( Expression *& expr ) {217 void referenceToRvalueConversion( Expression *& expr, Cost & cost ) { 159 218 if ( dynamic_cast< ReferenceType * >( expr->get_result() ) ) { 160 219 // cast away reference from expr 161 220 expr = new CastExpr( expr, expr->get_result()->stripReferences()->clone() ); 221 cost.incReference(); 162 222 } 163 223 } … … 185 245 186 246 void AlternativeFinder::find( Expression *expr, bool adjust, bool prune, bool failFast ) { 187 expr->accept( *this ); 247 PassVisitor<Finder> finder( *this ); 248 expr->accept( finder ); 188 249 if ( failFast && alternatives.empty() ) { 189 250 PRINT( 190 251 std::cerr << "No reasonable alternatives for expression " << expr << std::endl; 191 252 ) 192 throw SemanticError( "No reasonable alternatives for expression ", expr);253 SemanticError( expr, "No reasonable alternatives for expression " ); 193 254 } 194 255 if ( prune ) { … … 206 267 stream << "Cannot choose between " << winners.size() << " alternatives for expression\n"; 207 268 expr->print( stream ); 208 stream << " Alternatives are:\n";269 stream << " Alternatives are:\n"; 209 270 printAlts( winners, stream, 1 ); 210 throw SemanticError(stream.str() );271 SemanticError( expr->location, stream.str() ); 211 272 } 212 273 alternatives = move(pruned); … … 244 305 } 245 306 246 void AlternativeFinder:: addAnonConversions( const Alternative & alt ) {307 void AlternativeFinder::Finder::addAnonConversions( const Alternative & alt ) { 247 308 // adds anonymous member interpretations whenever an aggregate value type is seen. 248 309 // it's okay for the aggregate expression to have reference type -- cast it to the base type to treat the aggregate as the referenced value 249 310 std::unique_ptr<Expression> aggrExpr( alt.expr->clone() ); 250 alt.env.apply( aggrExpr-> get_result());251 Type * aggrType = aggrExpr-> get_result();311 alt.env.apply( aggrExpr->result ); 312 Type * aggrType = aggrExpr->result; 252 313 if ( dynamic_cast< ReferenceType * >( aggrType ) ) { 253 314 aggrType = aggrType->stripReferences(); … … 255 316 } 256 317 257 if ( StructInstType *structInst = dynamic_cast< StructInstType* >( aggrExpr->get_result() ) ) { 258 NameExpr nameExpr( "" ); 259 addAggMembers( structInst, aggrExpr.get(), alt.cost+Cost::safe, alt.env, &nameExpr ); 260 } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( aggrExpr->get_result() ) ) { 261 NameExpr nameExpr( "" ); 262 addAggMembers( unionInst, aggrExpr.get(), alt.cost+Cost::safe, alt.env, &nameExpr ); 318 if ( StructInstType *structInst = dynamic_cast< StructInstType* >( aggrExpr->result ) ) { 319 addAggMembers( structInst, aggrExpr.get(), alt.cost+Cost::safe, alt.env, "" ); 320 } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( aggrExpr->result ) ) { 321 addAggMembers( unionInst, aggrExpr.get(), alt.cost+Cost::safe, alt.env, "" ); 263 322 } // if 264 323 } 265 324 266 325 template< typename StructOrUnionType > 267 void AlternativeFinder::addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const TypeEnvironment & env, Expression * member ) { 268 // by this point, member must be a name expr 269 NameExpr * nameExpr = dynamic_cast< NameExpr * >( member ); 270 if ( ! nameExpr ) return; 271 const std::string & name = nameExpr->get_name(); 326 void AlternativeFinder::Finder::addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const TypeEnvironment & env, const std::string & name ) { 272 327 std::list< Declaration* > members; 273 328 aggInst->lookup( name, members ); 274 329 275 for ( std::list< Declaration* >::const_iterator i = members.begin(); i != members.end(); ++i ) { 276 if ( DeclarationWithType *dwt = dynamic_cast< DeclarationWithType* >( *i ) ) { 277 alternatives.push_back( Alternative( new MemberExpr( dwt, expr->clone() ), env, newCost ) ); 278 renameTypes( alternatives.back().expr ); 279 addAnonConversions( alternatives.back() ); // add anonymous member interpretations whenever an aggregate value type is seen as a member expression. 330 for ( Declaration * decl : members ) { 331 if ( DeclarationWithType *dwt = dynamic_cast< DeclarationWithType* >( decl ) ) { 332 // addAnonAlternatives uses vector::push_back, which invalidates references to existing elements, so 333 // can't construct in place and use vector::back 334 Alternative newAlt( new MemberExpr( dwt, expr->clone() ), env, newCost ); 335 renameTypes( newAlt.expr ); 336 addAnonConversions( newAlt ); // add anonymous member interpretations whenever an aggregate value type is seen as a member expression. 337 alternatives.push_back( std::move(newAlt) ); 280 338 } else { 281 339 assert( false ); … … 284 342 } 285 343 286 void AlternativeFinder:: addTupleMembers( TupleType * tupleType, Expression *expr, const Cost &newCost, const TypeEnvironment & env, Expression * member ) {344 void AlternativeFinder::Finder::addTupleMembers( TupleType * tupleType, Expression *expr, const Cost &newCost, const TypeEnvironment & env, Expression * member ) { 287 345 if ( ConstantExpr * constantExpr = dynamic_cast< ConstantExpr * >( member ) ) { 288 346 // get the value of the constant expression as an int, must be between 0 and the length of the tuple type to have meaning 289 // xxx - this should be improved by memoizing the value of constant exprs 290 // during parsing and reusing that information here. 291 std::stringstream ss( constantExpr->get_constant()->get_value() ); 292 int val = 0; 347 auto val = constantExpr->intValue(); 293 348 std::string tmp; 294 if ( ss >> val && ! (ss >> tmp) ) { 295 if ( val >= 0 && (unsigned int)val < tupleType->size() ) { 296 alternatives.push_back( Alternative( new TupleIndexExpr( expr->clone(), val ), env, newCost ) ); 297 } // if 349 if ( val >= 0 && (unsigned long long)val < tupleType->size() ) { 350 alternatives.push_back( Alternative( new TupleIndexExpr( expr->clone(), val ), env, newCost ) ); 298 351 } // if 299 } else if ( NameExpr * nameExpr = dynamic_cast< NameExpr * >( member ) ) {300 // xxx - temporary hack until 0/1 are int constants301 if ( nameExpr->get_name() == "0" || nameExpr->get_name() == "1" ) {302 std::stringstream ss( nameExpr->get_name() );303 int val;304 ss >> val;305 alternatives.push_back( Alternative( new TupleIndexExpr( expr->clone(), val ), env, newCost ) );306 }307 352 } // if 308 353 } 309 354 310 void AlternativeFinder:: visit( ApplicationExpr *applicationExpr ) {355 void AlternativeFinder::Finder::postvisit( ApplicationExpr *applicationExpr ) { 311 356 alternatives.push_back( Alternative( applicationExpr->clone(), env, Cost::zero ) ); 312 357 } … … 386 431 PRINT( std::cerr << "end of formals with varargs function: inc unsafe: " << convCost << std::endl; ; ) 387 432 // convert reference-typed expressions to value-typed expressions 388 referenceToRvalueConversion( *actualExpr );433 referenceToRvalueConversion( *actualExpr, convCost ); 389 434 continue; 390 435 } else { … … 392 437 } 393 438 } 439 if ( DefaultArgExpr * def = dynamic_cast< DefaultArgExpr * >( *actualExpr ) ) { 440 // default arguments should be free - don't include conversion cost. 441 // Unwrap them here because they are not relevant to the rest of the system. 442 *actualExpr = def->expr; 443 ++formal; 444 continue; 445 } 394 446 Type * formalType = (*formal)->get_type(); 395 447 convCost += computeExpressionConversionCost( *actualExpr, formalType, indexer, alt.env ); … … 409 461 /// Adds type variables to the open variable set and marks their assertions 410 462 void makeUnifiableVars( Type *type, OpenVarSet &unifiableVars, AssertionSet &needAssertions ) { 411 for ( Type::ForallList::const_iterator tyvar = type-> get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {463 for ( Type::ForallList::const_iterator tyvar = type->forall.begin(); tyvar != type->forall.end(); ++tyvar ) { 412 464 unifiableVars[ (*tyvar)->get_name() ] = TypeDecl::Data{ *tyvar }; 413 for ( std::list< DeclarationWithType* >::iterator assert = (*tyvar)-> get_assertions().begin(); assert != (*tyvar)->get_assertions().end(); ++assert ) {465 for ( std::list< DeclarationWithType* >::iterator assert = (*tyvar)->assertions.begin(); assert != (*tyvar)->assertions.end(); ++assert ) { 414 466 needAssertions[ *assert ].isUsed = true; 415 467 } … … 418 470 } 419 471 420 // /// Map of declaration uniqueIds (intended to be the assertions in an AssertionSet) to their parents and the number of times they've been included421 //typedef std::unordered_map< UniqueId, std::unordered_map< UniqueId, unsigned > > AssertionParentSet;422 423 472 static const int recursionLimit = /*10*/ 4; ///< Limit to depth of recursion satisfaction 424 //static const unsigned recursionParentLimit = 1; ///< Limit to the number of times an assertion can recursively use itself425 473 426 474 void addToIndexer( AssertionSet &assertSet, SymTab::Indexer &indexer ) { … … 433 481 434 482 template< typename ForwardIterator, typename OutputIterator > 435 void inferRecursive( ForwardIterator begin, ForwardIterator end, const Alternative &newAlt, OpenVarSet &openVars, const SymTab::Indexer &decls, const AssertionSet &newNeed, /*const AssertionParentSet &needParents,*/436 int level, const SymTab::Indexer &indexer, OutputIterator out ) {483 void inferRecursive( ForwardIterator begin, ForwardIterator end, const Alternative &newAlt, OpenVarSet &openVars, const SymTab::Indexer &decls, const AssertionSet &newNeed, int level, const SymTab::Indexer &indexer, OutputIterator out ) { 484 if ( newAlt.cost == Cost::infinity ) return; // don't proceed down this dead end 437 485 if ( begin == end ) { 438 486 if ( newNeed.empty() ) { … … 445 493 return; 446 494 } else if ( level >= recursionLimit ) { 447 throw SemanticError("Too many recursive assertions" );495 SemanticError( newAlt.expr->location, "Too many recursive assertions" ); 448 496 } else { 449 497 AssertionSet newerNeed; … … 452 500 printAssertionSet( newNeed, std::cerr, 8 ); 453 501 ) 454 inferRecursive( newNeed.begin(), newNeed.end(), newAlt, openVars, decls, newerNeed, /*needParents,*/level+1, indexer, out );502 inferRecursive( newNeed.begin(), newNeed.end(), newAlt, openVars, decls, newerNeed, level+1, indexer, out ); 455 503 return; 456 504 } … … 459 507 ForwardIterator cur = begin++; 460 508 if ( ! cur->second.isUsed ) { 461 inferRecursive( begin, end, newAlt, openVars, decls, newNeed, /*needParents,*/level, indexer, out );509 inferRecursive( begin, end, newAlt, openVars, decls, newNeed, level, indexer, out ); 462 510 return; // xxx - should this continue? previously this wasn't here, and it looks like it should be 463 511 } … … 485 533 Type *adjType = candidate->get_type()->clone(); 486 534 adjustExprType( adjType, newEnv, indexer ); 487 adjType->accept( global_renamer);535 renameTyVars( adjType ); 488 536 PRINT( 489 537 std::cerr << "unifying "; … … 512 560 } 513 561 514 //AssertionParentSet newNeedParents( needParents ); 515 // skip repeatingly-self-recursive assertion satisfaction 516 // DOESN'T WORK: grandchild nodes conflict with their cousins 517 //if ( newNeedParents[ curDecl->get_uniqueId() ][ candDecl->get_uniqueId() ]++ > recursionParentLimit ) continue; 518 Expression *varExpr = data.combine(); 562 Expression *varExpr = data.combine( newerAlt.cvtCost ); 519 563 delete varExpr->get_result(); 520 564 varExpr->set_result( adjType->clone() ); … … 533 577 // XXX: this is a memory leak, but adjType can't be deleted because it might contain assertions 534 578 (*inferParameters)[ curDecl->get_uniqueId() ] = ParamEntry( candidate->get_uniqueId(), adjType->clone(), curDecl->get_type()->clone(), varExpr ); 535 inferRecursive( begin, end, newerAlt, newOpenVars, newDecls, newerNeed, /*newNeedParents,*/level, indexer, out );579 inferRecursive( begin, end, newerAlt, newOpenVars, newDecls, newerNeed, level, indexer, out ); 536 580 } else { 537 581 delete adjType; … … 541 585 542 586 template< typename OutputIterator > 543 void AlternativeFinder:: inferParameters( const AssertionSet &need, AssertionSet &have, const Alternative &newAlt, OpenVarSet &openVars, OutputIterator out ) {587 void AlternativeFinder::Finder::inferParameters( const AssertionSet &need, AssertionSet &have, const Alternative &newAlt, OpenVarSet &openVars, OutputIterator out ) { 544 588 // PRINT( 545 589 // std::cerr << "inferParameters: assertions needed are" << std::endl; … … 555 599 addToIndexer( have, decls ); 556 600 AssertionSet newNeed; 557 //AssertionParentSet needParents;558 601 PRINT( 559 602 std::cerr << "env is: " << std::endl; … … 562 605 ) 563 606 564 inferRecursive( need.begin(), need.end(), newAlt, openVars, decls, newNeed, /*needParents,*/0, indexer, out );607 inferRecursive( need.begin(), need.end(), newAlt, openVars, decls, newNeed, 0, indexer, out ); 565 608 // PRINT( 566 609 // std::cerr << "declaration 14 is "; … … 573 616 ConstantExpr* getDefaultValue( Initializer* init ) { 574 617 if ( SingleInit* si = dynamic_cast<SingleInit*>( init ) ) { 575 if ( CastExpr* ce = dynamic_cast<CastExpr*>( si->get_value() ) ) { 576 return dynamic_cast<ConstantExpr*>( ce->get_arg() ); 618 if ( CastExpr* ce = dynamic_cast<CastExpr*>( si->value ) ) { 619 return dynamic_cast<ConstantExpr*>( ce->arg ); 620 } else { 621 return dynamic_cast<ConstantExpr*>( si->value ); 577 622 } 578 623 } … … 596 641 ArgPack() 597 642 : parent(0), expr(), cost(Cost::zero), env(), need(), have(), openVars(), nextArg(0), 598 599 643 tupleStart(0), nextExpl(0), explAlt(0) {} 600 644 … … 648 692 const ExplodedArgs& args, std::vector<ArgPack>& results, std::size_t& genStart, 649 693 const SymTab::Indexer& indexer, unsigned nTuples = 0 ) { 650 if ( TupleType * tupleType = dynamic_cast<TupleType*>( formalType ) ) {694 if ( TupleType * tupleType = dynamic_cast<TupleType*>( formalType ) ) { 651 695 // formalType is a TupleType - group actuals into a TupleExpr 652 696 ++nTuples; 653 697 for ( Type* type : *tupleType ) { 654 698 // xxx - dropping initializer changes behaviour from previous, but seems correct 699 // ^^^ need to handle the case where a tuple has a default argument 655 700 if ( ! instantiateArgument( 656 701 type, nullptr, args, results, genStart, indexer, nTuples ) ) … … 663 708 } 664 709 return true; 665 } else if ( TypeInstType * ttype = Tuples::isTtype( formalType ) ) {710 } else if ( TypeInstType * ttype = Tuples::isTtype( formalType ) ) { 666 711 // formalType is a ttype, consumes all remaining arguments 667 712 // xxx - mixing default arguments with variadic?? … … 706 751 Type* argType; 707 752 708 if ( nTuples > 0 ) { 709 // first iteration, push empty tuple expression 753 if ( nTuples > 0 || ! results[i].expr ) { 754 // first iteration or no expression to clone, 755 // push empty tuple expression 710 756 newResult.parent = i; 711 757 std::list<Expression*> emptyList; … … 834 880 indexer ) ) { 835 881 results.emplace_back( 836 i, cnstExpr, move(env), move(need), move(have),882 i, new DefaultArgExpr( cnstExpr ), move(env), move(need), move(have), 837 883 move(openVars), nextArg, nTuples ); 838 884 } … … 865 911 // consider only first exploded actual 866 912 Expression* expr = expl.exprs.front().get(); 867 Type* actualType = expr-> get_result()->clone();913 Type* actualType = expr->result->clone(); 868 914 869 915 PRINT( … … 892 938 893 939 template<typename OutputIterator> 894 void AlternativeFinder:: validateFunctionAlternative( const Alternative &func, ArgPack& result,940 void AlternativeFinder::Finder::validateFunctionAlternative( const Alternative &func, ArgPack& result, 895 941 const std::vector<ArgPack>& results, OutputIterator out ) { 896 942 ApplicationExpr *appExpr = new ApplicationExpr( func.expr->clone() ); 897 943 // sum cost and accumulate actuals 898 std::list<Expression*>& args = appExpr-> get_args();944 std::list<Expression*>& args = appExpr->args; 899 945 Cost cost = func.cost; 900 946 const ArgPack* pack = &result; … … 915 961 916 962 template<typename OutputIterator> 917 void AlternativeFinder:: makeFunctionAlternatives( const Alternative &func,963 void AlternativeFinder::Finder::makeFunctionAlternatives( const Alternative &func, 918 964 FunctionType *funcType, const ExplodedArgs &args, OutputIterator out ) { 919 965 OpenVarSet funcOpenVars; … … 923 969 // add all type variables as open variables now so that those not used in the parameter 924 970 // list are still considered open. 925 funcEnv.add( funcType-> get_forall());926 927 if ( targetType && ! targetType->isVoid() && ! funcType-> get_returnVals().empty() ) {971 funcEnv.add( funcType->forall ); 972 973 if ( targetType && ! targetType->isVoid() && ! funcType->returnVals.empty() ) { 928 974 // attempt to narrow based on expected target type 929 Type * returnType = funcType-> get_returnVals().front()->get_type();975 Type * returnType = funcType->returnVals.front()->get_type(); 930 976 if ( ! unify( returnType, targetType, funcEnv, funcNeed, funcHave, funcOpenVars, 931 977 indexer ) ) { … … 940 986 std::size_t genStart = 0; 941 987 942 for ( DeclarationWithType* formal : funcType-> get_parameters()) {988 for ( DeclarationWithType* formal : funcType->parameters ) { 943 989 ObjectDecl* obj = strict_dynamic_cast< ObjectDecl* >( formal ); 944 990 if ( ! instantiateArgument( 945 obj-> get_type(), obj->get_init(), args, results, genStart, indexer ) )991 obj->type, obj->init, args, results, genStart, indexer ) ) 946 992 return; 947 993 } … … 1022 1068 } 1023 1069 1024 void AlternativeFinder:: visit( UntypedExpr *untypedExpr ) {1070 void AlternativeFinder::Finder::postvisit( UntypedExpr *untypedExpr ) { 1025 1071 AlternativeFinder funcFinder( indexer, env ); 1026 funcFinder.findWithAdjustment( untypedExpr-> get_function());1072 funcFinder.findWithAdjustment( untypedExpr->function ); 1027 1073 // if there are no function alternatives, then proceeding is a waste of time. 1074 // xxx - findWithAdjustment throws, so this check and others like it shouldn't be necessary. 1028 1075 if ( funcFinder.alternatives.empty() ) return; 1029 1076 1030 1077 std::vector< AlternativeFinder > argAlternatives; 1031 findSubExprs( untypedExpr->begin_args(), untypedExpr->end_args(),1078 altFinder.findSubExprs( untypedExpr->begin_args(), untypedExpr->end_args(), 1032 1079 back_inserter( argAlternatives ) ); 1033 1080 1034 1081 // take care of possible tuple assignments 1035 1082 // if not tuple assignment, assignment is taken care of as a normal function call 1036 Tuples::handleTupleAssignment( *this, untypedExpr, argAlternatives );1083 Tuples::handleTupleAssignment( altFinder, untypedExpr, argAlternatives ); 1037 1084 1038 1085 // find function operators … … 1040 1087 AlternativeFinder funcOpFinder( indexer, env ); 1041 1088 // it's ok if there aren't any defined function ops 1042 funcOpFinder.maybeFind( opExpr );1089 funcOpFinder.maybeFind( opExpr ); 1043 1090 PRINT( 1044 1091 std::cerr << "known function ops:" << std::endl; … … 1053 1100 argExpansions.emplace_back(); 1054 1101 auto& argE = argExpansions.back(); 1055 argE.reserve( arg.alternatives.size() );1102 // argE.reserve( arg.alternatives.size() ); 1056 1103 1057 1104 for ( const Alternative& actual : arg ) { … … 1061 1108 1062 1109 AltList candidates; 1063 SemanticError errors;1110 SemanticErrorException errors; 1064 1111 for ( AltList::iterator func = funcFinder.alternatives.begin(); func != funcFinder.alternatives.end(); ++func ) { 1065 1112 try { … … 1069 1116 ) 1070 1117 // check if the type is pointer to function 1071 if ( PointerType *pointer = dynamic_cast< PointerType* >( func->expr-> get_result()->stripReferences() ) ) {1072 if ( FunctionType *function = dynamic_cast< FunctionType* >( pointer-> get_base()) ) {1118 if ( PointerType *pointer = dynamic_cast< PointerType* >( func->expr->result->stripReferences() ) ) { 1119 if ( FunctionType *function = dynamic_cast< FunctionType* >( pointer->base ) ) { 1073 1120 Alternative newFunc( *func ); 1074 referenceToRvalueConversion( newFunc.expr );1121 referenceToRvalueConversion( newFunc.expr, newFunc.cost ); 1075 1122 makeFunctionAlternatives( newFunc, function, argExpansions, 1076 1123 std::back_inserter( candidates ) ); 1077 1124 } 1078 } else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( func->expr->get_result()->stripReferences() ) ) { // handle ftype (e.g. *? on function pointer) 1079 EqvClass eqvClass; 1080 if ( func->env.lookup( typeInst->get_name(), eqvClass ) && eqvClass.type ) { 1081 if ( FunctionType *function = dynamic_cast< FunctionType* >( eqvClass.type ) ) { 1125 } else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( func->expr->result->stripReferences() ) ) { // handle ftype (e.g. *? on function pointer) 1126 if ( const EqvClass *eqvClass = func->env.lookup( typeInst->name ) ) { 1127 if ( FunctionType *function = dynamic_cast< FunctionType* >( eqvClass->type ) ) { 1082 1128 Alternative newFunc( *func ); 1083 referenceToRvalueConversion( newFunc.expr );1129 referenceToRvalueConversion( newFunc.expr, newFunc.cost ); 1084 1130 makeFunctionAlternatives( newFunc, function, argExpansions, 1085 1131 std::back_inserter( candidates ) ); … … 1087 1133 } // if 1088 1134 } 1089 } catch ( SemanticError &e ) {1135 } catch ( SemanticErrorException &e ) { 1090 1136 errors.append( e ); 1091 1137 } … … 1107 1153 // check if type is a pointer to function 1108 1154 if ( PointerType* pointer = dynamic_cast<PointerType*>( 1109 funcOp->expr-> get_result()->stripReferences() ) ) {1155 funcOp->expr->result->stripReferences() ) ) { 1110 1156 if ( FunctionType* function = 1111 dynamic_cast<FunctionType*>( pointer-> get_base()) ) {1157 dynamic_cast<FunctionType*>( pointer->base ) ) { 1112 1158 Alternative newFunc( *funcOp ); 1113 referenceToRvalueConversion( newFunc.expr );1159 referenceToRvalueConversion( newFunc.expr, newFunc.cost ); 1114 1160 makeFunctionAlternatives( newFunc, function, argExpansions, 1115 1161 std::back_inserter( candidates ) ); 1116 1162 } 1117 1163 } 1118 } catch ( SemanticError &e ) {1164 } catch ( SemanticErrorException &e ) { 1119 1165 errors.append( e ); 1120 1166 } … … 1131 1177 PRINT( 1132 1178 ApplicationExpr *appExpr = strict_dynamic_cast< ApplicationExpr* >( withFunc.expr ); 1133 PointerType *pointer = strict_dynamic_cast< PointerType* >( appExpr-> get_function()->get_result());1134 FunctionType *function = strict_dynamic_cast< FunctionType* >( pointer-> get_base());1135 std::cerr << "Case +++++++++++++ " << appExpr-> get_function()<< std::endl;1179 PointerType *pointer = strict_dynamic_cast< PointerType* >( appExpr->function->result ); 1180 FunctionType *function = strict_dynamic_cast< FunctionType* >( pointer->base ); 1181 std::cerr << "Case +++++++++++++ " << appExpr->function << std::endl; 1136 1182 std::cerr << "formals are:" << std::endl; 1137 printAll( function-> get_parameters(), std::cerr, 8 );1183 printAll( function->parameters, std::cerr, 8 ); 1138 1184 std::cerr << "actuals are:" << std::endl; 1139 printAll( appExpr-> get_args(), std::cerr, 8 );1185 printAll( appExpr->args, std::cerr, 8 ); 1140 1186 std::cerr << "bindings are:" << std::endl; 1141 1187 withFunc.env.print( std::cerr, 8 ); 1188 std::cerr << "cost is: " << withFunc.cost << std::endl; 1142 1189 std::cerr << "cost of conversion is:" << cvtCost << std::endl; 1143 1190 ) … … 1172 1219 // fix this issue in a more robust way. 1173 1220 targetType = nullptr; 1174 visit( untypedExpr );1221 postvisit( untypedExpr ); 1175 1222 } 1176 1223 } … … 1178 1225 bool isLvalue( Expression *expr ) { 1179 1226 // xxx - recurse into tuples? 1180 return expr->result && ( expr-> get_result()->get_lvalue() || dynamic_cast< ReferenceType * >( expr->get_result()) );1181 } 1182 1183 void AlternativeFinder:: visit( AddressExpr *addressExpr ) {1227 return expr->result && ( expr->result->get_lvalue() || dynamic_cast< ReferenceType * >( expr->result ) ); 1228 } 1229 1230 void AlternativeFinder::Finder::postvisit( AddressExpr *addressExpr ) { 1184 1231 AlternativeFinder finder( indexer, env ); 1185 1232 finder.find( addressExpr->get_arg() ); … … 1192 1239 } 1193 1240 1194 void AlternativeFinder:: visit( LabelAddressExpr * expr ) {1241 void AlternativeFinder::Finder::postvisit( LabelAddressExpr * expr ) { 1195 1242 alternatives.push_back( Alternative{ expr->clone(), env, Cost::zero } ); 1196 1243 } 1197 1244 1198 Expression * restructureCast( Expression * argExpr, Type * toType ) {1245 Expression * restructureCast( Expression * argExpr, Type * toType, bool isGenerated ) { 1199 1246 if ( argExpr->get_result()->size() > 1 && ! toType->isVoid() && ! dynamic_cast<ReferenceType *>( toType ) ) { 1200 1247 // Argument expression is a tuple and the target type is not void and not a reference type. … … 1211 1258 // cast each component 1212 1259 TupleIndexExpr * idx = new TupleIndexExpr( argExpr->clone(), i ); 1213 componentExprs.push_back( restructureCast( idx, toType->getComponent( i ) ) );1260 componentExprs.push_back( restructureCast( idx, toType->getComponent( i ), isGenerated ) ); 1214 1261 } 1215 1262 delete argExpr; … … 1219 1266 } else { 1220 1267 // handle normally 1221 return new CastExpr( argExpr, toType->clone() ); 1222 } 1223 } 1224 1225 void AlternativeFinder::visit( CastExpr *castExpr ) { 1268 CastExpr * ret = new CastExpr( argExpr, toType->clone() ); 1269 ret->isGenerated = isGenerated; 1270 return ret; 1271 } 1272 } 1273 1274 void AlternativeFinder::Finder::postvisit( CastExpr *castExpr ) { 1226 1275 Type *& toType = castExpr->get_result(); 1227 1276 assert( toType ); … … 1232 1281 AlternativeFinder finder( indexer, env ); 1233 1282 finder.targetType = toType; 1234 finder.findWithAdjustment( castExpr-> get_arg());1283 finder.findWithAdjustment( castExpr->arg ); 1235 1284 1236 1285 AltList candidates; … … 1239 1288 OpenVarSet openVars; 1240 1289 1290 alt.env.extractOpenVars( openVars ); 1291 1241 1292 // It's possible that a cast can throw away some values in a multiply-valued expression. (An example is a 1242 1293 // cast-to-void, which casts from one value to zero.) Figure out the prefix of the subexpression results 1243 1294 // that are cast directly. The candidate is invalid if it has fewer results than there are types to cast 1244 1295 // to. 1245 int discardedValues = alt.expr-> get_result()->size() - castExpr->get_result()->size();1296 int discardedValues = alt.expr->result->size() - castExpr->result->size(); 1246 1297 if ( discardedValues < 0 ) continue; 1247 1298 // xxx - may need to go into tuple types and extract relevant types and use unifyList. Note that currently, this does not 1248 1299 // allow casting a tuple to an atomic type (e.g. (int)([1, 2, 3])) 1249 1300 // unification run for side-effects 1250 unify( castExpr-> get_result(), alt.expr->get_result(), alt.env, needAssertions,1301 unify( castExpr->result, alt.expr->result, alt.env, needAssertions, 1251 1302 haveAssertions, openVars, indexer ); 1252 Cost thisCost = castCost( alt.expr-> get_result(), castExpr->get_result(), indexer,1303 Cost thisCost = castCost( alt.expr->result, castExpr->result, indexer, 1253 1304 alt.env ); 1254 1305 PRINT( … … 1263 1314 // count one safe conversion for each value that is thrown away 1264 1315 thisCost.incSafe( discardedValues ); 1265 Alternative newAlt( restructureCast( alt.expr->clone(), toType ), alt.env,1316 Alternative newAlt( restructureCast( alt.expr->clone(), toType, castExpr->isGenerated ), alt.env, 1266 1317 alt.cost, thisCost ); 1267 1318 inferParameters( needAssertions, haveAssertions, newAlt, openVars, … … 1278 1329 } 1279 1330 1280 void AlternativeFinder:: visit( VirtualCastExpr * castExpr ) {1331 void AlternativeFinder::Finder::postvisit( VirtualCastExpr * castExpr ) { 1281 1332 assertf( castExpr->get_result(), "Implicate virtual cast targets not yet supported." ); 1282 1333 AlternativeFinder finder( indexer, env ); … … 1290 1341 } 1291 1342 1292 void AlternativeFinder::visit( UntypedMemberExpr *memberExpr ) { 1343 namespace { 1344 /// Gets name from untyped member expression (member must be NameExpr) 1345 const std::string& get_member_name( UntypedMemberExpr *memberExpr ) { 1346 NameExpr * nameExpr = dynamic_cast< NameExpr * >( memberExpr->get_member() ); 1347 assert( nameExpr ); 1348 return nameExpr->get_name(); 1349 } 1350 } 1351 1352 void AlternativeFinder::Finder::postvisit( UntypedMemberExpr *memberExpr ) { 1293 1353 AlternativeFinder funcFinder( indexer, env ); 1294 1354 funcFinder.findWithAdjustment( memberExpr->get_aggregate() ); 1295 1355 for ( AltList::const_iterator agg = funcFinder.alternatives.begin(); agg != funcFinder.alternatives.end(); ++agg ) { 1296 1356 // it's okay for the aggregate expression to have reference type -- cast it to the base type to treat the aggregate as the referenced value 1297 std::unique_ptr<Expression> aggrExpr( agg->expr->clone() ); 1298 Type * aggrType = aggrExpr->get_result(); 1299 if ( dynamic_cast< ReferenceType * >( aggrType ) ) { 1300 aggrType = aggrType->stripReferences(); 1301 aggrExpr.reset( new CastExpr( aggrExpr.release(), aggrType->clone() ) ); 1302 } 1357 Cost cost = agg->cost; 1358 Expression * aggrExpr = agg->expr->clone(); 1359 referenceToRvalueConversion( aggrExpr, cost ); 1360 std::unique_ptr<Expression> guard( aggrExpr ); 1361 1303 1362 // find member of the given type 1304 1363 if ( StructInstType *structInst = dynamic_cast< StructInstType* >( aggrExpr->get_result() ) ) { 1305 addAggMembers( structInst, aggrExpr .get(), agg->cost, agg->env, memberExpr->get_member() );1364 addAggMembers( structInst, aggrExpr, cost, agg->env, get_member_name(memberExpr) ); 1306 1365 } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( aggrExpr->get_result() ) ) { 1307 addAggMembers( unionInst, aggrExpr .get(), agg->cost, agg->env, memberExpr->get_member() );1366 addAggMembers( unionInst, aggrExpr, cost, agg->env, get_member_name(memberExpr) ); 1308 1367 } else if ( TupleType * tupleType = dynamic_cast< TupleType * >( aggrExpr->get_result() ) ) { 1309 addTupleMembers( tupleType, aggrExpr .get(), agg->cost, agg->env, memberExpr->get_member() );1368 addTupleMembers( tupleType, aggrExpr, cost, agg->env, memberExpr->get_member() ); 1310 1369 } // if 1311 1370 } // for 1312 1371 } 1313 1372 1314 void AlternativeFinder:: visit( MemberExpr *memberExpr ) {1373 void AlternativeFinder::Finder::postvisit( MemberExpr *memberExpr ) { 1315 1374 alternatives.push_back( Alternative( memberExpr->clone(), env, Cost::zero ) ); 1316 1375 } 1317 1376 1318 void AlternativeFinder:: visit( NameExpr *nameExpr ) {1377 void AlternativeFinder::Finder::postvisit( NameExpr *nameExpr ) { 1319 1378 std::list< SymTab::Indexer::IdData > declList; 1320 indexer.lookupId( nameExpr-> get_name(), declList );1321 PRINT( std::cerr << "nameExpr is " << nameExpr-> get_name()<< std::endl; )1379 indexer.lookupId( nameExpr->name, declList ); 1380 PRINT( std::cerr << "nameExpr is " << nameExpr->name << std::endl; ) 1322 1381 for ( auto & data : declList ) { 1323 Expression * newExpr = data.combine(); 1324 // xxx - add in extra cost for with-statement exprs? 1325 alternatives.push_back( Alternative( newExpr, env, Cost::zero ) ); 1382 Cost cost = Cost::zero; 1383 Expression * newExpr = data.combine( cost ); 1384 1385 // addAnonAlternatives uses vector::push_back, which invalidates references to existing elements, so 1386 // can't construct in place and use vector::back 1387 Alternative newAlt( newExpr, env, Cost::zero, cost ); 1326 1388 PRINT( 1327 1389 std::cerr << "decl is "; … … 1332 1394 std::cerr << std::endl; 1333 1395 ) 1334 renameTypes( alternatives.back().expr ); 1335 addAnonConversions( alternatives.back() ); // add anonymous member interpretations whenever an aggregate value type is seen as a name expression. 1396 renameTypes( newAlt.expr ); 1397 addAnonConversions( newAlt ); // add anonymous member interpretations whenever an aggregate value type is seen as a name expression. 1398 alternatives.push_back( std::move(newAlt) ); 1336 1399 } // for 1337 1400 } 1338 1401 1339 void AlternativeFinder:: visit( VariableExpr *variableExpr ) {1402 void AlternativeFinder::Finder::postvisit( VariableExpr *variableExpr ) { 1340 1403 // not sufficient to clone here, because variable's type may have changed 1341 1404 // since the VariableExpr was originally created. 1342 alternatives.push_back( Alternative( new VariableExpr( variableExpr-> get_var()), env, Cost::zero ) );1343 } 1344 1345 void AlternativeFinder:: visit( ConstantExpr *constantExpr ) {1405 alternatives.push_back( Alternative( new VariableExpr( variableExpr->var ), env, Cost::zero ) ); 1406 } 1407 1408 void AlternativeFinder::Finder::postvisit( ConstantExpr *constantExpr ) { 1346 1409 alternatives.push_back( Alternative( constantExpr->clone(), env, Cost::zero ) ); 1347 1410 } 1348 1411 1349 void AlternativeFinder:: visit( SizeofExpr *sizeofExpr ) {1412 void AlternativeFinder::Finder::postvisit( SizeofExpr *sizeofExpr ) { 1350 1413 if ( sizeofExpr->get_isType() ) { 1351 1414 Type * newType = sizeofExpr->get_type()->clone(); … … 1359 1422 findMinCost( finder.alternatives.begin(), finder.alternatives.end(), back_inserter( winners ) ); 1360 1423 if ( winners.size() != 1 ) { 1361 throw SemanticError( "Ambiguous expression in sizeof operand: ", sizeofExpr->get_expr());1424 SemanticError( sizeofExpr->get_expr(), "Ambiguous expression in sizeof operand: " ); 1362 1425 } // if 1363 1426 // return the lowest cost alternative for the argument 1364 1427 Alternative &choice = winners.front(); 1365 referenceToRvalueConversion( choice.expr );1428 referenceToRvalueConversion( choice.expr, choice.cost ); 1366 1429 alternatives.push_back( Alternative( new SizeofExpr( choice.expr->clone() ), choice.env, Cost::zero ) ); 1367 1430 } // if 1368 1431 } 1369 1432 1370 void AlternativeFinder:: visit( AlignofExpr *alignofExpr ) {1433 void AlternativeFinder::Finder::postvisit( AlignofExpr *alignofExpr ) { 1371 1434 if ( alignofExpr->get_isType() ) { 1372 1435 Type * newType = alignofExpr->get_type()->clone(); … … 1380 1443 findMinCost( finder.alternatives.begin(), finder.alternatives.end(), back_inserter( winners ) ); 1381 1444 if ( winners.size() != 1 ) { 1382 throw SemanticError( "Ambiguous expression in alignof operand: ", alignofExpr->get_expr());1445 SemanticError( alignofExpr->get_expr(), "Ambiguous expression in alignof operand: " ); 1383 1446 } // if 1384 1447 // return the lowest cost alternative for the argument 1385 1448 Alternative &choice = winners.front(); 1386 referenceToRvalueConversion( choice.expr );1449 referenceToRvalueConversion( choice.expr, choice.cost ); 1387 1450 alternatives.push_back( Alternative( new AlignofExpr( choice.expr->clone() ), choice.env, Cost::zero ) ); 1388 1451 } // if … … 1390 1453 1391 1454 template< typename StructOrUnionType > 1392 void AlternativeFinder:: addOffsetof( StructOrUnionType *aggInst, const std::string &name ) {1455 void AlternativeFinder::Finder::addOffsetof( StructOrUnionType *aggInst, const std::string &name ) { 1393 1456 std::list< Declaration* > members; 1394 1457 aggInst->lookup( name, members ); … … 1403 1466 } 1404 1467 1405 void AlternativeFinder:: visit( UntypedOffsetofExpr *offsetofExpr ) {1468 void AlternativeFinder::Finder::postvisit( UntypedOffsetofExpr *offsetofExpr ) { 1406 1469 AlternativeFinder funcFinder( indexer, env ); 1407 1470 // xxx - resolveTypeof? 1408 1471 if ( StructInstType *structInst = dynamic_cast< StructInstType* >( offsetofExpr->get_type() ) ) { 1409 addOffsetof( structInst, offsetofExpr-> get_member());1472 addOffsetof( structInst, offsetofExpr->member ); 1410 1473 } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( offsetofExpr->get_type() ) ) { 1411 addOffsetof( unionInst, offsetofExpr-> get_member());1412 } 1413 } 1414 1415 void AlternativeFinder:: visit( OffsetofExpr *offsetofExpr ) {1474 addOffsetof( unionInst, offsetofExpr->member ); 1475 } 1476 } 1477 1478 void AlternativeFinder::Finder::postvisit( OffsetofExpr *offsetofExpr ) { 1416 1479 alternatives.push_back( Alternative( offsetofExpr->clone(), env, Cost::zero ) ); 1417 1480 } 1418 1481 1419 void AlternativeFinder:: visit( OffsetPackExpr *offsetPackExpr ) {1482 void AlternativeFinder::Finder::postvisit( OffsetPackExpr *offsetPackExpr ) { 1420 1483 alternatives.push_back( Alternative( offsetPackExpr->clone(), env, Cost::zero ) ); 1421 1484 } … … 1436 1499 AltList & alternatives = finder.get_alternatives(); 1437 1500 if ( typesCompatibleIgnoreQualifiers( argType, function->get_parameters().front()->get_type(), indexer, env ) ) { 1438 alternatives.push_back( Alternative( new AttrExpr( data.combine(), argType->clone() ), env, Cost::zero ) ); 1501 Cost cost = Cost::zero; 1502 Expression * newExpr = data.combine( cost ); 1503 alternatives.push_back( Alternative( new AttrExpr( newExpr, argType->clone() ), env, Cost::zero, cost ) ); 1439 1504 for ( DeclarationWithType * retVal : function->returnVals ) { 1440 1505 alternatives.back().expr->result = retVal->get_type()->clone(); … … 1444 1509 } 1445 1510 1446 void AlternativeFinder:: visit( AttrExpr *attrExpr ) {1511 void AlternativeFinder::Finder::postvisit( AttrExpr *attrExpr ) { 1447 1512 // assume no 'pointer-to-attribute' 1448 1513 NameExpr *nameExpr = dynamic_cast< NameExpr* >( attrExpr->get_attr() ); … … 1458 1523 if ( function->get_parameters().size() == 1 ) { 1459 1524 if ( attrExpr->get_isType() ) { 1460 resolveAttr( data, function, attrExpr->get_type(), env, *this);1525 resolveAttr( data, function, attrExpr->get_type(), env, altFinder); 1461 1526 } else { 1462 1527 AlternativeFinder finder( indexer, env ); … … 1464 1529 for ( AltList::iterator choice = finder.alternatives.begin(); choice != finder.alternatives.end(); ++choice ) { 1465 1530 if ( choice->expr->get_result()->size() == 1 ) { 1466 resolveAttr(data, function, choice->expr->get_result(), choice->env, *this);1531 resolveAttr(data, function, choice->expr->get_result(), choice->env, altFinder ); 1467 1532 } // fi 1468 1533 } // for … … 1473 1538 } else { 1474 1539 for ( auto & data : attrList ) { 1475 alternatives.push_back( Alternative( data.combine(), env, Cost::zero ) ); 1540 Cost cost = Cost::zero; 1541 Expression * newExpr = data.combine( cost ); 1542 alternatives.push_back( Alternative( newExpr, env, Cost::zero, cost ) ); 1476 1543 renameTypes( alternatives.back().expr ); 1477 1544 } // for … … 1479 1546 } 1480 1547 1481 void AlternativeFinder:: visit( LogicalExpr *logicalExpr ) {1548 void AlternativeFinder::Finder::postvisit( LogicalExpr *logicalExpr ) { 1482 1549 AlternativeFinder firstFinder( indexer, env ); 1483 1550 firstFinder.findWithAdjustment( logicalExpr->get_arg1() ); 1484 for ( AltList::const_iterator first = firstFinder.alternatives.begin(); first != firstFinder.alternatives.end(); ++first ) { 1485 AlternativeFinder secondFinder( indexer, first->env ); 1486 secondFinder.findWithAdjustment( logicalExpr->get_arg2() ); 1487 for ( AltList::const_iterator second = secondFinder.alternatives.begin(); second != secondFinder.alternatives.end(); ++second ) { 1488 LogicalExpr *newExpr = new LogicalExpr( first->expr->clone(), second->expr->clone(), logicalExpr->get_isAnd() ); 1489 alternatives.push_back( Alternative( newExpr, second->env, first->cost + second->cost ) ); 1490 } 1491 } 1492 } 1493 1494 void AlternativeFinder::visit( ConditionalExpr *conditionalExpr ) { 1551 if ( firstFinder.alternatives.empty() ) return; 1552 AlternativeFinder secondFinder( indexer, env ); 1553 secondFinder.findWithAdjustment( logicalExpr->get_arg2() ); 1554 if ( secondFinder.alternatives.empty() ) return; 1555 for ( const Alternative & first : firstFinder.alternatives ) { 1556 for ( const Alternative & second : secondFinder.alternatives ) { 1557 TypeEnvironment compositeEnv; 1558 compositeEnv.simpleCombine( first.env ); 1559 compositeEnv.simpleCombine( second.env ); 1560 1561 LogicalExpr *newExpr = new LogicalExpr( first.expr->clone(), second.expr->clone(), logicalExpr->get_isAnd() ); 1562 alternatives.push_back( Alternative( newExpr, compositeEnv, first.cost + second.cost ) ); 1563 } 1564 } 1565 } 1566 1567 void AlternativeFinder::Finder::postvisit( ConditionalExpr *conditionalExpr ) { 1495 1568 // find alternatives for condition 1496 1569 AlternativeFinder firstFinder( indexer, env ); 1497 firstFinder.findWithAdjustment( conditionalExpr->get_arg1() ); 1498 for ( AltList::const_iterator first = firstFinder.alternatives.begin(); first != firstFinder.alternatives.end(); ++first ) { 1499 // find alternatives for true expression 1500 AlternativeFinder secondFinder( indexer, first->env ); 1501 secondFinder.findWithAdjustment( conditionalExpr->get_arg2() ); 1502 for ( AltList::const_iterator second = secondFinder.alternatives.begin(); second != secondFinder.alternatives.end(); ++second ) { 1503 // find alterantives for false expression 1504 AlternativeFinder thirdFinder( indexer, second->env ); 1505 thirdFinder.findWithAdjustment( conditionalExpr->get_arg3() ); 1506 for ( AltList::const_iterator third = thirdFinder.alternatives.begin(); third != thirdFinder.alternatives.end(); ++third ) { 1570 firstFinder.findWithAdjustment( conditionalExpr->arg1 ); 1571 if ( firstFinder.alternatives.empty() ) return; 1572 // find alternatives for true expression 1573 AlternativeFinder secondFinder( indexer, env ); 1574 secondFinder.findWithAdjustment( conditionalExpr->arg2 ); 1575 if ( secondFinder.alternatives.empty() ) return; 1576 // find alterantives for false expression 1577 AlternativeFinder thirdFinder( indexer, env ); 1578 thirdFinder.findWithAdjustment( conditionalExpr->arg3 ); 1579 if ( thirdFinder.alternatives.empty() ) return; 1580 for ( const Alternative & first : firstFinder.alternatives ) { 1581 for ( const Alternative & second : secondFinder.alternatives ) { 1582 for ( const Alternative & third : thirdFinder.alternatives ) { 1583 TypeEnvironment compositeEnv; 1584 compositeEnv.simpleCombine( first.env ); 1585 compositeEnv.simpleCombine( second.env ); 1586 compositeEnv.simpleCombine( third.env ); 1587 1507 1588 // unify true and false types, then infer parameters to produce new alternatives 1508 1589 OpenVarSet openVars; 1509 1590 AssertionSet needAssertions, haveAssertions; 1510 Alternative newAlt( 0, third->env, first->cost + second->cost + third->cost );1591 Alternative newAlt( 0, compositeEnv, first.cost + second.cost + third.cost ); 1511 1592 Type* commonType = nullptr; 1512 if ( unify( second ->expr->get_result(), third->expr->get_result(), newAlt.env, needAssertions, haveAssertions, openVars, indexer, commonType ) ) {1513 ConditionalExpr *newExpr = new ConditionalExpr( first ->expr->clone(), second->expr->clone(), third->expr->clone() );1514 newExpr-> set_result( commonType ? commonType : second->expr->get_result()->clone());1593 if ( unify( second.expr->result, third.expr->result, newAlt.env, needAssertions, haveAssertions, openVars, indexer, commonType ) ) { 1594 ConditionalExpr *newExpr = new ConditionalExpr( first.expr->clone(), second.expr->clone(), third.expr->clone() ); 1595 newExpr->result = commonType ? commonType : second.expr->result->clone(); 1515 1596 // convert both options to the conditional result type 1516 1597 newAlt.cost += computeExpressionConversionCost( newExpr->arg2, newExpr->result, indexer, newAlt.env ); … … 1524 1605 } 1525 1606 1526 void AlternativeFinder:: visit( CommaExpr *commaExpr ) {1607 void AlternativeFinder::Finder::postvisit( CommaExpr *commaExpr ) { 1527 1608 TypeEnvironment newEnv( env ); 1528 1609 Expression *newFirstArg = resolveInVoidContext( commaExpr->get_arg1(), indexer, newEnv ); 1529 1610 AlternativeFinder secondFinder( indexer, newEnv ); 1530 1611 secondFinder.findWithAdjustment( commaExpr->get_arg2() ); 1531 for ( AltList::const_iterator alt = secondFinder.alternatives.begin(); alt != secondFinder.alternatives.end(); ++alt) {1532 alternatives.push_back( Alternative( new CommaExpr( newFirstArg->clone(), alt ->expr->clone() ), alt->env, alt->cost ) );1612 for ( const Alternative & alt : secondFinder.alternatives ) { 1613 alternatives.push_back( Alternative( new CommaExpr( newFirstArg->clone(), alt.expr->clone() ), alt.env, alt.cost ) ); 1533 1614 } // for 1534 1615 delete newFirstArg; 1535 1616 } 1536 1617 1537 void AlternativeFinder:: visit( RangeExpr * rangeExpr ) {1618 void AlternativeFinder::Finder::postvisit( RangeExpr * rangeExpr ) { 1538 1619 // resolve low and high, accept alternatives whose low and high types unify 1539 1620 AlternativeFinder firstFinder( indexer, env ); 1540 firstFinder.findWithAdjustment( rangeExpr->get_low() ); 1541 for ( AltList::const_iterator first = firstFinder.alternatives.begin(); first != firstFinder.alternatives.end(); ++first ) { 1542 AlternativeFinder secondFinder( indexer, first->env ); 1543 secondFinder.findWithAdjustment( rangeExpr->get_high() ); 1544 for ( AltList::const_iterator second = secondFinder.alternatives.begin(); second != secondFinder.alternatives.end(); ++second ) { 1621 firstFinder.findWithAdjustment( rangeExpr->low ); 1622 if ( firstFinder.alternatives.empty() ) return; 1623 AlternativeFinder secondFinder( indexer, env ); 1624 secondFinder.findWithAdjustment( rangeExpr->high ); 1625 if ( secondFinder.alternatives.empty() ) return; 1626 for ( const Alternative & first : firstFinder.alternatives ) { 1627 for ( const Alternative & second : secondFinder.alternatives ) { 1628 TypeEnvironment compositeEnv; 1629 compositeEnv.simpleCombine( first.env ); 1630 compositeEnv.simpleCombine( second.env ); 1545 1631 OpenVarSet openVars; 1546 1632 AssertionSet needAssertions, haveAssertions; 1547 Alternative newAlt( 0, second->env, first->cost + second->cost );1633 Alternative newAlt( 0, compositeEnv, first.cost + second.cost ); 1548 1634 Type* commonType = nullptr; 1549 if ( unify( first ->expr->get_result(), second->expr->get_result(), newAlt.env, needAssertions, haveAssertions, openVars, indexer, commonType ) ) {1550 RangeExpr * newExpr = new RangeExpr( first->expr->clone(), second->expr->clone() );1551 newExpr-> set_result( commonType ? commonType : first->expr->get_result()->clone());1635 if ( unify( first.expr->result, second.expr->result, newAlt.env, needAssertions, haveAssertions, openVars, indexer, commonType ) ) { 1636 RangeExpr * newExpr = new RangeExpr( first.expr->clone(), second.expr->clone() ); 1637 newExpr->result = commonType ? commonType : first.expr->result->clone(); 1552 1638 newAlt.expr = newExpr; 1553 1639 inferParameters( needAssertions, haveAssertions, newAlt, openVars, back_inserter( alternatives ) ); … … 1557 1643 } 1558 1644 1559 void AlternativeFinder:: visit( UntypedTupleExpr *tupleExpr ) {1645 void AlternativeFinder::Finder::postvisit( UntypedTupleExpr *tupleExpr ) { 1560 1646 std::vector< AlternativeFinder > subExprAlternatives; 1561 findSubExprs( tupleExpr->get_exprs().begin(), tupleExpr->get_exprs().end(),1647 altFinder.findSubExprs( tupleExpr->get_exprs().begin(), tupleExpr->get_exprs().end(), 1562 1648 back_inserter( subExprAlternatives ) ); 1563 1649 std::vector< AltList > possibilities; … … 1575 1661 } 1576 1662 1577 void AlternativeFinder:: visit( TupleExpr *tupleExpr ) {1663 void AlternativeFinder::Finder::postvisit( TupleExpr *tupleExpr ) { 1578 1664 alternatives.push_back( Alternative( tupleExpr->clone(), env, Cost::zero ) ); 1579 1665 } 1580 1666 1581 void AlternativeFinder:: visit( ImplicitCopyCtorExpr * impCpCtorExpr ) {1667 void AlternativeFinder::Finder::postvisit( ImplicitCopyCtorExpr * impCpCtorExpr ) { 1582 1668 alternatives.push_back( Alternative( impCpCtorExpr->clone(), env, Cost::zero ) ); 1583 1669 } 1584 1670 1585 void AlternativeFinder:: visit( ConstructorExpr * ctorExpr ) {1671 void AlternativeFinder::Finder::postvisit( ConstructorExpr * ctorExpr ) { 1586 1672 AlternativeFinder finder( indexer, env ); 1587 1673 // don't prune here, since it's guaranteed all alternatives will have the same type … … 1593 1679 } 1594 1680 1595 void AlternativeFinder:: visit( TupleIndexExpr *tupleExpr ) {1681 void AlternativeFinder::Finder::postvisit( TupleIndexExpr *tupleExpr ) { 1596 1682 alternatives.push_back( Alternative( tupleExpr->clone(), env, Cost::zero ) ); 1597 1683 } 1598 1684 1599 void AlternativeFinder:: visit( TupleAssignExpr *tupleAssignExpr ) {1685 void AlternativeFinder::Finder::postvisit( TupleAssignExpr *tupleAssignExpr ) { 1600 1686 alternatives.push_back( Alternative( tupleAssignExpr->clone(), env, Cost::zero ) ); 1601 1687 } 1602 1688 1603 void AlternativeFinder:: visit( UniqueExpr *unqExpr ) {1689 void AlternativeFinder::Finder::postvisit( UniqueExpr *unqExpr ) { 1604 1690 AlternativeFinder finder( indexer, env ); 1605 1691 finder.findWithAdjustment( unqExpr->get_expr() ); … … 1611 1697 } 1612 1698 1613 void AlternativeFinder:: visit( StmtExpr *stmtExpr ) {1699 void AlternativeFinder::Finder::postvisit( StmtExpr *stmtExpr ) { 1614 1700 StmtExpr * newStmtExpr = stmtExpr->clone(); 1615 1701 ResolvExpr::resolveStmtExpr( newStmtExpr, indexer ); … … 1618 1704 } 1619 1705 1620 void AlternativeFinder:: visit( UntypedInitExpr *initExpr ) {1706 void AlternativeFinder::Finder::postvisit( UntypedInitExpr *initExpr ) { 1621 1707 // handle each option like a cast 1622 1708 AltList candidates; 1623 PRINT( std::cerr << "untyped init expr: " << initExpr << std::endl; ) 1709 PRINT( 1710 std::cerr << "untyped init expr: " << initExpr << std::endl; 1711 ) 1624 1712 // O(N^2) checks of d-types with e-types 1625 1713 for ( InitAlternative & initAlt : initExpr->get_initAlts() ) { … … 1632 1720 AlternativeFinder finder( indexer, env ); 1633 1721 finder.targetType = toType; 1634 finder.findWithAdjustment( initExpr-> get_expr());1722 finder.findWithAdjustment( initExpr->expr ); 1635 1723 for ( Alternative & alt : finder.get_alternatives() ) { 1636 1724 TypeEnvironment newEnv( alt.env ); 1637 1725 AssertionSet needAssertions, haveAssertions; 1638 1726 OpenVarSet openVars; // find things in env that don't have a "representative type" and claim those are open vars? 1639 PRINT( std::cerr << " @ " << toType << " " << initAlt.designation << std::endl; ) 1727 PRINT( 1728 std::cerr << " @ " << toType << " " << initAlt.designation << std::endl; 1729 ) 1640 1730 // It's possible that a cast can throw away some values in a multiply-valued expression. (An example is a 1641 1731 // cast-to-void, which casts from one value to zero.) Figure out the prefix of the subexpression results 1642 1732 // that are cast directly. The candidate is invalid if it has fewer results than there are types to cast 1643 1733 // to. 1644 int discardedValues = alt.expr-> get_result()->size() - toType->size();1734 int discardedValues = alt.expr->result->size() - toType->size(); 1645 1735 if ( discardedValues < 0 ) continue; 1646 1736 // xxx - may need to go into tuple types and extract relevant types and use unifyList. Note that currently, this does not 1647 1737 // allow casting a tuple to an atomic type (e.g. (int)([1, 2, 3])) 1648 1738 // unification run for side-effects 1649 unify( toType, alt.expr-> get_result(), newEnv, needAssertions, haveAssertions, openVars, indexer ); // xxx - do some inspecting on this line... why isn't result bound to initAlt.type??1650 1651 Cost thisCost = castCost( alt.expr-> get_result(), toType, indexer, newEnv );1739 unify( toType, alt.expr->result, newEnv, needAssertions, haveAssertions, openVars, indexer ); // xxx - do some inspecting on this line... why isn't result bound to initAlt.type?? 1740 1741 Cost thisCost = castCost( alt.expr->result, toType, indexer, newEnv ); 1652 1742 if ( thisCost != Cost::infinity ) { 1653 1743 // count one safe conversion for each value that is thrown away 1654 1744 thisCost.incSafe( discardedValues ); 1655 Alternative newAlt( new InitExpr( restructureCast( alt.expr->clone(), toType ), initAlt.designation->clone() ), newEnv, alt.cost, thisCost );1745 Alternative newAlt( new InitExpr( restructureCast( alt.expr->clone(), toType, true ), initAlt.designation->clone() ), newEnv, alt.cost, thisCost ); 1656 1746 inferParameters( needAssertions, haveAssertions, newAlt, openVars, back_inserter( candidates ) ); 1657 1747 } … … 1666 1756 findMinCost( minArgCost.begin(), minArgCost.end(), std::back_inserter( alternatives ) ); 1667 1757 } 1758 1759 void AlternativeFinder::Finder::postvisit( InitExpr * ) { 1760 assertf( false, "AlternativeFinder should never see a resolved InitExpr." ); 1761 } 1762 1763 void AlternativeFinder::Finder::postvisit( DeletedExpr * ) { 1764 assertf( false, "AlternativeFinder should never see a DeletedExpr." ); 1765 } 1766 1767 void AlternativeFinder::Finder::postvisit( GenericExpr * ) { 1768 assertf( false, "_Generic is not yet supported." ); 1769 } 1668 1770 } // namespace ResolvExpr 1669 1771 -
src/ResolvExpr/AlternativeFinder.h
rf9feab8 r90152a4 38 38 using ExplodedArgs = std::vector< std::vector< ExplodedActual > >; 39 39 40 class AlternativeFinder : public Visitor{40 class AlternativeFinder { 41 41 public: 42 42 AlternativeFinder( const SymTab::Indexer &indexer, const TypeEnvironment &env ); … … 94 94 void findSubExprs( InputIterator begin, InputIterator end, OutputIterator out ); 95 95 private: 96 virtual void visit( ApplicationExpr *applicationExpr ); 97 virtual void visit( UntypedExpr *untypedExpr ); 98 virtual void visit( AddressExpr *addressExpr ); 99 virtual void visit( LabelAddressExpr *labelExpr ); 100 virtual void visit( CastExpr *castExpr ); 101 virtual void visit( VirtualCastExpr *castExpr ); 102 virtual void visit( UntypedMemberExpr *memberExpr ); 103 virtual void visit( MemberExpr *memberExpr ); 104 virtual void visit( NameExpr *variableExpr ); 105 virtual void visit( VariableExpr *variableExpr ); 106 virtual void visit( ConstantExpr *constantExpr ); 107 virtual void visit( SizeofExpr *sizeofExpr ); 108 virtual void visit( AlignofExpr *alignofExpr ); 109 virtual void visit( UntypedOffsetofExpr *offsetofExpr ); 110 virtual void visit( OffsetofExpr *offsetofExpr ); 111 virtual void visit( OffsetPackExpr *offsetPackExpr ); 112 virtual void visit( AttrExpr *attrExpr ); 113 virtual void visit( LogicalExpr *logicalExpr ); 114 virtual void visit( ConditionalExpr *conditionalExpr ); 115 virtual void visit( CommaExpr *commaExpr ); 116 virtual void visit( ImplicitCopyCtorExpr * impCpCtorExpr ); 117 virtual void visit( ConstructorExpr * ctorExpr ); 118 virtual void visit( RangeExpr * rangeExpr ); 119 virtual void visit( UntypedTupleExpr *tupleExpr ); 120 virtual void visit( TupleExpr *tupleExpr ); 121 virtual void visit( TupleIndexExpr *tupleExpr ); 122 virtual void visit( TupleAssignExpr *tupleExpr ); 123 virtual void visit( UniqueExpr *unqExpr ); 124 virtual void visit( StmtExpr *stmtExpr ); 125 virtual void visit( UntypedInitExpr *initExpr ); 126 127 /// Adds alternatives for anonymous members 128 void addAnonConversions( const Alternative & alt ); 129 /// Adds alternatives for member expressions, given the aggregate, conversion cost for that aggregate, and name of the member 130 template< typename StructOrUnionType > void addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const TypeEnvironment & env, Expression * member ); 131 /// Adds alternatives for member expressions where the left side has tuple type 132 void addTupleMembers( TupleType * tupleType, Expression *expr, const Cost &newCost, const TypeEnvironment & env, Expression * member ); 133 /// Adds alternatives for offsetof expressions, given the base type and name of the member 134 template< typename StructOrUnionType > void addOffsetof( StructOrUnionType *aggInst, const std::string &name ); 135 /// Takes a final result and checks if its assertions can be satisfied 136 template<typename OutputIterator> 137 void validateFunctionAlternative( const Alternative &func, ArgPack& result, const std::vector<ArgPack>& results, OutputIterator out ); 138 /// Finds matching alternatives for a function, given a set of arguments 139 template<typename OutputIterator> 140 void makeFunctionAlternatives( const Alternative &func, FunctionType *funcType, const ExplodedArgs& args, OutputIterator out ); 141 /// Checks if assertion parameters match for a new alternative 142 template< typename OutputIterator > 143 void inferParameters( const AssertionSet &need, AssertionSet &have, const Alternative &newAlt, OpenVarSet &openVars, OutputIterator out ); 144 96 struct Finder; 145 97 const SymTab::Indexer &indexer; 146 98 AltList alternatives; … … 174 126 void printAlts( const AltList &list, std::ostream &os, unsigned int indentAmt = 0 ); 175 127 128 /// Adds type variables to the open variable set and marks their assertions 129 void makeUnifiableVars( Type *type, OpenVarSet &unifiableVars, AssertionSet &needAssertions ); 130 176 131 template< typename InputIterator > 177 132 void simpleCombineEnvironments( InputIterator begin, InputIterator end, TypeEnvironment &result ) { -
src/ResolvExpr/CastCost.cc
rf9feab8 r90152a4 31 31 32 32 namespace ResolvExpr { 33 classCastCost : public ConversionCost {33 struct CastCost : public ConversionCost { 34 34 public: 35 CastCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );35 CastCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction costFunc ); 36 36 37 virtual void visit( BasicType *basicType ); 38 virtual void visit( PointerType *pointerType ); 37 using ConversionCost::previsit; 38 using ConversionCost::postvisit; 39 void postvisit( BasicType * basicType ); 40 void postvisit( PointerType * pointerType ); 39 41 }; 40 42 41 43 Cost castCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) { 42 44 if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) { 43 EqvClass eqvClass; 44 NamedTypeDecl *namedType; 45 if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) { 46 if ( eqvClass.type ) { 47 return castCost( src, eqvClass.type, indexer, env ); 45 if ( const EqvClass* eqvClass = env.lookup( destAsTypeInst->get_name() ) ) { 46 if ( eqvClass->type ) { 47 return castCost( src, eqvClass->type, indexer, env ); 48 48 } else { 49 49 return Cost::infinity; 50 50 } 51 } else if ( ( namedType = indexer.lookupType( destAsTypeInst->get_name()) ) ) {51 } else if ( NamedTypeDecl *namedType = indexer.lookupType( destAsTypeInst->get_name() ) ) { 52 52 // all typedefs should be gone by this point 53 53 TypeDecl *type = strict_dynamic_cast< TypeDecl* >( namedType ); 54 if ( type-> get_base()) {55 return castCost( src, type-> get_base(), indexer, env ) + Cost::safe;54 if ( type->base ) { 55 return castCost( src, type->base, indexer, env ) + Cost::safe; 56 56 } // if 57 57 } // if … … 74 74 } else if ( ReferenceType * refType = dynamic_cast< ReferenceType * > ( dest ) ) { 75 75 PRINT( std::cerr << "conversionCost: dest is reference" << std::endl; ) 76 return convertToReferenceCost( src, refType, indexer, env, [](Type * t1, Type * t2, const TypeEnvironment & env, const SymTab::Indexer & indexer) {76 return convertToReferenceCost( src, refType, indexer, env, [](Type * t1, Type * t2, const SymTab::Indexer & indexer, const TypeEnvironment & env ) { 77 77 return ptrsCastable( t1, t2, env, indexer ); 78 78 }); 79 79 } else { 80 CastCost converter( dest, indexer, env);80 PassVisitor<CastCost> converter( dest, indexer, env, castCost ); 81 81 src->accept( converter ); 82 if ( converter. get_cost() == Cost::infinity ) {82 if ( converter.pass.get_cost() == Cost::infinity ) { 83 83 return Cost::infinity; 84 84 } else { 85 85 // xxx - why are we adding cost 0 here? 86 return converter. get_cost() + Cost::zero;86 return converter.pass.get_cost() + Cost::zero; 87 87 } // if 88 88 } // if 89 89 } 90 90 91 CastCost::CastCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env )92 : ConversionCost( dest, indexer, env ) {91 CastCost::CastCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction costFunc ) 92 : ConversionCost( dest, indexer, env, costFunc ) { 93 93 } 94 94 95 void CastCost:: visit( BasicType *basicType ) {95 void CastCost::postvisit( BasicType *basicType ) { 96 96 PointerType *destAsPointer = dynamic_cast< PointerType* >( dest ); 97 97 if ( destAsPointer && basicType->isInteger() ) { … … 103 103 } 104 104 105 void CastCost:: visit( PointerType *pointerType ) {105 void CastCost::postvisit( PointerType *pointerType ) { 106 106 if ( PointerType *destAsPtr = dynamic_cast< PointerType* >( dest ) ) { 107 if ( pointerType->get_qualifiers() <= destAsPtr->get_qualifiers() && typesCompatibleIgnoreQualifiers( pointerType-> get_base(), destAsPtr->get_base(), indexer, env ) ) {107 if ( pointerType->get_qualifiers() <= destAsPtr->get_qualifiers() && typesCompatibleIgnoreQualifiers( pointerType->base, destAsPtr->base, indexer, env ) ) { 108 108 cost = Cost::safe; 109 109 } else { 110 110 TypeEnvironment newEnv( env ); 111 newEnv.add( pointerType-> get_forall());112 newEnv.add( pointerType-> get_base()->get_forall());113 int castResult = ptrsCastable( pointerType-> get_base(), destAsPtr->get_base(), newEnv, indexer );111 newEnv.add( pointerType->forall ); 112 newEnv.add( pointerType->base->forall ); 113 int castResult = ptrsCastable( pointerType->base, destAsPtr->base, newEnv, indexer ); 114 114 if ( castResult > 0 ) { 115 115 cost = Cost::safe; -
src/ResolvExpr/CommonType.cc
rf9feab8 r90152a4 18 18 #include <utility> // for pair 19 19 20 #include "Common/PassVisitor.h" 20 21 #include "ResolvExpr/TypeEnvironment.h" // for OpenVarSet, AssertionSet 21 22 #include "SymTab/Indexer.h" // for Indexer … … 23 24 #include "SynTree/Type.h" // for BasicType, BasicType::Kind::... 24 25 #include "SynTree/Visitor.h" // for Visitor 25 #include "Unify.h" // for unifyExact, bindVar,WidenMode26 #include "Unify.h" // for unifyExact, WidenMode 26 27 #include "typeops.h" // for isFtype 27 28 28 29 // #define DEBUG 30 #ifdef DEBUG 31 #define PRINT(x) x 32 #else 33 #define PRINT(x) 34 #endif 29 35 30 36 namespace ResolvExpr { 31 class CommonType : public Visitor { 32 public: 37 struct CommonType : public WithShortCircuiting { 33 38 CommonType( Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars ); 34 39 Type *get_result() const { return result; } 40 41 void previsit( BaseSyntaxNode * ) { visit_children = false; } 42 43 void postvisit( VoidType * voidType ); 44 void postvisit( BasicType * basicType ); 45 void postvisit( PointerType * pointerType ); 46 void postvisit( ArrayType * arrayType ); 47 void postvisit( ReferenceType * refType ); 48 void postvisit( FunctionType * functionType ); 49 void postvisit( StructInstType * aggregateUseType ); 50 void postvisit( UnionInstType * aggregateUseType ); 51 void postvisit( EnumInstType * aggregateUseType ); 52 void postvisit( TraitInstType * aggregateUseType ); 53 void postvisit( TypeInstType * aggregateUseType ); 54 void postvisit( TupleType * tupleType ); 55 void postvisit( VarArgsType * varArgsType ); 56 void postvisit( ZeroType * zeroType ); 57 void postvisit( OneType * oneType ); 58 35 59 private: 36 virtual void visit( VoidType *voidType );37 virtual void visit( BasicType *basicType );38 virtual void visit( PointerType *pointerType );39 virtual void visit( ArrayType *arrayType );40 virtual void visit( ReferenceType *refType );41 virtual void visit( FunctionType *functionType );42 virtual void visit( StructInstType *aggregateUseType );43 virtual void visit( UnionInstType *aggregateUseType );44 virtual void visit( EnumInstType *aggregateUseType );45 virtual void visit( TraitInstType *aggregateUseType );46 virtual void visit( TypeInstType *aggregateUseType );47 virtual void visit( TupleType *tupleType );48 virtual void visit( VarArgsType *varArgsType );49 virtual void visit( ZeroType *zeroType );50 virtual void visit( OneType *oneType );51 52 60 template< typename Pointer > void getCommonWithVoidPointer( Pointer* voidPointer, Pointer* otherPointer ); 53 61 template< typename RefType > void handleRefType( RefType *inst, Type *other ); … … 67 75 // need unify to bind type variables 68 76 if ( unify( t1, t2, env, have, need, newOpen, indexer, common ) ) { 69 // std::cerr << "unify success: " << widenFirst << " " << widenSecond << std::endl; 77 PRINT( 78 std::cerr << "unify success: " << widenFirst << " " << widenSecond << std::endl; 79 ) 70 80 if ( (widenFirst || t2->get_qualifiers() <= t1->get_qualifiers()) && (widenSecond || t1->get_qualifiers() <= t2->get_qualifiers()) ) { 71 // std::cerr << "widen okay" << std::endl; 81 PRINT( 82 std::cerr << "widen okay" << std::endl; 83 ) 72 84 common->get_qualifiers() |= t1->get_qualifiers(); 73 85 common->get_qualifiers() |= t2->get_qualifiers(); … … 75 87 } 76 88 } 77 // std::cerr << "exact unify failed: " << t1 << " " << t2 << std::endl; 89 PRINT( 90 std::cerr << "exact unify failed: " << t1 << " " << t2 << std::endl; 91 ) 78 92 return nullptr; 79 93 } 80 94 81 95 Type *commonType( Type *type1, Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars ) { 82 CommonTypevisitor( type2, widenFirst, widenSecond, indexer, env, openVars );96 PassVisitor<CommonType> visitor( type2, widenFirst, widenSecond, indexer, env, openVars ); 83 97 84 98 int depth1 = type1->referenceDepth(); … … 87 101 int diff = depth1-depth2; 88 102 // TODO: should it be possible for commonType to generate complicated conversions? I would argue no, only conversions that involve types of the same reference level or a difference of 1 should be allowed. 89 if ( diff > 1 || diff < -1 ) return nullptr;103 // if ( diff > 1 || diff < -1 ) return nullptr; 90 104 91 105 // special case where one type has a reference depth of 1 larger than the other 92 106 if ( diff > 0 || diff < 0 ) { 107 PRINT( 108 std::cerr << "reference depth diff: " << diff << std::endl; 109 ) 93 110 Type * result = nullptr; 94 if ( ReferenceType * ref1 = dynamic_cast< ReferenceType * >( type1 ) ) { 95 // formal is reference, so result should be reference 111 ReferenceType * ref1 = dynamic_cast< ReferenceType * >( type1 ); 112 ReferenceType * ref2 = dynamic_cast< ReferenceType * >( type2 ); 113 if ( diff > 0 ) { 114 // deeper on the left 115 assert( ref1 ); 96 116 result = handleReference( ref1->base, type2, widenFirst, widenSecond, indexer, env, openVars ); 97 if ( result ) result = new ReferenceType( ref1->get_qualifiers(), result );98 117 } else { 99 // formal is value, so result should be value100 ReferenceType * ref2 = strict_dynamic_cast< ReferenceType * > ( type2 );118 // deeper on the right 119 assert( ref2 ); 101 120 result = handleReference( type1, ref2->base, widenFirst, widenSecond, indexer, env, openVars ); 102 121 } 103 // std::cerr << "common type of reference [" << type1 << "] and [" << type2 << "] is [" << result << "]" << std::endl; 122 if ( result && ref1 ) { 123 // formal is reference, so result should be reference 124 PRINT( 125 std::cerr << "formal is reference; result should be reference" << std::endl; 126 ) 127 result = new ReferenceType( ref1->get_qualifiers(), result ); 128 } 129 PRINT( 130 std::cerr << "common type of reference [" << type1 << "] and [" << type2 << "] is [" << result << "]" << std::endl; 131 ) 104 132 return result; 105 133 } … … 108 136 109 137 type1->accept( visitor ); 110 Type *result = visitor. get_result();138 Type *result = visitor.pass.get_result(); 111 139 if ( ! result ) { 112 140 // this appears to be handling for opaque type declarations … … 148 176 } 149 177 150 static const BasicType::Kind combinedType[ BasicType::NUMBER_OF_BASIC_TYPES][ BasicType::NUMBER_OF_BASIC_TYPES ] =178 static const BasicType::Kind combinedType[][ BasicType::NUMBER_OF_BASIC_TYPES ] = 151 179 { 152 /* Bool Char SignedChar UnsignedChar ShortSignedInt ShortUnsignedInt SignedInt UnsignedInt LongSignedInt LongUnsignedInt LongLongSignedInt LongLongUnsignedInt Float Double LongDouble FloatComplex DoubleComplex LongDoubleComplex FloatImaginary DoubleImaginary LongDoubleImaginary SignedInt128 UnsignedInt128 */ 153 /* Bool */ { BasicType::Bool, BasicType::Char, BasicType::SignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 154 /* Char */ { BasicType::Char, BasicType::Char, BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 155 /* SignedChar */ { BasicType::SignedChar, BasicType::UnsignedChar, BasicType::SignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 156 /* UnsignedChar */ { BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 157 /* ShortSignedInt */ { BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 158 /* ShortUnsignedInt */ { BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 159 /* SignedInt */ { BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 160 /* UnsignedInt */ { BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 161 /* LongSignedInt */ { BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 162 /* LongUnsignedInt */ { BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 163 /* LongLongSignedInt */ { BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 164 /* LongLongUnsignedInt */ { BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 165 /* Float */ { BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::Float, BasicType::Float, }, 166 /* Double */ { BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::LongDouble, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::Double, BasicType::Double, }, 167 /* LongDouble */ { BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDouble, BasicType::LongDouble, }, 168 /* FloatComplex */ { BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::FloatComplex, }, 169 /* DoubleComplex */ { BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, }, 170 /* LongDoubleComplex */ { BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, }, 171 /* FloatImaginary */ { BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatImaginary, BasicType::DoubleImaginary, BasicType::LongDoubleImaginary, BasicType::FloatImaginary, BasicType::FloatImaginary, }, 172 /* DoubleImaginary */ { BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleImaginary, BasicType::DoubleImaginary, BasicType::LongDoubleImaginary, BasicType::DoubleImaginary, BasicType::DoubleImaginary, }, 173 /* LongDoubleImaginary */ { BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary }, 174 /* SignedInt128 */ { BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, }, 175 /* UnsignedInt128 */ { BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::UnsignedInt128, BasicType::UnsignedInt128, }, 180 /* Bool Char SignedChar UnsignedChar ShortSignedInt ShortUnsignedInt SignedInt UnsignedInt LongSignedInt LongUnsignedInt LongLongSignedInt LongLongUnsignedInt Float Double LongDouble FloatComplex DoubleComplex LongDoubleComplex FloatImaginary DoubleImaginary LongDoubleImaginary SignedInt128 UnsignedInt128 Float80 Float128 */ 181 /* Bool */ { BasicType::Bool, BasicType::Char, BasicType::SignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 182 /* Char */ { BasicType::Char, BasicType::Char, BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 183 /* SignedChar */ { BasicType::SignedChar, BasicType::UnsignedChar, BasicType::SignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 184 /* UnsignedChar */ { BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::UnsignedChar, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 185 /* ShortSignedInt */ { BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortSignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 186 /* ShortUnsignedInt */ { BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::ShortUnsignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 187 /* SignedInt */ { BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::SignedInt, BasicType::UnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 188 /* UnsignedInt */ { BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 189 /* LongSignedInt */ { BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongSignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 190 /* LongUnsignedInt */ { BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongUnsignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 191 /* LongLongSignedInt */ { BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongSignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 192 /* LongLongUnsignedInt */ { BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 }, 193 /* Float */ { BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::Float, BasicType::Float, BasicType::Float80, BasicType::Float128 }, 194 /* Double */ { BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::Double, BasicType::LongDouble, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::Double, BasicType::Double, BasicType::Float80, BasicType::Float128 }, 195 /* LongDouble */ { BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDouble, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDouble, BasicType::LongDouble, BasicType::BasicType::LongDouble, BasicType::Float128 }, 196 /* FloatComplex */ { BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, }, 197 /* DoubleComplex */ { BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex }, 198 /* LongDoubleComplex */ { BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, }, 199 /* FloatImaginary */ { BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatImaginary, BasicType::DoubleImaginary, BasicType::LongDoubleImaginary, BasicType::FloatImaginary, BasicType::FloatImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, }, 200 /* DoubleImaginary */ { BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::DoubleImaginary, BasicType::DoubleImaginary, BasicType::LongDoubleImaginary, BasicType::DoubleImaginary, BasicType::DoubleImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, }, 201 /* LongDoubleImaginary */ { BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, }, 202 /* SignedInt128 */ { BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::SignedInt128, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::SignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128, }, 203 /* UnsignedInt128 */ { BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::Float, BasicType::Double, BasicType::LongDouble, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::FloatComplex, BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::UnsignedInt128, BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128, }, 204 /* Float80 */ { BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::LongDouble, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::Float80, BasicType::Float80, BasicType::Float80, BasicType::Float128 }, 205 /* Float128 */ { BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::Float128, BasicType::Float128, BasicType::Float128, BasicType::Float128 }, 176 206 }; 207 static_assert( 208 sizeof(combinedType)/sizeof(combinedType[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES, 209 "Each basic type kind should have a corresponding row in the combined type matrix" 210 ); 177 211 178 212 CommonType::CommonType( Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars ) … … 180 214 } 181 215 182 void CommonType:: visit( __attribute((unused)) VoidType *voidType) {}183 184 void CommonType:: visit( BasicType *basicType ) {216 void CommonType::postvisit( VoidType * ) {} 217 218 void CommonType::postvisit( BasicType *basicType ) { 185 219 if ( BasicType *otherBasic = dynamic_cast< BasicType* >( type2 ) ) { 186 220 BasicType::Kind newType = combinedType[ basicType->get_kind() ][ otherBasic->get_kind() ]; … … 204 238 AssertionSet need, have; 205 239 WidenMode widen( widenFirst, widenSecond ); 206 if ( entry != openVars.end() && ! bindVar(var, voidPointer->get_base(), entry->second, env, need, have, openVars, widen, indexer ) ) return;240 if ( entry != openVars.end() && ! env.bindVar(var, voidPointer->get_base(), entry->second, need, have, openVars, widen, indexer ) ) return; 207 241 } 208 242 } … … 211 245 } 212 246 213 void CommonType:: visit( PointerType *pointerType ) {247 void CommonType::postvisit( PointerType *pointerType ) { 214 248 if ( PointerType *otherPointer = dynamic_cast< PointerType* >( type2 ) ) { 215 249 // std::cerr << "commonType: two pointers: " << pointerType << " / " << otherPointer << std::endl; … … 233 267 result = otherPointer->clone(); 234 268 } // if 235 result->get_qualifiers() = tq1 | tq2;269 strict_dynamic_cast<PointerType*>(result)->base->get_qualifiers() = tq1 | tq2; 236 270 } else { 237 271 /// std::cerr << "place for ptr-to-type" << std::endl; … … 246 280 } 247 281 248 void CommonType:: visit( __attribute((unused)) ArrayType *arrayType) {}249 250 void CommonType:: visit( ReferenceType *refType ) {282 void CommonType::postvisit( ArrayType * ) {} 283 284 void CommonType::postvisit( ReferenceType *refType ) { 251 285 if ( ReferenceType *otherRef = dynamic_cast< ReferenceType* >( type2 ) ) { 252 286 // std::cerr << "commonType: both references: " << refType << " / " << otherRef << std::endl; … … 270 304 result = otherRef->clone(); 271 305 } // if 272 result->get_qualifiers() = tq1 | tq2;306 strict_dynamic_cast<ReferenceType*>(result)->base->get_qualifiers() = tq1 | tq2; 273 307 } else { 274 308 /// std::cerr << "place for ptr-to-type" << std::endl; … … 283 317 } 284 318 285 void CommonType:: visit( __attribute((unused)) FunctionType *functionType) {}286 void CommonType:: visit( __attribute((unused)) StructInstType *aggregateUseType) {}287 void CommonType:: visit( __attribute((unused)) UnionInstType *aggregateUseType) {}288 289 void CommonType:: visit( EnumInstType *enumInstType ) {319 void CommonType::postvisit( FunctionType * ) {} 320 void CommonType::postvisit( StructInstType * ) {} 321 void CommonType::postvisit( UnionInstType * ) {} 322 323 void CommonType::postvisit( EnumInstType *enumInstType ) { 290 324 if ( dynamic_cast< BasicType * >( type2 ) || dynamic_cast< ZeroType* >( type2 ) || dynamic_cast< OneType* >( type2 ) ) { 291 325 // reuse BasicType, EnumInstType code by swapping type2 with enumInstType 292 ValueGuard< Type * > temp( type2 ); 293 type2 = enumInstType; 294 temp.old->accept( *this ); 295 } // if 296 } 297 298 void CommonType::visit( __attribute((unused)) TraitInstType *aggregateUseType ) { 299 } 300 301 void CommonType::visit( TypeInstType *inst ) { 326 result = commonType( type2, enumInstType, widenSecond, widenFirst, indexer, env, openVars ); 327 } // if 328 } 329 330 void CommonType::postvisit( TraitInstType * ) { 331 } 332 333 void CommonType::postvisit( TypeInstType *inst ) { 302 334 if ( widenFirst ) { 303 335 NamedTypeDecl *nt = indexer.lookupType( inst->get_name() ); … … 321 353 } 322 354 323 void CommonType:: visit( __attribute((unused)) TupleType *tupleType) {}324 void CommonType:: visit( __attribute((unused)) VarArgsType *varArgsType) {}325 326 void CommonType:: visit( ZeroType *zeroType ) {355 void CommonType::postvisit( TupleType * ) {} 356 void CommonType::postvisit( VarArgsType * ) {} 357 358 void CommonType::postvisit( ZeroType *zeroType ) { 327 359 if ( widenFirst ) { 328 360 if ( dynamic_cast< BasicType* >( type2 ) || dynamic_cast< PointerType* >( type2 ) || dynamic_cast< EnumInstType* >( type2 ) ) { … … 338 370 } 339 371 340 void CommonType:: visit( OneType *oneType ) {372 void CommonType::postvisit( OneType *oneType ) { 341 373 if ( widenFirst ) { 342 374 if ( dynamic_cast< BasicType* >( type2 ) || dynamic_cast< EnumInstType* >( type2 ) ) { -
src/ResolvExpr/ConversionCost.cc
rf9feab8 r90152a4 42 42 Cost conversionCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) { 43 43 if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) { 44 EqvClass eqvClass; 45 NamedTypeDecl *namedType; 46 PRINT( std::cerr << "type inst " << destAsTypeInst->get_name(); ) 47 if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) { 48 if ( eqvClass.type ) { 49 return conversionCost( src, eqvClass.type, indexer, env ); 44 PRINT( std::cerr << "type inst " << destAsTypeInst->name; ) 45 if ( const EqvClass* eqvClass = env.lookup( destAsTypeInst->name ) ) { 46 if ( eqvClass->type ) { 47 return conversionCost( src, eqvClass->type, indexer, env ); 50 48 } else { 51 49 return Cost::infinity; 52 50 } 53 } else if ( ( namedType = indexer.lookupType( destAsTypeInst->get_name() )) ) {51 } else if ( NamedTypeDecl *namedType = indexer.lookupType( destAsTypeInst->name ) ) { 54 52 PRINT( std::cerr << " found" << std::endl; ) 55 53 TypeDecl *type = dynamic_cast< TypeDecl* >( namedType ); 56 54 // all typedefs should be gone by this point 57 55 assert( type ); 58 if ( type-> get_base()) {59 return conversionCost( src, type-> get_base(), indexer, env ) + Cost::safe;56 if ( type->base ) { 57 return conversionCost( src, type->base, indexer, env ) + Cost::safe; 60 58 } // if 61 59 } // if … … 77 75 } else if ( ReferenceType * refType = dynamic_cast< ReferenceType * > ( dest ) ) { 78 76 PRINT( std::cerr << "conversionCost: dest is reference" << std::endl; ) 79 return convertToReferenceCost( src, refType, indexer, env, [](Type * t1, Type * t2, const TypeEnvironment & env, const SymTab::Indexer &){77 return convertToReferenceCost( src, refType, indexer, env, [](Type * t1, Type * t2, const SymTab::Indexer &, const TypeEnvironment & env ){ 80 78 return ptrsAssignable( t1, t2, env ); 81 79 }); 82 80 } else { 83 ConversionCost converter( dest, indexer, env);81 PassVisitor<ConversionCost> converter( dest, indexer, env, conversionCost ); 84 82 src->accept( converter ); 85 if ( converter. get_cost() == Cost::infinity ) {83 if ( converter.pass.get_cost() == Cost::infinity ) { 86 84 return Cost::infinity; 87 85 } else { 88 return converter. get_cost() + Cost::zero;86 return converter.pass.get_cost() + Cost::zero; 89 87 } // if 90 88 } // if … … 92 90 93 91 Cost convertToReferenceCost( Type * src, Type * dest, int diff, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func ) { 94 PRINT( std::cerr << "convert to reference cost... diff " << diff << std::endl; )92 PRINT( std::cerr << "convert to reference cost... diff " << diff << " " << src << " / " << dest << std::endl; ) 95 93 if ( diff > 0 ) { 96 94 // TODO: document this 97 Cost cost = convertToReferenceCost( strict_dynamic_cast< ReferenceType * >( src )-> get_base(), dest, diff-1, indexer, env, func );95 Cost cost = convertToReferenceCost( strict_dynamic_cast< ReferenceType * >( src )->base, dest, diff-1, indexer, env, func ); 98 96 cost.incReference(); 99 97 return cost; 100 98 } else if ( diff < -1 ) { 101 99 // TODO: document this 102 Cost cost = convertToReferenceCost( src, strict_dynamic_cast< ReferenceType * >( dest )-> get_base(), diff+1, indexer, env, func );100 Cost cost = convertToReferenceCost( src, strict_dynamic_cast< ReferenceType * >( dest )->base, diff+1, indexer, env, func ); 103 101 cost.incReference(); 104 102 return cost; … … 108 106 if ( srcAsRef && destAsRef ) { // pointer-like conversions between references 109 107 PRINT( std::cerr << "converting between references" << std::endl; ) 110 if ( srcAsRef->get_base()->get_qualifiers() <= destAsRef->get_base()->get_qualifiers() && typesCompatibleIgnoreQualifiers( srcAsRef->get_base(), destAsRef->get_base(), indexer, env ) ) { 111 return Cost::safe; 108 Type::Qualifiers tq1 = srcAsRef->base->get_qualifiers(); 109 Type::Qualifiers tq2 = destAsRef->base->get_qualifiers(); 110 if ( tq1 <= tq2 && typesCompatibleIgnoreQualifiers( srcAsRef->base, destAsRef->base, indexer, env ) ) { 111 PRINT( std::cerr << " :: compatible and good qualifiers" << std::endl; ) 112 if ( tq1 == tq2 ) { 113 // types are the same 114 return Cost::zero; 115 } else { 116 // types are the same, except otherPointer has more qualifiers 117 return Cost::safe; 118 } 112 119 } else { // xxx - this discards reference qualifiers from consideration -- reducing qualifiers is a safe conversion; is this right? 113 int assignResult = func( srcAsRef-> get_base(), destAsRef->get_base(), env, indexer);120 int assignResult = func( srcAsRef->base, destAsRef->base, indexer, env ); 114 121 PRINT( std::cerr << "comparing references: " << assignResult << " " << srcAsRef << " " << destAsRef << std::endl; ) 115 122 if ( assignResult > 0 ) { … … 121 128 } else { 122 129 PRINT( std::cerr << "reference to rvalue conversion" << std::endl; ) 123 ConversionCost converter( dest, indexer, env);130 PassVisitor<ConversionCost> converter( dest, indexer, env, conversionCost ); 124 131 src->accept( converter ); 125 return converter. get_cost();132 return converter.pass.get_cost(); 126 133 } // if 127 134 } else { … … 129 136 assert( diff == -1 && destAsRef ); 130 137 PRINT( std::cerr << "dest is: " << dest << " / src is: " << src << std::endl; ) 131 if ( typesCompatibleIgnoreQualifiers( src, destAsRef-> get_base(), indexer, env ) ) {138 if ( typesCompatibleIgnoreQualifiers( src, destAsRef->base, indexer, env ) ) { 132 139 PRINT( std::cerr << "converting compatible base type" << std::endl; ) 133 140 if ( src->get_lvalue() ) { … … 137 144 ) 138 145 // lvalue-to-reference conversion: cv lvalue T => cv T & 139 if ( src->get_qualifiers() == destAsRef-> get_base()->get_qualifiers() ) {146 if ( src->get_qualifiers() == destAsRef->base->get_qualifiers() ) { 140 147 return Cost::reference; // cost needs to be non-zero to add cast 141 } if ( src->get_qualifiers() < destAsRef-> get_base()->get_qualifiers() ) {148 } if ( src->get_qualifiers() < destAsRef->base->get_qualifiers() ) { 142 149 return Cost::safe; // cost needs to be higher than previous cast to differentiate adding qualifiers vs. keeping same 143 150 } else { 144 151 return Cost::unsafe; 145 152 } // if 146 } else if ( destAsRef-> get_base()->get_const() ) {153 } else if ( destAsRef->base->get_const() ) { 147 154 PRINT( std::cerr << "rvalue to const ref conversion" << std::endl; ) 148 155 // rvalue-to-const-reference conversion: T => const T & … … 161 168 Cost convertToReferenceCost( Type * src, ReferenceType * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func ) { 162 169 int sdepth = src->referenceDepth(), ddepth = dest->referenceDepth(); 163 return convertToReferenceCost( src, dest, sdepth-ddepth, indexer, env, func ); 164 } 165 166 ConversionCost::ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) 167 : dest( dest ), indexer( indexer ), cost( Cost::infinity ), env( env ) { 170 Cost cost = convertToReferenceCost( src, dest, sdepth-ddepth, indexer, env, func ); 171 PRINT( std::cerr << "convertToReferenceCost result: " << cost << std::endl; ) 172 return cost; 173 } 174 175 ConversionCost::ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction costFunc ) 176 : dest( dest ), indexer( indexer ), cost( Cost::infinity ), env( env ), costFunc( costFunc ) { 168 177 } 169 178 … … 219 228 */ 220 229 221 static const int costMatrix[ BasicType::NUMBER_OF_BASIC_TYPES ][ BasicType::NUMBER_OF_BASIC_TYPES ] = { 222 /* Src \ Dest: Bool Char SChar UChar Short UShort Int UInt Long ULong LLong ULLong Float Double LDbl FCplex DCplex LDCplex FImag DImag LDImag I128, U128 */ 223 /* Bool */ { 0, 1, 1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 12, 13, 14, 12, 13, 14, -1, -1, -1, 10, 11, }, 224 /* Char */ { -1, 0, -1, 1, 2, 3, 4, 5, 5, 6, 7, 8, 11, 12, 13, 11, 12, 13, -1, -1, -1, 9, 10, }, 225 /* SChar */ { -1, -1, 0, 1, 2, 3, 4, 5, 5, 6, 7, 8, 11, 12, 13, 11, 12, 13, -1, -1, -1, 9, 10, }, 226 /* UChar */ { -1, -1, -1, 0, 1, 2, 3, 4, 4, 5, 6, 7, 10, 11, 12, 10, 11, 12, -1, -1, -1, 8, 9, }, 227 /* Short */ { -1, -1, -1, -1, 0, 1, 2, 3, 3, 4, 5, 6, 9, 10, 11, 9, 10, 11, -1, -1, -1, 7, 8, }, 228 /* UShort */{ -1, -1, -1, -1, -1, 0, 1, 2, 2, 3, 4, 5, 8, 9, 10, 8, 9, 10, -1, -1, -1, 6, 7, }, 229 /* Int */ { -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 3, 4, 7, 8, 9, 7, 8, 9, -1, -1, -1, 5, 6, }, 230 /* UInt */ { -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, 2, 3, 6, 7, 8, 6, 7, 8, -1, -1, -1, 4, 5, }, 231 /* Long */ { -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 6, 7, 8, 6, 7, 8, -1, -1, -1, 4, 5, }, 232 /* ULong */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 5, 6, 7, 5, 6, 7, -1, -1, -1, 3, 4, }, 233 /* LLong */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 4, 5, 6, 4, 5, 6, -1, -1, -1, 2, 3, }, 234 /* ULLong */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 3, 4, 5, 3, 4, 5, -1, -1, -1, 1, 2, }, 235 236 /* Float */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 1, 2, 3, -1, -1, -1, -1, -1, }, 237 /* Double */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 1, 2, -1, -1, -1, -1, -1, }, 238 /* LDbl */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 1, -1, -1, -1, -1, -1, }, 239 /* FCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, -1, -1, -1, -1, -1, }, 240 /* DCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1, -1, -1, -1, }, 241 /* LDCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, }, 242 /* FImag */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 0, 1, 2, -1, -1, }, 243 /* DImag */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, -1, 0, 1, -1, -1, }, 244 /* LDImag */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 0, -1, -1, }, 245 246 /* I128 */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 3, 4, 3, 4, 5, -1, -1, -1, 0, 1, }, 247 /* U128 */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 2, 3, 4, -1, -1, -1, -1, 0, }, 230 static const int costMatrix[][ BasicType::NUMBER_OF_BASIC_TYPES ] = { 231 /* Src \ Dest: Bool Char SChar UChar Short UShort Int UInt Long ULong LLong ULLong Float Double LDbl FCplex DCplex LDCplex FImag DImag LDImag I128, U128, F80, F128 */ 232 /* Bool */ { 0, 1, 1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 12, 13, 14, 12, 13, 14, -1, -1, -1, 10, 11, 14, 15}, 233 /* Char */ { -1, 0, -1, 1, 2, 3, 4, 5, 5, 6, 7, 8, 11, 12, 13, 11, 12, 13, -1, -1, -1, 9, 10, 13, 14}, 234 /* SChar */ { -1, -1, 0, 1, 2, 3, 4, 5, 5, 6, 7, 8, 11, 12, 13, 11, 12, 13, -1, -1, -1, 9, 10, 13, 14}, 235 /* UChar */ { -1, -1, -1, 0, 1, 2, 3, 4, 4, 5, 6, 7, 10, 11, 12, 10, 11, 12, -1, -1, -1, 8, 9, 12, 13}, 236 /* Short */ { -1, -1, -1, -1, 0, 1, 2, 3, 3, 4, 5, 6, 9, 10, 11, 9, 10, 11, -1, -1, -1, 7, 8, 11, 12}, 237 /* UShort */{ -1, -1, -1, -1, -1, 0, 1, 2, 2, 3, 4, 5, 8, 9, 10, 8, 9, 10, -1, -1, -1, 6, 7, 10, 11}, 238 /* Int */ { -1, -1, -1, -1, -1, -1, 0, 1, 1, 2, 3, 4, 7, 8, 9, 7, 8, 9, -1, -1, -1, 5, 6, 9, 10}, 239 /* UInt */ { -1, -1, -1, -1, -1, -1, -1, 0, -1, 1, 2, 3, 6, 7, 8, 6, 7, 8, -1, -1, -1, 4, 5, 8, 9}, 240 /* Long */ { -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 6, 7, 8, 6, 7, 8, -1, -1, -1, 4, 5, 8, 9}, 241 /* ULong */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 5, 6, 7, 5, 6, 7, -1, -1, -1, 3, 4, 7, 8}, 242 /* LLong */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 4, 5, 6, 4, 5, 6, -1, -1, -1, 2, 3, 6, 7}, 243 /* ULLong */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 3, 4, 5, 3, 4, 5, -1, -1, -1, 1, 2, 5, 6}, 244 245 /* Float */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 1, 2, 3, -1, -1, -1, -1, -1, 2, 3}, 246 /* Double */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, 1, 2, -1, -1, -1, -1, -1, 1, 2}, 247 /* LDbl */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1}, 248 /* FCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, -1, -1, -1, -1, -1, -1, -1}, 249 /* DCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, -1, -1, -1, -1, -1, -1, -1}, 250 /* LDCplex */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1}, 251 /* FImag */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 0, 1, 2, -1, -1, -1, -1}, 252 /* DImag */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, -1, 0, 1, -1, -1, -1, -1}, 253 /* LDImag */{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 0, -1, -1, -1, -1}, 254 255 /* I128 */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 3, 4, 3, 4, 5, -1, -1, -1, 0, 1, 4, 4}, 256 /* U128 */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 2, 3, 4, -1, -1, -1, -1, 0, 3, 3}, 257 258 /* F80 */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, -1, -1, -1, -1, 0, 1}, 259 /* F128 */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 0}, 248 260 }; 249 250 void ConversionCost::visit( __attribute((unused)) VoidType *voidType ) { 261 static_assert( 262 sizeof(costMatrix)/sizeof(costMatrix[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES, 263 "Each basic type kind should have a corresponding row in the cost matrix" 264 ); 265 266 267 void ConversionCost::postvisit( VoidType * ) { 251 268 cost = Cost::infinity; 252 269 } 253 270 254 void ConversionCost:: visit(BasicType *basicType) {271 void ConversionCost::postvisit(BasicType *basicType) { 255 272 if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) { 256 273 int tableResult = costMatrix[ basicType->get_kind() ][ destAsBasic->get_kind() ]; … … 264 281 // xxx - not positive this is correct, but appears to allow casting int => enum 265 282 cost = Cost::unsafe; 266 } else if ( dynamic_cast< ZeroType* >( dest ) != nullptr || dynamic_cast< OneType* >( dest ) != nullptr ) { 267 cost = Cost::unsafe; 268 } // if 269 } 270 271 void ConversionCost::visit( PointerType * pointerType ) { 283 } // if 284 // no cases for zero_t/one_t because it should not be possible to convert int, etc. to zero_t/one_t. 285 } 286 287 void ConversionCost::postvisit( PointerType * pointerType ) { 272 288 if ( PointerType *destAsPtr = dynamic_cast< PointerType* >( dest ) ) { 273 PRINT( std::cerr << pointerType << " ===> " << destAsPtr; ) 274 Type::Qualifiers tq1 = pointerType->get_base()->get_qualifiers(); 275 Type::Qualifiers tq2 = destAsPtr->get_base()->get_qualifiers(); 276 if ( tq1 <= tq2 && typesCompatibleIgnoreQualifiers( pointerType->get_base(), destAsPtr->get_base(), indexer, env ) ) { 289 PRINT( std::cerr << pointerType << " ===> " << destAsPtr << std::endl; ) 290 Type::Qualifiers tq1 = pointerType->base->get_qualifiers(); 291 Type::Qualifiers tq2 = destAsPtr->base->get_qualifiers(); 292 if ( tq1 <= tq2 && typesCompatibleIgnoreQualifiers( pointerType->base, destAsPtr->base, indexer, env ) ) { 293 PRINT( std::cerr << " :: compatible and good qualifiers" << std::endl; ) 277 294 if ( tq1 == tq2 ) { 278 295 // types are the same … … 280 297 } else { 281 298 // types are the same, except otherPointer has more qualifiers 282 PRINT( std::cerr << " :: compatible and good qualifiers" << std::endl; )283 299 cost = Cost::safe; 284 300 } 285 } else { // xxx - this discards qualifiers from consideration -- reducing qualifiers is a safe conversion; is this right?301 } else { 286 302 int assignResult = ptrsAssignable( pointerType->base, destAsPtr->base, env ); 287 303 PRINT( std::cerr << " :: " << assignResult << std::endl; ) 288 if ( assignResult > 0 && pointerType->get_base()->get_qualifiers() <= destAsPtr->get_qualifiers() ) { 289 cost = Cost::safe; 304 if ( assignResult > 0 && tq1 <= tq2 ) { 305 // xxx - want the case where qualifiers are added to be more expensive than the case where qualifiers are the same. Is 1 safe vs. 2 safe correct? 306 if ( tq1 == tq2 ) { 307 cost = Cost::safe; 308 } else if ( tq1 < tq2 ) { 309 cost = Cost::safe+Cost::safe; 310 } 290 311 } else if ( assignResult < 0 ) { 291 312 cost = Cost::unsafe; … … 293 314 // assignResult == 0 means Cost::Infinity 294 315 } // if 295 } else if ( dynamic_cast< ZeroType * >( dest ) ) { 296 cost = Cost::unsafe; 297 } // if 298 } 299 300 void ConversionCost::visit( ArrayType * ) {} 301 302 void ConversionCost::visit( ReferenceType * refType ) { 316 // case case for zero_t because it should not be possible to convert pointers to zero_t. 317 } // if 318 } 319 320 void ConversionCost::postvisit( ArrayType * ) {} 321 322 void ConversionCost::postvisit( ReferenceType * refType ) { 303 323 // Note: dest can never be a reference, since it would have been caught in an earlier check 304 324 assert( ! dynamic_cast< ReferenceType * >( dest ) ); … … 306 326 // recursively compute conversion cost from T1 to T2. 307 327 // cv can be safely dropped because of 'implicit dereference' behavior. 308 refType->base->accept( *this);328 cost = costFunc( refType->base, dest, indexer, env ); 309 329 if ( refType->base->get_qualifiers() == dest->get_qualifiers() ) { 310 330 cost.incReference(); // prefer exact qualifiers … … 317 337 } 318 338 319 void ConversionCost:: visit( FunctionType * ) {}320 321 void ConversionCost:: visit( StructInstType * inst ) {339 void ConversionCost::postvisit( FunctionType * ) {} 340 341 void ConversionCost::postvisit( StructInstType * inst ) { 322 342 if ( StructInstType *destAsInst = dynamic_cast< StructInstType* >( dest ) ) { 323 343 if ( inst->name == destAsInst->name ) { … … 327 347 } 328 348 329 void ConversionCost:: visit( UnionInstType * inst ) {349 void ConversionCost::postvisit( UnionInstType * inst ) { 330 350 if ( UnionInstType *destAsInst = dynamic_cast< UnionInstType* >( dest ) ) { 331 351 if ( inst->name == destAsInst->name ) { … … 335 355 } 336 356 337 void ConversionCost:: visit( EnumInstType * ) {357 void ConversionCost::postvisit( EnumInstType * ) { 338 358 static Type::Qualifiers q; 339 359 static BasicType integer( q, BasicType::SignedInt ); 340 integer.accept( *this); // safe if dest >= int360 cost = costFunc( &integer, dest, indexer, env ); // safe if dest >= int 341 361 if ( cost < Cost::unsafe ) { 342 362 cost.incSafe(); … … 344 364 } 345 365 346 void ConversionCost::visit( TraitInstType * ) {} 347 348 void ConversionCost::visit( TypeInstType *inst ) { 349 EqvClass eqvClass; 350 NamedTypeDecl *namedType; 351 if ( env.lookup( inst->get_name(), eqvClass ) ) { 352 cost = conversionCost( eqvClass.type, dest, indexer, env ); 366 void ConversionCost::postvisit( TraitInstType * ) {} 367 368 void ConversionCost::postvisit( TypeInstType *inst ) { 369 if ( const EqvClass *eqvClass = env.lookup( inst->name ) ) { 370 cost = costFunc( eqvClass->type, dest, indexer, env ); 353 371 } else if ( TypeInstType *destAsInst = dynamic_cast< TypeInstType* >( dest ) ) { 354 if ( inst-> get_name() == destAsInst->get_name()) {372 if ( inst->name == destAsInst->name ) { 355 373 cost = Cost::zero; 356 374 } 357 } else if ( ( namedType = indexer.lookupType( inst->get_name() )) ) {375 } else if ( NamedTypeDecl *namedType = indexer.lookupType( inst->name ) ) { 358 376 TypeDecl *type = dynamic_cast< TypeDecl* >( namedType ); 359 377 // all typedefs should be gone by this point 360 378 assert( type ); 361 if ( type-> get_base()) {362 cost = co nversionCost( type->get_base(), dest, indexer, env ) + Cost::safe;363 } // if 364 } // if 365 } 366 367 void ConversionCost:: visit( TupleType * tupleType ) {379 if ( type->base ) { 380 cost = costFunc( type->base, dest, indexer, env ) + Cost::safe; 381 } // if 382 } // if 383 } 384 385 void ConversionCost::postvisit( TupleType * tupleType ) { 368 386 Cost c = Cost::zero; 369 387 if ( TupleType * destAsTuple = dynamic_cast< TupleType * >( dest ) ) { 370 std::list< Type * >::const_iterator srcIt = tupleType-> get_types().begin();371 std::list< Type * >::const_iterator destIt = destAsTuple-> get_types().begin();372 while ( srcIt != tupleType-> get_types().end() && destIt != destAsTuple->get_types().end() ) {373 Cost newCost = co nversionCost( *srcIt++, *destIt++, indexer, env );388 std::list< Type * >::const_iterator srcIt = tupleType->types.begin(); 389 std::list< Type * >::const_iterator destIt = destAsTuple->types.begin(); 390 while ( srcIt != tupleType->types.end() && destIt != destAsTuple->types.end() ) { 391 Cost newCost = costFunc( *srcIt++, *destIt++, indexer, env ); 374 392 if ( newCost == Cost::infinity ) { 375 393 return; … … 377 395 c += newCost; 378 396 } // while 379 if ( destIt != destAsTuple-> get_types().end() ) {397 if ( destIt != destAsTuple->types.end() ) { 380 398 cost = Cost::infinity; 381 399 } else { … … 385 403 } 386 404 387 void ConversionCost:: visit( VarArgsType * ) {405 void ConversionCost::postvisit( VarArgsType * ) { 388 406 if ( dynamic_cast< VarArgsType* >( dest ) ) { 389 407 cost = Cost::zero; … … 391 409 } 392 410 393 void ConversionCost:: visit( ZeroType * ) {411 void ConversionCost::postvisit( ZeroType * ) { 394 412 if ( dynamic_cast< ZeroType * >( dest ) ) { 395 413 cost = Cost::zero; … … 408 426 } 409 427 410 void ConversionCost:: visit( OneType * ) {428 void ConversionCost::postvisit( OneType * ) { 411 429 if ( dynamic_cast< OneType * >( dest ) ) { 412 430 cost = Cost::zero; -
src/ResolvExpr/ConversionCost.h
rf9feab8 r90152a4 19 19 20 20 #include "Cost.h" // for Cost 21 22 #include "Common/PassVisitor.h" 21 23 #include "SynTree/Visitor.h" // for Visitor 22 24 #include "SynTree/SynTree.h" // for Visitor Nodes … … 29 31 class TypeEnvironment; 30 32 31 class ConversionCost : public Visitor { 33 typedef std::function<Cost(Type *, Type *, const SymTab::Indexer &, const TypeEnvironment &)> CostFunction; 34 struct ConversionCost : public WithShortCircuiting { 32 35 public: 33 ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );36 ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction ); 34 37 35 38 Cost get_cost() const { return cost; } 36 39 37 virtual void visit(VoidType *voidType); 38 virtual void visit(BasicType *basicType); 39 virtual void visit(PointerType *pointerType); 40 virtual void visit(ArrayType *arrayType); 41 virtual void visit(ReferenceType *refType); 42 virtual void visit(FunctionType *functionType); 43 virtual void visit(StructInstType *aggregateUseType); 44 virtual void visit(UnionInstType *aggregateUseType); 45 virtual void visit(EnumInstType *aggregateUseType); 46 virtual void visit(TraitInstType *aggregateUseType); 47 virtual void visit(TypeInstType *aggregateUseType); 48 virtual void visit(TupleType *tupleType); 49 virtual void visit(VarArgsType *varArgsType); 50 virtual void visit(ZeroType *zeroType); 51 virtual void visit(OneType *oneType); 40 void previsit( BaseSyntaxNode * ) { visit_children = false; } 41 42 void postvisit( VoidType * voidType ); 43 void postvisit( BasicType * basicType ); 44 void postvisit( PointerType * pointerType ); 45 void postvisit( ArrayType * arrayType ); 46 void postvisit( ReferenceType * refType ); 47 void postvisit( FunctionType * functionType ); 48 void postvisit( StructInstType * aggregateUseType ); 49 void postvisit( UnionInstType * aggregateUseType ); 50 void postvisit( EnumInstType * aggregateUseType ); 51 void postvisit( TraitInstType * aggregateUseType ); 52 void postvisit( TypeInstType * aggregateUseType ); 53 void postvisit( TupleType * tupleType ); 54 void postvisit( VarArgsType * varArgsType ); 55 void postvisit( ZeroType * zeroType ); 56 void postvisit( OneType * oneType ); 52 57 protected: 53 58 Type *dest; … … 55 60 Cost cost; 56 61 const TypeEnvironment &env; 62 CostFunction costFunc; 57 63 }; 58 64 59 typedef std::function<int(Type *, Type *, const TypeEnvironment &, const SymTab::Indexer&)> PtrsFunction;65 typedef std::function<int(Type *, Type *, const SymTab::Indexer &, const TypeEnvironment &)> PtrsFunction; 60 66 Cost convertToReferenceCost( Type * src, ReferenceType * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func ); 61 67 } // namespace ResolvExpr -
src/ResolvExpr/CurrentObject.cc
rf9feab8 r90152a4 38 38 39 39 namespace ResolvExpr { 40 long long int getConstValue( ConstantExpr * constExpr ) {41 if ( BasicType * basicType = dynamic_cast< BasicType * >( constExpr->get_result() ) ) {42 if ( basicType->isInteger() ) {43 return constExpr->get_constant()->get_ival();44 } else {45 assertf( false, "Non-integer constant expression in getConstValue %s", toString( constExpr ).c_str() ); // xxx - might be semantic error46 }47 } else if ( dynamic_cast< OneType * >( constExpr->get_result() ) ) {48 return 1;49 } else if ( dynamic_cast< ZeroType * >( constExpr->get_result() ) ) {50 return 0;51 } else {52 assertf( false, "unhandled type on getConstValue %s", toString( constExpr->get_result() ).c_str() ); // xxx - might be semantic error53 }54 }55 56 40 template< typename AggrInst > 57 41 TypeSubstitution makeGenericSubstitution( AggrInst * inst ) { … … 78 62 virtual ~MemberIterator() {} 79 63 64 /// walks the current object using the given designators as a guide 80 65 virtual void setPosition( std::list< Expression * > & designators ) = 0; 66 67 /// retrieve the list of possible Type/Designaton pairs for the current position in the currect object 81 68 virtual std::list<InitAlternative> operator*() const = 0; 69 70 /// true if the iterator is not currently at the end 82 71 virtual operator bool() const = 0; 72 73 /// moves the iterator by one member in the current object 83 74 virtual MemberIterator & bigStep() = 0; 75 76 /// moves the iterator by one member in the current subobject 84 77 virtual MemberIterator & smallStep() = 0; 78 79 /// the type of the current object 85 80 virtual Type * getType() = 0; 81 82 /// the type of the current subobject 86 83 virtual Type * getNext() = 0; 87 84 85 /// printing for debug 88 86 virtual void print( std::ostream & out, Indenter indent ) const = 0; 89 87 88 /// helper for operator*; aggregates must add designator to each init alternative, but 89 /// adding designators in operator* creates duplicates. 90 90 virtual std::list<InitAlternative> first() const = 0; // should be protected 91 91 }; … … 139 139 ArrayIterator( ArrayType * at ) : array( at ) { 140 140 PRINT( std::cerr << "Creating array iterator: " << at << std::endl; ) 141 base = at-> get_base();141 base = at->base; 142 142 memberIter = createMemberIterator( base ); 143 setSize( at->get_dimension() ); 143 if ( at->isVarLen ) SemanticError( at, "VLA initialization does not support @=: " ); 144 setSize( at->dimension ); 144 145 } 145 146 … … 149 150 150 151 private: 151 void setSize( Expression * expr ) { 152 if ( ConstantExpr * constExpr = dynamic_cast< ConstantExpr * >( expr ) ) { 153 size = getConstValue( constExpr ); 154 PRINT( std::cerr << "array type with size: " << size << std::endl; ) 155 } else if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( expr ) ) { 156 setSize( castExpr->get_arg() ); // xxx - need to perform the conversion specified by the cast 152 void setSize( Expression * expr ) { // replace this logic with an eval call 153 auto res = eval(expr); 154 if (res.second) { 155 size = res.first; 157 156 } else { 158 assertf( false, "unhandled expression in setSize: %s", toString( expr ).c_str() ); // xxx - if not a constant expression, it's not simple to determine how long the array actually is, which is necessary for initialization to be done correctly -- fix this157 SemanticError( expr->location, toString("Array designator must be a constant expression: ", expr) ); 159 158 } 160 159 } … … 164 163 // need to permit integer-constant-expressions, including: integer constants, enumeration constants, character constants, sizeof expressions, _Alignof expressions, cast expressions 165 164 if ( ConstantExpr * constExpr = dynamic_cast< ConstantExpr * >( expr ) ) { 166 index = getConstValue( constExpr ); 165 try { 166 index = constExpr->intValue(); 167 } catch( SemanticErrorException & ) { 168 SemanticError( expr, "Constant expression of non-integral type in array designator: " ); 169 } 167 170 } else if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( expr ) ) { 168 171 setPosition( castExpr->get_arg() ); 169 172 } else if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( expr ) ) { 170 assertf( dynamic_cast<EnumInstType *> ( varExpr->get_result() ), "ArrayIterator given variable that isn't an enum constant : %s", toString( expr ).c_str() ); 171 index = 0; // xxx - get actual value of enum constant 173 EnumInstType * inst = dynamic_cast<EnumInstType *>( varExpr->get_result() ); 174 assertf( inst, "ArrayIterator given variable that isn't an enum constant : %s", toString( expr ).c_str() ); 175 long long int value; 176 if ( inst->baseEnum->valueOf( varExpr->var, value ) ) { 177 index = value; 178 } 172 179 } else if ( dynamic_cast< SizeofExpr * >( expr ) || dynamic_cast< AlignofExpr * >( expr ) ) { 173 180 index = 0; // xxx - get actual sizeof/alignof value? … … 350 357 } 351 358 } 352 // if ( curMember == std::next( decl->get_members().begin(), 1 ) ) { // xxx - this never triggers because curMember is incremented immediately on construction 353 if ( atbegin ) { // xxx - this never triggers because curMember is incremented immediately on construction 359 if ( atbegin ) { 354 360 // xxx - what about case of empty struct?? 355 361 // only add self if at the very beginning of the structure … … 385 391 return *this; 386 392 } 387 virtual std::list<InitAlternative> first() const { return std::list<InitAlternative>{}; }388 393 }; 389 394 … … 439 444 return new UnionIterator( uit ); 440 445 } else { 441 assertf( dynamic_cast< TypeInstType * >( type ), "some other reftotype");446 assertf( dynamic_cast< EnumInstType * >( type ) || dynamic_cast< TypeInstType * >( type ), "Encountered unhandled ReferenceToType in createMemberIterator: %s", toString( type ).c_str() ); 442 447 return new SimpleIterator( type ); 443 448 } … … 514 519 } // for 515 520 if ( desigAlts.size() > 1 ) { 516 throw SemanticError( toString("Too many alternatives (", desigAlts.size(), ") for designation: "), designation);521 SemanticError( designation, toString("Too many alternatives (", desigAlts.size(), ") for designation: ") ); 517 522 } else if ( desigAlts.size() == 0 ) { 518 throw SemanticError( "No reasonable alternatives for designation: ", designation);523 SemanticError( designation, "No reasonable alternatives for designation: " ); 519 524 } 520 525 DesignatorChain & d = desigAlts.back(); -
src/ResolvExpr/ExplodedActual.h
rf9feab8 r90152a4 32 32 33 33 ExplodedActual() : env(), cost(Cost::zero), exprs() {} 34 35 34 ExplodedActual( const Alternative& actual, const SymTab::Indexer& indexer ); 35 ExplodedActual(ExplodedActual&&) = default; 36 ExplodedActual& operator= (ExplodedActual&&) = default; 36 37 }; 37 38 } -
src/ResolvExpr/FindOpenVars.cc
rf9feab8 r90152a4 19 19 #include <map> // for map<>::mapped_type 20 20 21 #include "Common/PassVisitor.h" 21 22 #include "SynTree/Declaration.h" // for TypeDecl, DeclarationWithType (ptr ... 22 23 #include "SynTree/Type.h" // for Type, Type::ForallList, ArrayType 23 #include "SynTree/Visitor.h" // for Visitor24 24 25 25 namespace ResolvExpr { 26 class FindOpenVars : public Visitor { 27 public: 26 struct FindOpenVars : public WithGuards { 28 27 FindOpenVars( OpenVarSet &openVars, OpenVarSet &closedVars, AssertionSet &needAssertions, AssertionSet &haveAssertions, bool firstIsOpen ); 29 28 30 private: 31 virtual void visit(PointerType *pointerType); 32 virtual void visit(ArrayType *arrayType); 33 virtual void visit(FunctionType *functionType); 34 virtual void visit(TupleType *tupleType); 29 void previsit( PointerType * pointerType ); 30 void previsit( ArrayType * arrayType ); 31 void previsit( FunctionType * functionType ); 32 void previsit( TupleType * tupleType ); 35 33 36 34 void common_action( Type *type ); … … 42 40 43 41 void findOpenVars( Type *type, OpenVarSet &openVars, OpenVarSet &closedVars, AssertionSet &needAssertions, AssertionSet &haveAssertions, bool firstIsOpen ) { 44 FindOpenVarsfinder( openVars, closedVars, needAssertions, haveAssertions, firstIsOpen );42 PassVisitor<FindOpenVars> finder( openVars, closedVars, needAssertions, haveAssertions, firstIsOpen ); 45 43 type->accept( finder ); 46 44 } … … 70 68 } // for 71 69 } // if 72 /// std::c out<< "type is ";73 /// type->print( std::c out);74 /// std::c out<< std::endl << "need is" << std::endl;75 /// printAssertionSet( needAssertions, std::c out);76 /// std::c out<< std::endl << "have is" << std::endl;77 /// printAssertionSet( haveAssertions, std::c out);70 /// std::cerr << "type is "; 71 /// type->print( std::cerr ); 72 /// std::cerr << std::endl << "need is" << std::endl; 73 /// printAssertionSet( needAssertions, std::cerr ); 74 /// std::cerr << std::endl << "have is" << std::endl; 75 /// printAssertionSet( haveAssertions, std::cerr ); 78 76 } 79 77 80 void FindOpenVars:: visit(PointerType *pointerType) {78 void FindOpenVars::previsit(PointerType *pointerType) { 81 79 common_action( pointerType ); 82 Visitor::visit( pointerType );83 80 } 84 81 85 void FindOpenVars:: visit(ArrayType *arrayType) {82 void FindOpenVars::previsit(ArrayType *arrayType) { 86 83 common_action( arrayType ); 87 Visitor::visit( arrayType );88 84 } 89 85 90 void FindOpenVars:: visit(FunctionType *functionType) {86 void FindOpenVars::previsit(FunctionType *functionType) { 91 87 common_action( functionType ); 92 88 nextIsOpen = ! nextIsOpen; 93 Visitor::visit( functionType ); 94 nextIsOpen = ! nextIsOpen; 89 GuardAction( [this](){ nextIsOpen = ! nextIsOpen; } ); 95 90 } 96 91 97 void FindOpenVars:: visit(TupleType *tupleType) {92 void FindOpenVars::previsit(TupleType *tupleType) { 98 93 common_action( tupleType ); 99 Visitor::visit( tupleType );100 94 } 101 95 } // namespace ResolvExpr -
src/ResolvExpr/Occurs.cc
rf9feab8 r90152a4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Occurs.cc -- 7 // Occurs.cc -- 8 8 // 9 9 // Author : Richard C. Bilson … … 17 17 #include <string> // for string 18 18 19 #include "Common/PassVisitor.h" 19 20 #include "SynTree/Type.h" // for TypeInstType, Type 20 #include "SynTree/Visitor.h" // for Visitor21 21 #include "TypeEnvironment.h" // for EqvClass, TypeEnvironment 22 22 23 23 namespace ResolvExpr { 24 class Occurs : public Visitor { 25 public: 24 struct Occurs : public WithVisitorRef<Occurs> { 26 25 Occurs( std::string varName, const TypeEnvironment &env ); 27 bool get_result() const { return result; } 28 virtual void visit( TypeInstType *typeInst ); 29 private: 26 void previsit( TypeInstType * typeInst ); 27 30 28 bool result; 31 29 std::set< std::string > eqvVars; 32 const TypeEnvironment & env;30 const TypeEnvironment &tenv; 33 31 }; 34 32 35 33 bool occurs( Type *type, std::string varName, const TypeEnvironment &env ) { 36 Occursoccur( varName, env );34 PassVisitor<Occurs> occur( varName, env ); 37 35 type->accept( occur ); 38 return occur. get_result();36 return occur.pass.result; 39 37 } 40 38 41 Occurs::Occurs( std::string varName, const TypeEnvironment &env ) : result( false ), env( env ) { 42 EqvClass eqvClass; 43 if ( env.lookup( varName, eqvClass ) ) { 44 eqvVars = eqvClass.vars; 39 Occurs::Occurs( std::string varName, const TypeEnvironment & env ) : result( false ), tenv( env ) { 40 if ( const EqvClass *eqvClass = tenv.lookup( varName ) ) { 41 eqvVars = eqvClass->vars; 45 42 } else { 46 43 eqvVars.insert( varName ); … … 48 45 } 49 46 50 void Occurs::visit( TypeInstType *typeInst ) { 51 EqvClass eqvClass; 52 /// std::cout << "searching for vars: "; 53 /// std::copy( eqvVars.begin(), eqvVars.end(), std::ostream_iterator< std::string >( std::cout, " " ) ); 54 /// std::cout << std::endl; 47 void Occurs::previsit( TypeInstType * typeInst ) { 48 /// std::cerr << "searching for vars: "; 49 /// std::copy( eqvVars.begin(), eqvVars.end(), std::ostream_iterator< std::string >( std::cerr, " " ) ); 50 /// std::cerr << std::endl; 55 51 if ( eqvVars.find( typeInst->get_name() ) != eqvVars.end() ) { 56 52 result = true; 57 } else if ( env.lookup( typeInst->get_name(), eqvClass) ) {58 if ( eqvClass .type ) {59 /// std::c out<< typeInst->get_name() << " is bound to";60 /// eqvClass.type->print( std::c out);61 /// std::c out<< std::endl;62 eqvClass .type->accept( *this);53 } else if ( const EqvClass *eqvClass = tenv.lookup( typeInst->get_name() ) ) { 54 if ( eqvClass->type ) { 55 /// std::cerr << typeInst->get_name() << " is bound to"; 56 /// eqvClass.type->print( std::cerr ); 57 /// std::cerr << std::endl; 58 eqvClass->type->accept( *visitor ); 63 59 } // if 64 60 } // if -
src/ResolvExpr/PolyCost.cc
rf9feab8 r90152a4 14 14 // 15 15 16 #include "Common/PassVisitor.h" 16 17 #include "SymTab/Indexer.h" // for Indexer 17 18 #include "SynTree/Type.h" // for TypeInstType, Type 18 #include "SynTree/Visitor.h" // for Visitor19 19 #include "TypeEnvironment.h" // for EqvClass, TypeEnvironment 20 20 21 21 namespace ResolvExpr { 22 class PolyCost : public Visitor { 23 public: 22 struct PolyCost { 24 23 PolyCost( const TypeEnvironment &env, const SymTab::Indexer &indexer ); 25 int get_result() const { return result; } 26 private: 27 virtual void visit(TypeInstType *aggregateUseType); 24 25 void previsit( TypeInstType * aggregateUseType ); 28 26 int result; 29 const TypeEnvironment & env;27 const TypeEnvironment &tenv; 30 28 const SymTab::Indexer &indexer; 31 29 }; 32 30 33 31 int polyCost( Type *type, const TypeEnvironment & env, const SymTab::Indexer &indexer ) { 34 P olyCostcoster( env, indexer );32 PassVisitor<PolyCost> coster( env, indexer ); 35 33 type->accept( coster ); 36 return coster. get_result();34 return coster.pass.result; 37 35 } 38 36 39 PolyCost::PolyCost( const TypeEnvironment & env, const SymTab::Indexer & indexer ) : result( 0 ), env( env ), indexer( indexer ) {37 PolyCost::PolyCost( const TypeEnvironment & env, const SymTab::Indexer & indexer ) : result( 0 ), tenv( env ), indexer( indexer ) { 40 38 } 41 39 42 void PolyCost::visit(TypeInstType * typeInst) { 43 EqvClass eqvClass; 44 if ( env.lookup( typeInst->name, eqvClass ) ) { 45 if ( eqvClass.type ) { 46 if ( TypeInstType * otherTypeInst = dynamic_cast< TypeInstType* >( eqvClass.type ) ) { 40 void PolyCost::previsit(TypeInstType * typeInst) { 41 if ( const EqvClass *eqvClass = tenv.lookup( typeInst->name ) ) { 42 if ( eqvClass->type ) { 43 if ( TypeInstType * otherTypeInst = dynamic_cast< TypeInstType* >( eqvClass->type ) ) { 47 44 if ( indexer.lookupType( otherTypeInst->name ) ) { 48 45 // bound to opaque type -
src/ResolvExpr/PtrsAssignable.cc
rf9feab8 r90152a4 14 14 // 15 15 16 #include "Common/PassVisitor.h" 16 17 #include "ResolvExpr/TypeEnvironment.h" // for EqvClass, TypeEnvironment 17 18 #include "SynTree/Type.h" // for TypeInstType, Type, BasicType … … 20 21 21 22 namespace ResolvExpr { 22 class PtrsAssignable : public Visitor { 23 public: 23 struct PtrsAssignable : public WithShortCircuiting { 24 24 PtrsAssignable( Type *dest, const TypeEnvironment &env ); 25 25 26 26 int get_result() const { return result; } 27 27 28 virtual void visit( VoidType *voidType ); 29 virtual void visit( BasicType *basicType ); 30 virtual void visit( PointerType *pointerType ); 31 virtual void visit( ArrayType *arrayType ); 32 virtual void visit( FunctionType *functionType ); 33 virtual void visit( StructInstType *inst ); 34 virtual void visit( UnionInstType *inst ); 35 virtual void visit( EnumInstType *inst ); 36 virtual void visit( TraitInstType *inst ); 37 virtual void visit( TypeInstType *inst ); 38 virtual void visit( TupleType *tupleType ); 39 virtual void visit( VarArgsType *varArgsType ); 40 virtual void visit( ZeroType *zeroType ); 41 virtual void visit( OneType *oneType ); 28 void previsit( Type * ) { visit_children = false; } 29 30 void postvisit( VoidType * voidType ); 31 void postvisit( BasicType * basicType ); 32 void postvisit( PointerType * pointerType ); 33 void postvisit( ArrayType * arrayType ); 34 void postvisit( FunctionType * functionType ); 35 void postvisit( StructInstType * inst ); 36 void postvisit( UnionInstType * inst ); 37 void postvisit( EnumInstType * inst ); 38 void postvisit( TraitInstType * inst ); 39 void postvisit( TypeInstType * inst ); 40 void postvisit( TupleType * tupleType ); 41 void postvisit( VarArgsType * varArgsType ); 42 void postvisit( ZeroType * zeroType ); 43 void postvisit( OneType * oneType ); 42 44 private: 43 45 Type *dest; … … 49 51 // std::cerr << "assignable: " << src << " | " << dest << std::endl; 50 52 if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) { 51 EqvClass eqvClass; 52 if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) { 53 return ptrsAssignable( src, eqvClass.type, env ); 53 if ( const EqvClass *eqvClass = env.lookup( destAsTypeInst->get_name() ) ) { 54 return ptrsAssignable( src, eqvClass->type, env ); 54 55 } // if 55 56 } // if … … 59 60 return -1; 60 61 } else { 61 P trsAssignableptrs( dest, env );62 PassVisitor<PtrsAssignable> ptrs( dest, env ); 62 63 src->accept( ptrs ); 63 return ptrs. get_result();64 return ptrs.pass.get_result(); 64 65 } // if 65 66 } … … 67 68 PtrsAssignable::PtrsAssignable( Type *dest, const TypeEnvironment &env ) : dest( dest ), result( 0 ), env( env ) {} 68 69 69 void PtrsAssignable:: visit( __attribute((unused)) VoidType *voidType) {70 void PtrsAssignable::postvisit( VoidType * ) { 70 71 // T * = void * is disallowed - this is a change from C, where any 71 72 // void * can be assigned or passed to a non-void pointer without a cast. 72 73 } 73 74 74 void PtrsAssignable:: visit( __attribute__((unused)) BasicType *basicType ) {}75 void PtrsAssignable:: visit( __attribute__((unused)) PointerType *pointerType ) {}76 void PtrsAssignable:: visit( __attribute__((unused)) ArrayType *arrayType ) {}77 void PtrsAssignable:: visit( __attribute__((unused)) FunctionType *functionType ) {}75 void PtrsAssignable::postvisit( __attribute__((unused)) BasicType *basicType ) {} 76 void PtrsAssignable::postvisit( __attribute__((unused)) PointerType *pointerType ) {} 77 void PtrsAssignable::postvisit( __attribute__((unused)) ArrayType *arrayType ) {} 78 void PtrsAssignable::postvisit( __attribute__((unused)) FunctionType *functionType ) {} 78 79 79 void PtrsAssignable:: visit( __attribute__((unused)) StructInstType *inst ) {}80 void PtrsAssignable:: visit( __attribute__((unused)) UnionInstType *inst ) {}80 void PtrsAssignable::postvisit( __attribute__((unused)) StructInstType *inst ) {} 81 void PtrsAssignable::postvisit( __attribute__((unused)) UnionInstType *inst ) {} 81 82 82 void PtrsAssignable:: visit( EnumInstType * ) {83 void PtrsAssignable::postvisit( EnumInstType * ) { 83 84 if ( dynamic_cast< BasicType* >( dest ) ) { 84 85 // int * = E *, etc. is safe. This isn't technically correct, as each … … 91 92 } 92 93 93 void PtrsAssignable::visit( __attribute__((unused)) TraitInstType *inst ) {} 94 void PtrsAssignable::visit( TypeInstType *inst ) { 95 EqvClass eqvClass; 96 if ( env.lookup( inst->get_name(), eqvClass ) && eqvClass.type ) { 97 // T * = S * for any S depends on the type bound to T 98 result = ptrsAssignable( eqvClass.type, dest, env ); 94 void PtrsAssignable::postvisit( __attribute__((unused)) TraitInstType *inst ) {} 95 void PtrsAssignable::postvisit( TypeInstType *inst ) { 96 if ( const EqvClass *eqvClass = env.lookup( inst->get_name() ) ) { 97 if ( eqvClass->type ) { 98 // T * = S * for any S depends on the type bound to T 99 result = ptrsAssignable( eqvClass->type, dest, env ); 100 } 99 101 } // if 100 102 } 101 103 102 void PtrsAssignable:: visit( __attribute__((unused)) TupleType *tupleType ) {}103 void PtrsAssignable:: visit( __attribute__((unused)) VarArgsType *varArgsType ) {}104 void PtrsAssignable:: visit( __attribute__((unused)) ZeroType *zeroType ) {}105 void PtrsAssignable:: visit( __attribute__((unused)) OneType *oneType ) {}104 void PtrsAssignable::postvisit( __attribute__((unused)) TupleType *tupleType ) {} 105 void PtrsAssignable::postvisit( __attribute__((unused)) VarArgsType *varArgsType ) {} 106 void PtrsAssignable::postvisit( __attribute__((unused)) ZeroType *zeroType ) {} 107 void PtrsAssignable::postvisit( __attribute__((unused)) OneType *oneType ) {} 106 108 107 109 } // namespace ResolvExpr -
src/ResolvExpr/PtrsCastable.cc
rf9feab8 r90152a4 14 14 // 15 15 16 #include "Common/PassVisitor.h" 16 17 #include "ResolvExpr/TypeEnvironment.h" // for EqvClass, TypeEnvironment 17 18 #include "SymTab/Indexer.h" // for Indexer … … 21 22 #include "typeops.h" // for ptrsAssignable 22 23 23 24 24 namespace ResolvExpr { 25 class PtrsCastable : public Visitor{25 struct PtrsCastable : public WithShortCircuiting { 26 26 public: 27 27 PtrsCastable( Type *dest, const TypeEnvironment &env, const SymTab::Indexer &indexer ); … … 29 29 int get_result() const { return result; } 30 30 31 virtual void visit(VoidType *voidType); 32 virtual void visit(BasicType *basicType); 33 virtual void visit(PointerType *pointerType); 34 virtual void visit(ArrayType *arrayType); 35 virtual void visit(FunctionType *functionType); 36 virtual void visit(StructInstType *inst); 37 virtual void visit(UnionInstType *inst); 38 virtual void visit(EnumInstType *inst); 39 virtual void visit(TraitInstType *inst); 40 virtual void visit(TypeInstType *inst); 41 virtual void visit(TupleType *tupleType); 42 virtual void visit(VarArgsType *varArgsType); 43 virtual void visit(ZeroType *zeroType); 44 virtual void visit(OneType *oneType); 31 void previsit( Type * ) { visit_children = false; } 32 33 void postvisit( VoidType * voidType ); 34 void postvisit( BasicType * basicType ); 35 void postvisit( PointerType * pointerType ); 36 void postvisit( ArrayType * arrayType ); 37 void postvisit( FunctionType * functionType ); 38 void postvisit( StructInstType * inst ); 39 void postvisit( UnionInstType * inst ); 40 void postvisit( EnumInstType * inst ); 41 void postvisit( TraitInstType * inst ); 42 void postvisit( TypeInstType * inst ); 43 void postvisit( TupleType * tupleType ); 44 void postvisit( VarArgsType * varArgsType ); 45 void postvisit( ZeroType * zeroType ); 46 void postvisit( OneType * oneType ); 45 47 private: 46 48 Type *dest; … … 55 57 return -1; 56 58 } else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( src ) ) { 57 EqvClass eqvClass;58 59 if ( NamedTypeDecl *ntDecl = indexer.lookupType( typeInst->get_name() ) ) { 59 60 if ( TypeDecl *tyDecl = dynamic_cast< TypeDecl* >( ntDecl ) ) { … … 62 63 } // if 63 64 } //if 64 } else if ( env.lookup( typeInst->get_name(), eqvClass) ) {65 if ( eqvClass .data.kind == TypeDecl::Ftype ) {65 } else if ( const EqvClass *eqvClass = env.lookup( typeInst->get_name() ) ) { 66 if ( eqvClass->data.kind == TypeDecl::Ftype ) { 66 67 return -1; 67 68 } // if … … 77 78 int ptrsCastable( Type *src, Type *dest, const TypeEnvironment &env, const SymTab::Indexer &indexer ) { 78 79 if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) { 79 EqvClass eqvClass;80 if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) {81 return ptrsAssignable( src, eqvClass .type, env );80 if ( const EqvClass *eqvClass = env.lookup( destAsTypeInst->get_name() ) ) { 81 // xxx - should this be ptrsCastable? 82 return ptrsAssignable( src, eqvClass->type, env ); 82 83 } // if 83 84 } // if … … 85 86 return objectCast( src, env, indexer ); 86 87 } else { 87 P trsCastableptrs( dest, env, indexer );88 PassVisitor<PtrsCastable> ptrs( dest, env, indexer ); 88 89 src->accept( ptrs ); 89 return ptrs. get_result();90 return ptrs.pass.get_result(); 90 91 } // if 91 92 } … … 95 96 } 96 97 97 void PtrsCastable:: visit( VoidType * ) {98 void PtrsCastable::postvisit( VoidType * ) { 98 99 result = objectCast( dest, env, indexer ); 99 100 } 100 101 101 void PtrsCastable:: visit( BasicType * ) {102 void PtrsCastable::postvisit( BasicType * ) { 102 103 result = objectCast( dest, env, indexer ); 103 104 } 104 105 105 void PtrsCastable:: visit( PointerType * ) {106 void PtrsCastable::postvisit( PointerType * ) { 106 107 result = objectCast( dest, env, indexer ); 107 108 } 108 109 109 void PtrsCastable:: visit( ArrayType * ) {110 void PtrsCastable::postvisit( ArrayType * ) { 110 111 result = objectCast( dest, env, indexer ); 111 112 } 112 113 113 void PtrsCastable:: visit( FunctionType * ) {114 void PtrsCastable::postvisit( FunctionType * ) { 114 115 // result = -1; 115 116 result = functionCast( dest, env, indexer ); 116 117 } 117 118 118 void PtrsCastable:: visit( StructInstType * ) {119 void PtrsCastable::postvisit( StructInstType * ) { 119 120 result = objectCast( dest, env, indexer ); 120 121 } 121 122 122 void PtrsCastable:: visit( UnionInstType * ) {123 void PtrsCastable::postvisit( UnionInstType * ) { 123 124 result = objectCast( dest, env, indexer ); 124 125 } 125 126 126 void PtrsCastable:: visit( EnumInstType * ) {127 void PtrsCastable::postvisit( EnumInstType * ) { 127 128 if ( dynamic_cast< EnumInstType* >( dest ) ) { 128 129 result = 1; … … 138 139 } 139 140 140 void PtrsCastable:: visit( TraitInstType * ) {}141 void PtrsCastable::postvisit( TraitInstType * ) {} 141 142 142 void PtrsCastable:: visit(TypeInstType *inst) {143 void PtrsCastable::postvisit(TypeInstType *inst) { 143 144 //result = objectCast( inst, env, indexer ) > 0 && objectCast( dest, env, indexer ) > 0 ? 1 : -1; 144 145 result = objectCast( inst, env, indexer ) == objectCast( dest, env, indexer ) ? 1 : -1; 145 146 } 146 147 147 void PtrsCastable:: visit( TupleType * ) {148 void PtrsCastable::postvisit( TupleType * ) { 148 149 result = objectCast( dest, env, indexer ); 149 150 } 150 151 151 void PtrsCastable:: visit( VarArgsType * ) {152 void PtrsCastable::postvisit( VarArgsType * ) { 152 153 result = objectCast( dest, env, indexer ); 153 154 } 154 155 155 void PtrsCastable:: visit( ZeroType * ) {156 void PtrsCastable::postvisit( ZeroType * ) { 156 157 result = objectCast( dest, env, indexer ); 157 158 } 158 159 159 void PtrsCastable:: visit( OneType * ) {160 void PtrsCastable::postvisit( OneType * ) { 160 161 result = objectCast( dest, env, indexer ); 161 162 } -
src/ResolvExpr/RenameVars.cc
rf9feab8 r90152a4 19 19 #include <utility> // for pair 20 20 21 #include "Common/PassVisitor.h" 21 22 #include "Common/SemanticError.h" // for SemanticError 22 23 #include "RenameVars.h" … … 27 28 28 29 namespace ResolvExpr { 29 RenameVars global_renamer; 30 namespace { 31 struct RenameVars { 32 RenameVars(); 33 void reset(); 30 34 31 RenameVars::RenameVars() : level( 0 ), resetCount( 0 ) { 32 mapStack.push_front( std::map< std::string, std::string >() ); 35 void previsit( TypeInstType * instType ); 36 void previsit( Type * ); 37 void postvisit( Type * ); 38 39 private: 40 int level, resetCount; 41 std::list< std::map< std::string, std::string > > mapStack; 42 }; 43 44 PassVisitor<RenameVars> global_renamer; 45 } // namespace 46 47 void renameTyVars( Type * t ) { 48 t->accept( global_renamer ); 33 49 } 34 50 35 void RenameVars::reset() { 36 level = 0; 37 resetCount++; 51 void resetTyVarRenaming() { 52 global_renamer.pass.reset(); 38 53 } 39 54 40 void RenameVars::visit( VoidType *voidType ){41 typeBefore( voidType );42 typeAfter( voidType);43 }55 namespace { 56 RenameVars::RenameVars() : level( 0 ), resetCount( 0 ) { 57 mapStack.push_front( std::map< std::string, std::string >() ); 58 } 44 59 45 void RenameVars::visit( BasicType *basicType) {46 typeBefore( basicType );47 typeAfter( basicType );48 }60 void RenameVars::reset() { 61 level = 0; 62 resetCount++; 63 } 49 64 50 void RenameVars::visit( PointerType *pointerType ) { 51 typeBefore( pointerType ); 52 maybeAccept( pointerType->get_base(), *this ); 53 typeAfter( pointerType ); 54 } 65 void RenameVars::previsit( TypeInstType * instType ) { 66 previsit( (Type *)instType ); 67 std::map< std::string, std::string >::const_iterator i = mapStack.front().find( instType->name ); 68 if ( i != mapStack.front().end() ) { 69 instType->name = i->second; 70 } // if 71 } 55 72 56 void RenameVars::visit( ArrayType *arrayType ) { 57 typeBefore( arrayType ); 58 maybeAccept( arrayType->get_dimension(), *this ); 59 maybeAccept( arrayType->get_base(), *this ); 60 typeAfter( arrayType ); 61 } 73 void RenameVars::previsit( Type * type ) { 74 if ( ! type->forall.empty() ) { 75 // copies current name mapping into new mapping 76 mapStack.push_front( mapStack.front() ); 77 // renames all "forall" type names to `_${level}_${name}' 78 for ( auto td : type->forall ) { 79 std::ostringstream output; 80 output << "_" << resetCount << "_" << level << "_" << td->name; 81 std::string newname( output.str() ); 82 mapStack.front()[ td->get_name() ] = newname; 83 td->name = newname; 84 // ditto for assertion names, the next level in 85 level++; 86 // acceptAll( td->assertions, *this ); 87 } // for 88 } // if 89 } 62 90 63 void RenameVars::visit( FunctionType *functionType ) { 64 typeBefore( functionType ); 65 acceptAll( functionType->get_returnVals(), *this ); 66 acceptAll( functionType->get_parameters(), *this ); 67 typeAfter( functionType ); 68 } 69 70 void RenameVars::visit( StructInstType *aggregateUseType ) { 71 typeBefore( aggregateUseType ); 72 acceptAll( aggregateUseType->get_parameters(), *this ); 73 typeAfter( aggregateUseType ); 74 } 75 76 void RenameVars::visit( UnionInstType *aggregateUseType ) { 77 typeBefore( aggregateUseType ); 78 acceptAll( aggregateUseType->get_parameters(), *this ); 79 typeAfter( aggregateUseType ); 80 } 81 82 void RenameVars::visit( EnumInstType *aggregateUseType ) { 83 typeBefore( aggregateUseType ); 84 acceptAll( aggregateUseType->get_parameters(), *this ); 85 typeAfter( aggregateUseType ); 86 } 87 88 void RenameVars::visit( TraitInstType *aggregateUseType ) { 89 typeBefore( aggregateUseType ); 90 acceptAll( aggregateUseType->get_parameters(), *this ); 91 typeAfter( aggregateUseType ); 92 } 93 94 void RenameVars::visit( TypeInstType *instType ) { 95 typeBefore( instType ); 96 std::map< std::string, std::string >::const_iterator i = mapStack.front().find( instType->get_name() ); 97 if ( i != mapStack.front().end() ) { 98 instType->set_name( i->second ); 99 } else { 100 } // if 101 acceptAll( instType->get_parameters(), *this ); 102 typeAfter( instType ); 103 } 104 105 void RenameVars::visit( TupleType *tupleType ) { 106 typeBefore( tupleType ); 107 acceptAll( tupleType->get_types(), *this ); 108 typeAfter( tupleType ); 109 } 110 111 void RenameVars::visit( VarArgsType *varArgsType ) { 112 typeBefore( varArgsType ); 113 typeAfter( varArgsType ); 114 } 115 116 void RenameVars::visit( ZeroType *zeroType ) { 117 typeBefore( zeroType ); 118 typeAfter( zeroType ); 119 } 120 121 void RenameVars::visit( OneType *oneType ) { 122 typeBefore( oneType ); 123 typeAfter( oneType ); 124 } 125 126 void RenameVars::typeBefore( Type *type ) { 127 if ( ! type->get_forall().empty() ) { 128 // copies current name mapping into new mapping 129 mapStack.push_front( mapStack.front() ); 130 // renames all "forall" type names to `_${level}_${name}' 131 for ( Type::ForallList::iterator i = type->get_forall().begin(); i != type->get_forall().end(); ++i ) { 132 std::ostringstream output; 133 output << "_" << resetCount << "_" << level << "_" << (*i)->get_name(); 134 std::string newname( output.str() ); 135 mapStack.front()[ (*i)->get_name() ] = newname; 136 (*i)->set_name( newname ); 137 // ditto for assertion names, the next level in 138 level++; 139 acceptAll( (*i)->get_assertions(), *this ); 140 } // for 141 } // if 142 } 143 144 void RenameVars::typeAfter( Type *type ) { 145 // clears name mapping added by typeBefore() 146 if ( ! type->get_forall().empty() ) { 147 mapStack.pop_front(); 148 } // if 149 } 150 91 void RenameVars::postvisit( Type * type ) { 92 // clears name mapping added by typeBefore() 93 if ( ! type->forall.empty() ) { 94 mapStack.pop_front(); 95 } // if 96 } 97 } // namespace 151 98 } // namespace ResolvExpr 152 99 -
src/ResolvExpr/RenameVars.h
rf9feab8 r90152a4 24 24 25 25 namespace ResolvExpr { 26 /// Provides a consistent renaming of forall type names in a hierarchy by prefixing them with a unique "level" ID 27 void renameTyVars( Type * ); 26 28 27 /// Provides a consistent renaming of forall type names in a hierarchy by prefixing them with a unique "level" ID 28 class RenameVars : public Visitor { 29 public: 30 RenameVars(); 31 void reset(); 32 private: 33 virtual void visit( VoidType *basicType ); 34 virtual void visit( BasicType *basicType ); 35 virtual void visit( PointerType *pointerType ); 36 virtual void visit( ArrayType *arrayType ); 37 virtual void visit( FunctionType *functionType ); 38 virtual void visit( StructInstType *aggregateUseType ); 39 virtual void visit( UnionInstType *aggregateUseType ); 40 virtual void visit( EnumInstType *aggregateUseType ); 41 virtual void visit( TraitInstType *aggregateUseType ); 42 virtual void visit( TypeInstType *aggregateUseType ); 43 virtual void visit( TupleType *tupleType ); 44 virtual void visit( VarArgsType *varArgsType ); 45 virtual void visit( ZeroType *zeroType ); 46 virtual void visit( OneType *oneType ); 47 48 void typeBefore( Type *type ); 49 void typeAfter( Type *type ); 50 int level, resetCount; 51 std::list< std::map< std::string, std::string > > mapStack; 52 }; 53 54 extern RenameVars global_renamer; 29 /// resets internal state of renamer to avoid overflow 30 void resetTyVarRenaming(); 55 31 } // namespace ResolvExpr 56 32 -
src/ResolvExpr/Resolver.cc
rf9feab8 r90152a4 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 12:17:01 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Tus Aug 8 16:06:00 201713 // Update Count : 21 211 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Feb 17 11:19:40 2018 13 // Update Count : 213 14 14 // 15 15 … … 30 30 #include "RenameVars.h" // for RenameVars, global_renamer 31 31 #include "ResolvExpr/TypeEnvironment.h" // for TypeEnvironment 32 #include "ResolveTypeof.h" // for resolveTypeof33 32 #include "Resolver.h" 34 33 #include "SymTab/Autogen.h" // for SizeType … … 57 56 void postvisit( FunctionDecl *functionDecl ); 58 57 void previsit( ObjectDecl *objectDecll ); 59 void previsit( TypeDecl *typeDecl );60 58 void previsit( EnumDecl * enumDecl ); 59 void previsit( StaticAssertDecl * assertDecl ); 61 60 62 61 void previsit( ArrayType * at ); … … 76 75 void previsit( CatchStmt *catchStmt ); 77 76 void previsit( WaitForStmt * stmt ); 78 void previsit( WithStmt * withStmt );79 77 80 78 void previsit( SingleInit *singleInit ); … … 82 80 void previsit( ConstructorInit *ctorInit ); 83 81 private: 84 82 typedef std::list< Initializer * >::iterator InitIterator; 85 83 86 84 template< typename PtrType > 87 85 void handlePtrType( PtrType * type ); 88 86 89 void resolveAggrInit( ReferenceToType *, InitIterator &, InitIterator & ); 90 void resolveSingleAggrInit( Declaration *, InitIterator &, InitIterator &, TypeSubstitution sub ); 91 void fallbackInit( ConstructorInit * ctorInit ); 87 void fallbackInit( ConstructorInit * ctorInit ); 92 88 93 89 Type * functionReturn = nullptr; … … 96 92 }; 97 93 94 struct ResolveWithExprs : public WithIndexer, public WithGuards, public WithVisitorRef<ResolveWithExprs>, public WithShortCircuiting, public WithStmtsToAdd { 95 void previsit( FunctionDecl * ); 96 void previsit( WithStmt * ); 97 98 void resolveWithExprs( std::list< Expression * > & withExprs, std::list< Statement * > & newStmts ); 99 }; 100 98 101 void resolve( std::list< Declaration * > translationUnit ) { 99 102 PassVisitor<Resolver> resolver; … … 106 109 } 107 110 108 // used in resolveTypeof109 Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer ) {110 TypeEnvironment env;111 return resolveInVoidContext( expr, indexer, env );112 }113 114 111 namespace { 115 void finishExpr( Expression *expr, const TypeEnvironment &env, TypeSubstitution * oldenv = nullptr ) { 112 struct DeleteFinder : public WithShortCircuiting { 113 DeletedExpr * delExpr = nullptr; 114 void previsit( DeletedExpr * expr ) { 115 if ( delExpr ) visit_children = false; 116 else delExpr = expr; 117 } 118 119 void previsit( Expression * ) { 120 if ( delExpr ) visit_children = false; 121 } 122 }; 123 } 124 125 DeletedExpr * findDeletedExpr( Expression * expr ) { 126 PassVisitor<DeleteFinder> finder; 127 expr->accept( finder ); 128 return finder.pass.delExpr; 129 } 130 131 namespace { 132 struct StripCasts { 133 Expression * postmutate( CastExpr * castExpr ) { 134 if ( castExpr->isGenerated && ResolvExpr::typesCompatible( castExpr->arg->result, castExpr->result, SymTab::Indexer() ) ) { 135 // generated cast is to the same type as its argument, so it's unnecessary -- remove it 136 Expression * expr = castExpr->arg; 137 castExpr->arg = nullptr; 138 std::swap( expr->env, castExpr->env ); 139 return expr; 140 } 141 return castExpr; 142 } 143 144 static void strip( Expression *& expr ) { 145 PassVisitor<StripCasts> stripper; 146 expr = expr->acceptMutator( stripper ); 147 } 148 }; 149 150 void finishExpr( Expression *&expr, const TypeEnvironment &env, TypeSubstitution * oldenv = nullptr ) { 116 151 expr->env = oldenv ? oldenv->clone() : new TypeSubstitution; 117 env.makeSubstitution( *expr->get_env() ); 152 env.makeSubstitution( *expr->env ); 153 StripCasts::strip( expr ); // remove unnecessary casts that may be buried in an expression 118 154 } 119 155 … … 131 167 } // namespace 132 168 169 namespace { 170 void findUnfinishedKindExpression(Expression * untyped, Alternative & alt, const SymTab::Indexer & indexer, const std::string & kindStr, std::function<bool(const Alternative &)> pred, bool adjust = false, bool prune = true, bool failFast = true) { 171 assertf( untyped, "expected a non-null expression." ); 172 TypeEnvironment env; 173 AlternativeFinder finder( indexer, env ); 174 finder.find( untyped, adjust, prune, failFast ); 175 176 #if 0 177 if ( finder.get_alternatives().size() != 1 ) { 178 std::cerr << "untyped expr is "; 179 untyped->print( std::cerr ); 180 std::cerr << std::endl << "alternatives are:"; 181 for ( const Alternative & alt : finder.get_alternatives() ) { 182 alt.print( std::cerr ); 183 } // for 184 } // if 185 #endif 186 187 AltList candidates; 188 for ( Alternative & alt : finder.get_alternatives() ) { 189 if ( pred( alt ) ) { 190 candidates.push_back( std::move( alt ) ); 191 } 192 } 193 194 // xxx - if > 1 alternative with same cost, ignore deleted and pick from remaining 195 // choose the lowest cost expression among the candidates 196 AltList winners; 197 findMinCost( candidates.begin(), candidates.end(), back_inserter( winners ) ); 198 if ( winners.size() == 0 ) { 199 SemanticError( untyped, toString( "No reasonable alternatives for ", kindStr, (kindStr != "" ? " " : ""), "expression: ") ); 200 } else if ( winners.size() != 1 ) { 201 std::ostringstream stream; 202 stream << "Cannot choose between " << winners.size() << " alternatives for " << kindStr << (kindStr != "" ? " " : "") << "expression\n"; 203 untyped->print( stream ); 204 stream << " Alternatives are:\n"; 205 printAlts( winners, stream, 1 ); 206 SemanticError( untyped->location, stream.str() ); 207 } 208 209 // there is one unambiguous interpretation - move the expression into the with statement 210 Alternative & choice = winners.front(); 211 if ( findDeletedExpr( choice.expr ) ) { 212 SemanticError( untyped->location, choice.expr, "Unique best alternative includes deleted identifier in " ); 213 } 214 alt = std::move( choice ); 215 } 216 217 /// resolve `untyped` to the expression whose alternative satisfies `pred` with the lowest cost; kindStr is used for providing better error messages 218 void findKindExpression(Expression *& untyped, const SymTab::Indexer & indexer, const std::string & kindStr, std::function<bool(const Alternative &)> pred, bool adjust = false, bool prune = true, bool failFast = true) { 219 if ( ! untyped ) return; 220 Alternative choice; 221 findUnfinishedKindExpression( untyped, choice, indexer, kindStr, pred, adjust, prune, failFast ); 222 finishExpr( choice.expr, choice.env, untyped->env ); 223 delete untyped; 224 untyped = choice.expr; 225 choice.expr = nullptr; 226 } 227 228 bool standardAlternativeFilter( const Alternative & ) { 229 // currently don't need to filter, under normal circumstances. 230 // in the future, this may be useful for removing deleted expressions 231 return true; 232 } 233 } // namespace 234 235 // used in resolveTypeof 236 Expression * resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer ) { 237 TypeEnvironment env; 238 return resolveInVoidContext( expr, indexer, env ); 239 } 240 241 Expression * resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer, TypeEnvironment &env ) { 242 // it's a property of the language that a cast expression has either 1 or 0 interpretations; if it has 0 243 // interpretations, an exception has already been thrown. 244 assertf( expr, "expected a non-null expression." ); 245 246 static CastExpr untyped( nullptr ); // cast to void 247 untyped.location = expr->location; 248 249 // set up and resolve expression cast to void 250 untyped.arg = expr; 251 Alternative choice; 252 findUnfinishedKindExpression( &untyped, choice, indexer, "", standardAlternativeFilter, true ); 253 CastExpr * castExpr = strict_dynamic_cast< CastExpr * >( choice.expr ); 254 env = std::move( choice.env ); 255 256 // clean up resolved expression 257 Expression * ret = castExpr->arg; 258 castExpr->arg = nullptr; 259 260 // unlink the arg so that it isn't deleted twice at the end of the program 261 untyped.arg = nullptr; 262 return ret; 263 } 264 133 265 void findVoidExpression( Expression *& untyped, const SymTab::Indexer &indexer ) { 134 global_renamer.reset();266 resetTyVarRenaming(); 135 267 TypeEnvironment env; 136 Expression * newExpr = resolveInVoidContext( untyped, indexer, env );268 Expression * newExpr = resolveInVoidContext( untyped, indexer, env ); 137 269 finishExpr( newExpr, env, untyped->env ); 138 270 delete untyped; … … 141 273 142 274 void findSingleExpression( Expression *&untyped, const SymTab::Indexer &indexer ) { 143 if ( ! untyped ) return; 144 TypeEnvironment env; 145 AlternativeFinder finder( indexer, env ); 146 finder.find( untyped ); 147 #if 0 148 if ( finder.get_alternatives().size() != 1 ) { 149 std::cerr << "untyped expr is "; 150 untyped->print( std::cerr ); 151 std::cerr << std::endl << "alternatives are:"; 152 for ( const Alternative & alt : finder.get_alternatives() ) { 153 alt.print( std::cerr ); 154 } // for 155 } // if 156 #endif 157 assertf( finder.get_alternatives().size() == 1, "findSingleExpression: must have exactly one alternative at the end." ); 158 Alternative &choice = finder.get_alternatives().front(); 159 Expression *newExpr = choice.expr->clone(); 160 finishExpr( newExpr, choice.env, untyped->env ); 161 delete untyped; 162 untyped = newExpr; 275 findKindExpression( untyped, indexer, "", standardAlternativeFilter ); 163 276 } 164 277 165 278 void findSingleExpression( Expression *& untyped, Type * type, const SymTab::Indexer & indexer ) { 166 279 assert( untyped && type ); 280 // transfer location to generated cast for error purposes 281 CodeLocation location = untyped->location; 167 282 untyped = new CastExpr( untyped, type ); 283 untyped->location = location; 168 284 findSingleExpression( untyped, indexer ); 169 285 removeExtraneousCast( untyped, indexer ); … … 171 287 172 288 namespace { 173 bool isIntegralType( Type *type ) { 289 bool isIntegralType( const Alternative & alt ) { 290 Type * type = alt.expr->result; 174 291 if ( dynamic_cast< EnumInstType * >( type ) ) { 175 292 return true; … … 184 301 185 302 void findIntegralExpression( Expression *& untyped, const SymTab::Indexer &indexer ) { 186 TypeEnvironment env; 187 AlternativeFinder finder( indexer, env ); 188 finder.find( untyped ); 189 #if 0 190 if ( finder.get_alternatives().size() != 1 ) { 191 std::cout << "untyped expr is "; 192 untyped->print( std::cout ); 193 std::cout << std::endl << "alternatives are:"; 194 for ( std::list< Alternative >::const_iterator i = finder.get_alternatives().begin(); i != finder.get_alternatives().end(); ++i ) { 195 i->print( std::cout ); 196 } // for 197 } // if 198 #endif 199 Expression *newExpr = 0; 200 const TypeEnvironment *newEnv = 0; 201 for ( AltList::const_iterator i = finder.get_alternatives().begin(); i != finder.get_alternatives().end(); ++i ) { 202 if ( i->expr->get_result()->size() == 1 && isIntegralType( i->expr->get_result() ) ) { 203 if ( newExpr ) { 204 throw SemanticError( "Too many interpretations for case control expression", untyped ); 205 } else { 206 newExpr = i->expr->clone(); 207 newEnv = &i->env; 208 } // if 209 } // if 210 } // for 211 if ( ! newExpr ) { 212 throw SemanticError( "No interpretations for case control expression", untyped ); 213 } // if 214 finishExpr( newExpr, *newEnv, untyped->env ); 215 delete untyped; 216 untyped = newExpr; 217 } 218 303 findKindExpression( untyped, indexer, "condition", isIntegralType ); 304 } 305 } 306 307 308 bool isStructOrUnion( const Alternative & alt ) { 309 Type * t = alt.expr->result->stripReferences(); 310 return dynamic_cast< StructInstType * >( t ) || dynamic_cast< UnionInstType * >( t ); 311 } 312 313 void resolveWithExprs( std::list< Declaration * > & translationUnit ) { 314 PassVisitor<ResolveWithExprs> resolver; 315 acceptAll( translationUnit, resolver ); 316 } 317 318 void ResolveWithExprs::resolveWithExprs( std::list< Expression * > & withExprs, std::list< Statement * > & newStmts ) { 319 for ( Expression *& expr : withExprs ) { 320 // only struct- and union-typed expressions are viable candidates 321 findKindExpression( expr, indexer, "with statement", isStructOrUnion ); 322 323 // if with expression might be impure, create a temporary so that it is evaluated once 324 if ( Tuples::maybeImpure( expr ) ) { 325 static UniqueName tmpNamer( "_with_tmp_" ); 326 ObjectDecl * tmp = ObjectDecl::newObject( tmpNamer.newName(), expr->result->clone(), new SingleInit( expr ) ); 327 expr = new VariableExpr( tmp ); 328 newStmts.push_back( new DeclStmt( tmp ) ); 329 if ( InitTweak::isConstructable( tmp->type ) ) { 330 // generate ctor/dtor and resolve them 331 tmp->init = InitTweak::genCtorInit( tmp ); 332 tmp->accept( *visitor ); 333 } 334 } 335 } 336 } 337 338 void ResolveWithExprs::previsit( WithStmt * withStmt ) { 339 resolveWithExprs( withStmt->exprs, stmtsToAddBefore ); 340 } 341 342 void ResolveWithExprs::previsit( FunctionDecl * functionDecl ) { 343 { 344 // resolve with-exprs with parameters in scope and add any newly generated declarations to the 345 // front of the function body. 346 auto guard = makeFuncGuard( [this]() { indexer.enterScope(); }, [this](){ indexer.leaveScope(); } ); 347 indexer.addFunctionType( functionDecl->type ); 348 std::list< Statement * > newStmts; 349 resolveWithExprs( functionDecl->withExprs, newStmts ); 350 if ( functionDecl->statements ) { 351 functionDecl->statements->kids.splice( functionDecl->statements->kids.begin(), newStmts ); 352 } else { 353 assertf( functionDecl->withExprs.empty() && newStmts.empty(), "Function %s without a body has with-clause and/or generated with declarations.", functionDecl->name.c_str() ); 354 } 355 } 219 356 } 220 357 221 358 void Resolver::previsit( ObjectDecl *objectDecl ) { 222 Type *new_type = resolveTypeof( objectDecl->get_type(), indexer );223 objectDecl->set_type( new_type );224 359 // To handle initialization of routine pointers, e.g., int (*fp)(int) = foo(), means that class-variable 225 360 // initContext is changed multiple time because the LHS is analysed twice. The second analysis changes … … 251 386 } 252 387 253 void Resolver::previsit( TypeDecl *typeDecl ) {254 if ( typeDecl->get_base() ) {255 Type *new_type = resolveTypeof( typeDecl->get_base(), indexer );256 typeDecl->set_base( new_type );257 } // if258 }259 260 388 void Resolver::previsit( FunctionDecl *functionDecl ) { 261 389 #if 0 … … 264 392 std::cerr << std::endl; 265 393 #endif 266 Type *new_type = resolveTypeof( functionDecl->get_type(), indexer );267 functionDecl->set_type( new_type );268 394 GuardValue( functionReturn ); 269 functionReturn = ResolvExpr::extractResultType( functionDecl-> get_functionType());395 functionReturn = ResolvExpr::extractResultType( functionDecl->type ); 270 396 } 271 397 … … 274 400 // xxx - it might be necessary to somehow keep the information from this environment, but I can't currently 275 401 // see how it's useful. 276 for ( Declaration * d : functionDecl-> get_functionType()->get_parameters()) {402 for ( Declaration * d : functionDecl->type->parameters ) { 277 403 if ( ObjectDecl * obj = dynamic_cast< ObjectDecl * >( d ) ) { 278 if ( SingleInit * init = dynamic_cast< SingleInit * >( obj-> get_init()) ) {279 delete init-> get_value()->get_env();280 init-> get_value()->set_env( nullptr );404 if ( SingleInit * init = dynamic_cast< SingleInit * >( obj->init ) ) { 405 delete init->value->env; 406 init->value->env = nullptr; 281 407 } 282 408 } … … 290 416 } 291 417 418 void Resolver::previsit( StaticAssertDecl * assertDecl ) { 419 findIntegralExpression( assertDecl->condition, indexer ); 420 } 421 292 422 void Resolver::previsit( ExprStmt *exprStmt ) { 293 423 visit_children = false; … … 311 441 312 442 void Resolver::previsit( IfStmt *ifStmt ) { 313 find SingleExpression( ifStmt->condition, indexer );443 findIntegralExpression( ifStmt->condition, indexer ); 314 444 } 315 445 316 446 void Resolver::previsit( WhileStmt *whileStmt ) { 317 find SingleExpression( whileStmt->condition, indexer );447 findIntegralExpression( whileStmt->condition, indexer ); 318 448 } 319 449 320 450 void Resolver::previsit( ForStmt *forStmt ) { 321 451 if ( forStmt->condition ) { 322 find SingleExpression( forStmt->condition, indexer );452 findIntegralExpression( forStmt->condition, indexer ); 323 453 } // if 324 454 … … 336 466 337 467 void Resolver::previsit( CaseStmt *caseStmt ) { 338 if ( caseStmt-> get_condition()) {468 if ( caseStmt->condition ) { 339 469 std::list< InitAlternative > initAlts = currentObject.getOptions(); 340 470 assertf( initAlts.size() == 1, "SwitchStmt did not correctly resolve an integral expression." ); … … 342 472 Expression * newExpr = new CastExpr( caseStmt->condition, initAlts.front().type->clone() ); 343 473 findSingleExpression( newExpr, indexer ); 344 CastExpr * castExpr = strict_dynamic_cast< CastExpr * >( newExpr ); 345 caseStmt->condition = castExpr->arg; 346 castExpr->arg = nullptr; 347 delete castExpr; 474 // case condition cannot have a cast in C, so it must be removed, regardless of whether it performs a conversion. 475 // Ideally we would perform the conversion internally here. 476 if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( newExpr ) ) { 477 newExpr = castExpr->arg; 478 castExpr->arg = nullptr; 479 std::swap( newExpr->env, castExpr->env ); 480 delete castExpr; 481 } 482 caseStmt->condition = newExpr; 348 483 } 349 484 } … … 411 546 ss << strict_dynamic_cast<NameExpr*>( clause.target.function )->name; 412 547 ss << "' in call to waitfor"; 413 throw SemanticError( ss.str() ); 548 SemanticError( stmt->location, ss.str() ); 549 } 550 551 if(clause.target.arguments.empty()) { 552 SemanticError( stmt->location, "Waitfor clause must have at least one mutex parameter"); 414 553 } 415 554 … … 428 567 // try matching the arguments to the parameters 429 568 // not the other way around because we have more arguments than parameters 430 SemanticError errors;569 SemanticErrorException errors; 431 570 for ( Alternative & func : funcFinder.get_alternatives() ) { 432 571 try { 433 572 PointerType * pointer = dynamic_cast< PointerType* >( func.expr->get_result()->stripReferences() ); 434 573 if( !pointer ) { 435 throw SemanticError( "candidate not viable: not a pointer type\n", func.expr->get_result());574 SemanticError( func.expr->get_result(), "candidate not viable: not a pointer type\n" ); 436 575 } 437 576 438 577 FunctionType * function = dynamic_cast< FunctionType* >( pointer->get_base() ); 439 578 if( !function ) { 440 throw SemanticError( "candidate not viable: not a function type\n", pointer->get_base());579 SemanticError( pointer->get_base(), "candidate not viable: not a function type\n" ); 441 580 } 442 581 … … 447 586 448 587 if( !advance_to_mutex( param, param_end ) ) { 449 throw SemanticError("candidate function not viable: no mutex parameters\n", function);588 SemanticError(function, "candidate function not viable: no mutex parameters\n"); 450 589 } 451 590 } … … 453 592 Alternative newFunc( func ); 454 593 // Strip reference from function 455 referenceToRvalueConversion( newFunc.expr );594 referenceToRvalueConversion( newFunc.expr, newFunc.cost ); 456 595 457 596 // For all the set of arguments we have try to match it with the parameter of the current function alternative … … 462 601 OpenVarSet openVars; 463 602 AssertionSet resultNeed, resultHave; 464 TypeEnvironment resultEnv; 603 TypeEnvironment resultEnv( func.env ); 604 makeUnifiableVars( function, openVars, resultNeed ); 605 // add all type variables as open variables now so that those not used in the parameter 606 // list are still considered open. 607 resultEnv.add( function->forall ); 465 608 466 609 // Load type variables from arguemnts into one shared space … … 468 611 469 612 // Make sure we don't widen any existing bindings 470 for ( auto & i : resultEnv ) { 471 i.allowWidening = false; 472 } 613 resultEnv.forbidWidening(); 473 614 474 615 // Find any unbound type variables … … 477 618 auto param = function->parameters.begin(); 478 619 auto param_end = function->parameters.end(); 620 621 int n_mutex_param = 0; 479 622 480 623 // For every arguments of its set, check if it matches one of the parameter … … 486 629 // We ran out of parameters but still have arguments 487 630 // this function doesn't match 488 throw SemanticError("candidate function not viable: too many mutex arguments\n", function);631 SemanticError( function, toString("candidate function not viable: too many mutex arguments, expected ", n_mutex_param, "\n" )); 489 632 } 490 633 634 n_mutex_param++; 635 491 636 // Check if the argument matches the parameter type in the current scope 492 if( ! unify( (*param)->get_type(), arg.expr->get_result(), resultEnv, resultNeed, resultHave, openVars, this->indexer ) ) {637 if( ! unify( arg.expr->get_result(), (*param)->get_type(), resultEnv, resultNeed, resultHave, openVars, this->indexer ) ) { 493 638 // Type doesn't match 494 639 stringstream ss; 495 640 ss << "candidate function not viable: no known convertion from '"; 641 (*param)->get_type()->print( ss ); 642 ss << "' to '"; 496 643 arg.expr->get_result()->print( ss ); 497 ss << "' to'";498 (*param)->get_type()->print( ss);644 ss << "' with env '"; 645 resultEnv.print(ss); 499 646 ss << "'\n"; 500 throw SemanticError(ss.str(), function);647 SemanticError( function, ss.str() ); 501 648 } 502 649 … … 508 655 // Check if parameters are missing 509 656 if( advance_to_mutex( param, param_end ) ) { 657 do { 658 n_mutex_param++; 659 param++; 660 } while( advance_to_mutex( param, param_end ) ); 661 510 662 // We ran out of arguments but still have parameters left 511 663 // this function doesn't match 512 throw SemanticError("candidate function not viable: too few mutex arguments\n", function);664 SemanticError( function, toString("candidate function not viable: too few mutex arguments, expected ", n_mutex_param, "\n" )); 513 665 } 514 666 … … 526 678 527 679 } 528 catch( SemanticError &e ) {680 catch( SemanticErrorException &e ) { 529 681 errors.append( e ); 530 682 } 531 683 } 532 684 } 533 catch( SemanticError &e ) {685 catch( SemanticErrorException &e ) { 534 686 errors.append( e ); 535 687 } … … 537 689 538 690 // Make sure we got the right number of arguments 539 if( func_candidates.empty() ) { SemanticError top("No alternatives for function in call to waitfor" ); top.append( errors ); throw top; }540 if( args_candidates.empty() ) { SemanticError top("No alternatives for arguments in call to waitfor" ); top.append( errors ); throw top; }541 if( func_candidates.size() > 1 ) { SemanticError top("Ambiguous function in call to waitfor" ); top.append( errors ); throw top; }542 if( args_candidates.size() > 1 ) { SemanticError top("Ambiguous arguments in call to waitfor" ); top.append( errors ); throw top; }543 691 if( func_candidates.empty() ) { SemanticErrorException top( stmt->location, "No alternatives for function in call to waitfor" ); top.append( errors ); throw top; } 692 if( args_candidates.empty() ) { SemanticErrorException top( stmt->location, "No alternatives for arguments in call to waitfor" ); top.append( errors ); throw top; } 693 if( func_candidates.size() > 1 ) { SemanticErrorException top( stmt->location, "Ambiguous function in call to waitfor" ); top.append( errors ); throw top; } 694 if( args_candidates.size() > 1 ) { SemanticErrorException top( stmt->location, "Ambiguous arguments in call to waitfor" ); top.append( errors ); throw top; } 695 // TODO: need to use findDeletedExpr to ensure no deleted identifiers are used. 544 696 545 697 // Swap the results from the alternative with the unresolved values. … … 574 726 } 575 727 576 bool isStructOrUnion( Type * t ) {577 t = t->stripReferences();578 return dynamic_cast< StructInstType * >( t ) || dynamic_cast< UnionInstType * >( t );579 }580 581 void Resolver::previsit( WithStmt * withStmt ) {582 for ( Expression *& expr : withStmt->exprs ) {583 TypeEnvironment env;584 AlternativeFinder finder( indexer, env );585 finder.findWithAdjustment( expr );586 587 // only struct- and union-typed expressions are viable candidates588 AltList candidates;589 for ( Alternative & alt : finder.get_alternatives() ) {590 if ( isStructOrUnion( alt.expr->result ) ) {591 candidates.push_back( std::move( alt ) );592 }593 }594 595 // choose the lowest cost expression among the candidates596 AltList winners;597 findMinCost( candidates.begin(), candidates.end(), back_inserter( winners ) );598 if ( winners.size() == 0 ) {599 throw SemanticError( "No reasonable alternatives for with statement expression: ", expr );600 } else if ( winners.size() != 1 ) {601 std::ostringstream stream;602 stream << "Cannot choose between " << winners.size() << " alternatives for with statement expression\n";603 expr->print( stream );604 stream << "Alternatives are:\n";605 printAlts( winners, stream, 1 );606 throw SemanticError( stream.str() );607 }608 609 // there is one unambiguous interpretation - move the expression into the with statement610 Alternative & alt = winners.front();611 finishExpr( alt.expr, alt.env, expr->env );612 delete expr;613 expr = alt.expr;614 alt.expr = nullptr;615 616 // if with expression might be impure, create a temporary so that it is evaluated once617 if ( Tuples::maybeImpure( expr ) ) {618 static UniqueName tmpNamer( "_with_tmp_" );619 ObjectDecl * tmp = ObjectDecl::newObject( tmpNamer.newName(), expr->result->clone(), new SingleInit( expr ) );620 expr = new VariableExpr( tmp );621 stmtsToAddBefore.push_back( new DeclStmt( tmp ) );622 if ( InitTweak::isConstructable( tmp->type ) ) {623 // generate ctor/dtor and resolve them624 tmp->init = InitTweak::genCtorInit( tmp );625 tmp->accept( *visitor );626 }627 }628 }629 }630 631 728 template< typename T > 632 729 bool isCharType( T t ) { … … 652 749 initExpr->expr = nullptr; 653 750 std::swap( initExpr->env, newExpr->env ); 654 std::swap( initExpr->inferParams, newExpr->inferParams ) ; 751 // InitExpr may have inferParams in the case where the expression specializes a function pointer, 752 // and newExpr may already have inferParams of its own, so a simple swap is not sufficient. 753 newExpr->spliceInferParams( initExpr ); 655 754 delete initExpr; 656 755 … … 740 839 PassVisitor<Resolver> resolver( indexer ); 741 840 stmtExpr->accept( resolver ); 841 stmtExpr->computeResult(); 842 // xxx - aggregate the environments from all statements? Possibly in AlternativeFinder instead? 742 843 } 743 844 … … 745 846 visit_children = false; 746 847 // xxx - fallback init has been removed => remove fallbackInit function and remove complexity from FixInit and remove C-init from ConstructorInit 747 maybeAccept( ctorInit-> get_ctor(), *visitor );748 maybeAccept( ctorInit-> get_dtor(), *visitor );848 maybeAccept( ctorInit->ctor, *visitor ); 849 maybeAccept( ctorInit->dtor, *visitor ); 749 850 750 851 // found a constructor - can get rid of C-style initializer 751 delete ctorInit-> get_init();752 ctorInit-> set_init( NULL );852 delete ctorInit->init; 853 ctorInit->init = nullptr; 753 854 754 855 // intrinsic single parameter constructors and destructors do nothing. Since this was 755 856 // implicitly generated, there's no way for it to have side effects, so get rid of it 756 857 // to clean up generated code. 757 if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit-> get_ctor()) ) {758 delete ctorInit-> get_ctor();759 ctorInit-> set_ctor( NULL );760 } 761 762 if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit-> get_dtor()) ) {763 delete ctorInit-> get_dtor();764 ctorInit-> set_dtor( NULL );858 if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit->ctor ) ) { 859 delete ctorInit->ctor; 860 ctorInit->ctor = nullptr; 861 } 862 863 if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit->dtor ) ) { 864 delete ctorInit->dtor; 865 ctorInit->dtor = nullptr; 765 866 } 766 867 -
src/ResolvExpr/Resolver.h
rf9feab8 r90152a4 33 33 void findVoidExpression( Expression *& untyped, const SymTab::Indexer &indexer ); 34 34 void findSingleExpression( Expression *& untyped, const SymTab::Indexer &indexer ); 35 void findSingleExpression( Expression *& untyped, Type * type, const SymTab::Indexer &indexer ); 35 36 void resolveCtorInit( ConstructorInit * ctorInit, const SymTab::Indexer & indexer ); 36 37 void resolveStmtExpr( StmtExpr * stmtExpr, const SymTab::Indexer & indexer ); 38 /// Searches expr and returns the first DeletedExpr found, otherwise nullptr 39 DeletedExpr * findDeletedExpr( Expression * expr ); 40 /// Resolves with-stmts and with-clauses on functions 41 void resolveWithExprs( std::list< Declaration * > & translationUnit ); 37 42 } // namespace ResolvExpr 38 43 -
src/ResolvExpr/TypeEnvironment.cc
rf9feab8 r90152a4 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 12:19:47 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sun May 17 12:23:36 201513 // Update Count : 311 // Last Modified By : Aaron B. Moss 12 // Last Modified On : Mon Jun 18 11:58:00 2018 13 // Update Count : 4 14 14 // 15 15 … … 17 17 #include <algorithm> // for copy, set_intersection 18 18 #include <iterator> // for ostream_iterator, insert_iterator 19 #include <utility> // for pair 19 #include <memory> // for unique_ptr 20 #include <utility> // for pair, move 20 21 21 22 #include "Common/utility.h" // for maybeClone 22 23 #include "SynTree/Type.h" // for Type, FunctionType, Type::Fora... 23 24 #include "SynTree/TypeSubstitution.h" // for TypeSubstitution 25 #include "Tuples/Tuples.h" // for isTtype 24 26 #include "TypeEnvironment.h" 27 #include "typeops.h" // for occurs 28 #include "Unify.h" // for unifyInexact 25 29 26 30 namespace ResolvExpr { … … 44 48 45 49 void EqvClass::initialize( const EqvClass &src, EqvClass &dest ) { 50 initialize( src, dest, src.type ); 51 } 52 53 void EqvClass::initialize( const EqvClass &src, EqvClass &dest, const Type *ty ) { 46 54 dest.vars = src.vars; 47 dest.type = maybeClone( src.type);55 dest.type = maybeClone( ty ); 48 56 dest.allowWidening = src.allowWidening; 49 57 dest.data = src.data; 50 58 } 51 59 52 EqvClass::EqvClass() : type( 0), allowWidening( true ) {60 EqvClass::EqvClass() : type( nullptr ), allowWidening( true ) { 53 61 } 54 62 55 63 EqvClass::EqvClass( const EqvClass &other ) { 56 64 initialize( other, *this ); 65 } 66 67 EqvClass::EqvClass( const EqvClass &other, const Type *ty ) { 68 initialize( other, *this, ty ); 69 } 70 71 EqvClass::EqvClass( EqvClass &&other ) 72 : vars{std::move(other.vars)}, type{other.type}, 73 allowWidening{std::move(other.allowWidening)}, data{std::move(other.data)} { 74 other.type = nullptr; 57 75 } 58 76 … … 64 82 } 65 83 84 EqvClass &EqvClass::operator=( EqvClass &&other ) { 85 if ( this == &other ) return *this; 86 delete type; 87 88 vars = std::move(other.vars); 89 type = other.type; 90 other.type = nullptr; 91 allowWidening = std::move(other.allowWidening); 92 data = std::move(other.data); 93 94 return *this; 95 } 96 66 97 EqvClass::~EqvClass() { 67 98 delete type; 99 } 100 101 void EqvClass::set_type( Type* ty ) { 102 if ( ty == type ) return; 103 delete type; 104 type = ty; 68 105 } 69 106 … … 82 119 } 83 120 84 bool TypeEnvironment::lookup( const std::string &var, EqvClass &eqvClass) const {121 const EqvClass* TypeEnvironment::lookup( const std::string &var ) const { 85 122 for ( std::list< EqvClass >::const_iterator i = env.begin(); i != env.end(); ++i ) { 86 if ( i->vars.find( var ) != i->vars.end() ) { 87 /// std::cout << var << " is in class "; 88 /// i->print( std::cout ); 89 eqvClass = *i; 90 return true; 91 } 92 /// std::cout << var << " is not in class "; 93 /// i->print( std::cout ); 94 } // for 95 return false; 96 } 97 98 void TypeEnvironment::add( const EqvClass &eqvClass ) { 99 std::list< EqvClass >::iterator i = env.begin(); 100 while ( i != env.end() ) { 101 std::list< EqvClass >::iterator next = i; 102 next++; 103 std::set< std::string > intersection; 104 std::set_intersection( i->vars.begin(), i->vars.end(), eqvClass.vars.begin(), eqvClass.vars.end(), std::inserter( intersection, intersection.begin() ) ); 105 if ( ! intersection.empty() ) { 106 env.erase( i ); 107 } // if 123 if ( i->vars.find( var ) != i->vars.end() ) return &*i; 124 } // for 125 return nullptr; 126 } 127 128 /// Removes any class from env that intersects eqvClass 129 void filterOverlappingClasses( std::list<EqvClass> &env, const EqvClass &eqvClass ) { 130 for ( auto i = env.begin(); i != env.end(); ) { 131 auto next = i; 132 ++next; 133 std::set<std::string> intersection; 134 std::set_intersection( i->vars.begin(), i->vars.end(), eqvClass.vars.begin(), eqvClass.vars.end(), 135 std::inserter( intersection, intersection.begin() ) ); 136 if ( ! intersection.empty() ) { env.erase( i ); } 108 137 i = next; 109 } // while 110 env.insert( env.end(), eqvClass ); 138 } 139 } 140 141 void TypeEnvironment::add( EqvClass &&eqvClass ) { 142 filterOverlappingClasses( env, eqvClass ); 143 env.push_back( std::move(eqvClass) ); 111 144 } 112 145 … … 116 149 newClass.vars.insert( (*i)->get_name() ); 117 150 newClass.data = TypeDecl::Data{ (*i) }; 118 env.push_back( newClass ); 119 } // for 151 env.push_back( std::move(newClass) ); 152 } // for 153 } 154 155 void TypeEnvironment::add( const TypeSubstitution & sub ) { 156 EqvClass newClass; 157 for ( auto p : sub ) { 158 newClass.vars.insert( p.first ); 159 newClass.type = p.second->clone(); 160 newClass.allowWidening = false; 161 // Minimal assumptions. Not technically correct, but might be good enough, and 162 // is the best we can do at the moment since information is lost in the 163 // transition to TypeSubstitution 164 newClass.data = TypeDecl::Data{ TypeDecl::Dtype, false }; 165 add( std::move(newClass) ); 166 } 120 167 } 121 168 … … 123 170 for ( std::list< EqvClass >::const_iterator theClass = env.begin(); theClass != env.end(); ++theClass ) { 124 171 for ( std::set< std::string >::const_iterator theVar = theClass->vars.begin(); theVar != theClass->vars.end(); ++theVar ) { 125 /// std::cerr << "adding " << *theVar;126 172 if ( theClass->type ) { 127 /// std::cerr << " bound to ";128 /// theClass->type->print( std::cerr );129 /// std::cerr << std::endl;130 173 sub.add( *theVar, theClass->type ); 131 174 } else if ( theVar != theClass->vars.begin() ) { 132 175 TypeInstType *newTypeInst = new TypeInstType( Type::Qualifiers(), *theClass->vars.begin(), theClass->data.kind == TypeDecl::Ftype ); 133 /// std::cerr << " bound to variable " << *theClass->vars.begin() << std::endl;134 176 sub.add( *theVar, newTypeInst ); 135 177 delete newTypeInst; … … 137 179 } // for 138 180 } // for 139 /// std::cerr << "input env is:" << std::endl;140 /// print( std::cerr, 8 );141 /// std::cerr << "sub is:" << std::endl;142 /// sub.print( std::cerr, 8 );143 181 sub.normalize(); 144 182 } 145 183 146 184 void TypeEnvironment::print( std::ostream &os, Indenter indent ) const { 147 for ( std::list< EqvClass >::const_iterator i = env.begin(); i != env.end(); ++i) {148 i->print( os, indent );185 for ( const EqvClass & theClass : env ) { 186 theClass.print( os, indent ); 149 187 } // for 150 188 } … … 152 190 std::list< EqvClass >::iterator TypeEnvironment::internal_lookup( const std::string &var ) { 153 191 for ( std::list< EqvClass >::iterator i = env.begin(); i != env.end(); ++i ) { 154 if ( i->vars.find( var ) == i->vars.end() ) { 155 return i; 156 } // if 192 if ( i->vars.count( var ) ) return i; 157 193 } // for 158 194 return env.end(); … … 161 197 void TypeEnvironment::simpleCombine( const TypeEnvironment &second ) { 162 198 env.insert( env.end(), second.env.begin(), second.env.end() ); 163 }164 165 void TypeEnvironment::combine( const TypeEnvironment &second, Type *(*combineFunc)( Type*, Type* ) ) {166 TypeEnvironment secondCopy( second );167 for ( std::list< EqvClass >::iterator firstClass = env.begin(); firstClass != env.end(); ++firstClass ) {168 EqvClass &newClass = *firstClass;169 std::set< std::string > newVars;170 for ( std::set< std::string >::const_iterator var = firstClass->vars.begin(); var != firstClass->vars.end(); ++var ) {171 std::list< EqvClass >::iterator secondClass = secondCopy.internal_lookup( *var );172 if ( secondClass != secondCopy.env.end() ) {173 newVars.insert( secondClass->vars.begin(), secondClass->vars.end() );174 if ( secondClass->type ) {175 if ( newClass.type ) {176 Type *newType = combineFunc( newClass.type, secondClass->type );177 delete newClass.type;178 newClass.type = newType;179 newClass.allowWidening = newClass.allowWidening && secondClass->allowWidening;180 } else {181 newClass.type = secondClass->type->clone();182 newClass.allowWidening = secondClass->allowWidening;183 } // if184 } // if185 secondCopy.env.erase( secondClass );186 } // if187 } // for188 newClass.vars.insert( newVars.begin(), newVars.end() );189 } // for190 for ( std::list< EqvClass >::iterator secondClass = secondCopy.env.begin(); secondClass != secondCopy.env.end(); ++secondClass ) {191 env.push_back( *secondClass );192 } // for193 199 } 194 200 … … 212 218 } 213 219 220 bool isFtype( Type *type ) { 221 if ( dynamic_cast< FunctionType* >( type ) ) { 222 return true; 223 } else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( type ) ) { 224 return typeInst->get_isFtype(); 225 } // if 226 return false; 227 } 228 229 bool tyVarCompatible( const TypeDecl::Data & data, Type *type ) { 230 switch ( data.kind ) { 231 case TypeDecl::Dtype: 232 // to bind to an object type variable, the type must not be a function type. 233 // if the type variable is specified to be a complete type then the incoming 234 // type must also be complete 235 // xxx - should this also check that type is not a tuple type and that it's not a ttype? 236 return ! isFtype( type ) && (! data.isComplete || type->isComplete() ); 237 case TypeDecl::Ftype: 238 return isFtype( type ); 239 case TypeDecl::Ttype: 240 // ttype unifies with any tuple type 241 return dynamic_cast< TupleType * >( type ) || Tuples::isTtype( type ); 242 default: 243 assertf(false, "Unhandled tyvar kind: %d", data.kind); 244 } // switch 245 return false; 246 } 247 248 bool TypeEnvironment::bindVar( TypeInstType *typeInst, Type *bindTo, const TypeDecl::Data & data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ) { 249 250 // remove references from other, so that type variables can only bind to value types 251 bindTo = bindTo->stripReferences(); 252 OpenVarSet::const_iterator tyvar = openVars.find( typeInst->get_name() ); 253 assert( tyvar != openVars.end() ); 254 if ( ! tyVarCompatible( tyvar->second, bindTo ) ) { 255 return false; 256 } // if 257 if ( occurs( bindTo, typeInst->get_name(), *this ) ) { 258 return false; 259 } // if 260 auto curClass = internal_lookup( typeInst->get_name() ); 261 if ( curClass != env.end() ) { 262 if ( curClass->type ) { 263 Type *common = 0; 264 // attempt to unify equivalence class type (which has qualifiers stripped, so they must be restored) with the type to bind to 265 std::unique_ptr< Type > newType( curClass->type->clone() ); 266 newType->get_qualifiers() = typeInst->get_qualifiers(); 267 if ( unifyInexact( newType.get(), bindTo, *this, need, have, openVars, widenMode & WidenMode( curClass->allowWidening, true ), indexer, common ) ) { 268 if ( common ) { 269 common->get_qualifiers() = Type::Qualifiers{}; 270 curClass->set_type( common ); 271 } // if 272 } else return false; 273 } else { 274 Type* newType = bindTo->clone(); 275 newType->get_qualifiers() = Type::Qualifiers{}; 276 curClass->set_type( newType ); 277 curClass->allowWidening = widenMode.widenFirst && widenMode.widenSecond; 278 } // if 279 } else { 280 EqvClass newClass; 281 newClass.vars.insert( typeInst->get_name() ); 282 newClass.type = bindTo->clone(); 283 newClass.type->get_qualifiers() = Type::Qualifiers(); 284 newClass.allowWidening = widenMode.widenFirst && widenMode.widenSecond; 285 newClass.data = data; 286 env.push_back( std::move(newClass) ); 287 } // if 288 return true; 289 } 290 291 bool TypeEnvironment::bindVarToVar( TypeInstType *var1, TypeInstType *var2, const TypeDecl::Data & data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ) { 292 293 auto class1 = internal_lookup( var1->get_name() ); 294 auto class2 = internal_lookup( var2->get_name() ); 295 296 // exit early if variables already bound together 297 if ( class1 != env.end() && class1 == class2 ) { 298 class1->allowWidening &= widenMode; 299 return true; 300 } 301 302 bool widen1 = false, widen2 = false; 303 const Type *type1 = nullptr, *type2 = nullptr; 304 305 // check for existing bindings, perform occurs check 306 if ( class1 != env.end() ) { 307 if ( class1->type ) { 308 if ( occurs( class1->type, var2->get_name(), *this ) ) return false; 309 type1 = class1->type; 310 } // if 311 widen1 = widenMode.widenFirst && class1->allowWidening; 312 } // if 313 if ( class2 != env.end() ) { 314 if ( class2->type ) { 315 if ( occurs( class2->type, var1->get_name(), *this ) ) return false; 316 type2 = class2->type; 317 } // if 318 widen2 = widenMode.widenSecond && class2->allowWidening; 319 } // if 320 321 if ( type1 && type2 ) { 322 // both classes bound, merge if bound types can be unified 323 std::unique_ptr<Type> newType1{ type1->clone() }, newType2{ type2->clone() }; 324 WidenMode newWidenMode{ widen1, widen2 }; 325 Type *common = 0; 326 if ( unifyInexact( newType1.get(), newType2.get(), *this, need, have, openVars, newWidenMode, indexer, common ) ) { 327 class1->vars.insert( class2->vars.begin(), class2->vars.end() ); 328 class1->allowWidening = widen1 && widen2; 329 if ( common ) { 330 common->get_qualifiers() = Type::Qualifiers{}; 331 class1->set_type( common ); 332 } 333 env.erase( class2 ); 334 } else return false; 335 } else if ( class1 != env.end() && class2 != env.end() ) { 336 // both classes exist, at least one unbound, merge unconditionally 337 if ( type1 ) { 338 class1->vars.insert( class2->vars.begin(), class2->vars.end() ); 339 class1->allowWidening = widen1; 340 env.erase( class2 ); 341 } else { 342 class2->vars.insert( class1->vars.begin(), class1->vars.end() ); 343 class2->allowWidening = widen2; 344 env.erase( class1 ); 345 } // if 346 } else if ( class1 != env.end() ) { 347 // var2 unbound, add to class1 348 class1->vars.insert( var2->get_name() ); 349 class1->allowWidening = widen1; 350 } else if ( class2 != env.end() ) { 351 // var1 unbound, add to class2 352 class2->vars.insert( var1->get_name() ); 353 class2->allowWidening = widen2; 354 } else { 355 // neither var bound, create new class 356 EqvClass newClass; 357 newClass.vars.insert( var1->get_name() ); 358 newClass.vars.insert( var2->get_name() ); 359 newClass.allowWidening = widen1 && widen2; 360 newClass.data = data; 361 env.push_back( std::move(newClass) ); 362 } // if 363 return true; 364 } 365 366 void TypeEnvironment::forbidWidening() { 367 for ( EqvClass& c : env ) c.allowWidening = false; 368 } 369 214 370 std::ostream & operator<<( std::ostream & out, const TypeEnvironment & env ) { 215 371 env.print( out ); -
src/ResolvExpr/TypeEnvironment.h
rf9feab8 r90152a4 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 12:24:58 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sat Jul 22 09:35:45 201713 // Update Count : 311 // Last Modified By : Aaron B. Moss 12 // Last Modified On : Mon Jun 18 11:58:00 2018 13 // Update Count : 4 14 14 // 15 15 … … 21 21 #include <set> // for set 22 22 #include <string> // for string 23 #include <utility> // for move, swap 24 25 #include "WidenMode.h" // for WidenMode 23 26 24 27 #include "SynTree/Declaration.h" // for TypeDecl::Data, DeclarationWit... … … 37 40 // 38 41 // I've seen a TU go from 54 minutes to 1 minute 34 seconds with the addition of this comparator. 42 // 43 // Note: since this compares pointers for position, minor changes in the source file that affect 44 // memory layout can alter compilation time in unpredictable ways. For example, the placement 45 // of a line directive can reorder type pointers with respect to each other so that assertions 46 // are seen in different orders, causing a potentially different number of unification calls when 47 // resolving assertions. I've seen a TU go from 36 seconds to 27 seconds by reordering line directives 48 // alone, so it would be nice to fix this comparison so that assertions compare more consistently. 49 // I've tried to modify this to compare on mangle name instead of type as the second comparator, but 50 // this causes some assertions to never be recorded. More investigation is needed. 39 51 struct AssertCompare { 40 52 bool operator()( DeclarationWithType * d1, DeclarationWithType * d2 ) const { … … 64 76 65 77 void initialize( const EqvClass &src, EqvClass &dest ); 78 void initialize( const EqvClass &src, EqvClass &dest, const Type *ty ); 66 79 EqvClass(); 67 80 EqvClass( const EqvClass &other ); 81 EqvClass( const EqvClass &other, const Type *ty ); 82 EqvClass( EqvClass &&other ); 68 83 EqvClass &operator=( const EqvClass &other ); 84 EqvClass &operator=( EqvClass &&other ); 69 85 ~EqvClass(); 70 86 void print( std::ostream &os, Indenter indent = {} ) const; 87 88 /// Takes ownership of `ty`, freeing old `type` 89 void set_type(Type* ty); 71 90 }; 72 91 73 92 class TypeEnvironment { 74 93 public: 75 bool lookup( const std::string &var, EqvClass &eqvClass ) const; 76 void add( const EqvClass &eqvClass ); 94 const EqvClass* lookup( const std::string &var ) const; 95 private: 96 void add( EqvClass &&eqvClass ); 97 public: 77 98 void add( const Type::ForallList &tyDecls ); 99 void add( const TypeSubstitution & sub ); 78 100 template< typename SynTreeClass > int apply( SynTreeClass *&type ) const; 79 101 template< typename SynTreeClass > int applyFree( SynTreeClass *&type ) const; … … 81 103 bool isEmpty() const { return env.empty(); } 82 104 void print( std::ostream &os, Indenter indent = {} ) const; 83 void combine( const TypeEnvironment &second, Type *(*combineFunc)( Type*, Type* ) );105 // void combine( const TypeEnvironment &second, Type *(*combineFunc)( Type*, Type* ) ); 84 106 void simpleCombine( const TypeEnvironment &second ); 85 107 void extractOpenVars( OpenVarSet &openVars ) const; … … 90 112 void addActual( const TypeEnvironment& actualEnv, OpenVarSet& openVars ); 91 113 92 typedef std::list< EqvClass >::iterator iterator; 93 iterator begin() { return env.begin(); } 94 iterator end() { return env.end(); } 95 typedef std::list< EqvClass >::const_iterator const_iterator; 96 const_iterator begin() const { return env.begin(); } 97 const_iterator end() const { return env.end(); } 114 /// Binds the type class represented by `typeInst` to the type `bindTo`; will add 115 /// the class if needed. Returns false on failure. 116 bool bindVar( TypeInstType *typeInst, Type *bindTo, const TypeDecl::Data & data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ); 117 118 /// Binds the type classes represented by `var1` and `var2` together; will add 119 /// one or both classes if needed. Returns false on failure. 120 bool bindVarToVar( TypeInstType *var1, TypeInstType *var2, const TypeDecl::Data & data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ); 121 122 /// Disallows widening for all bindings in the environment 123 void forbidWidening(); 124 125 using iterator = std::list< EqvClass >::const_iterator; 126 iterator begin() const { return env.begin(); } 127 iterator end() const { return env.end(); } 128 98 129 private: 99 130 std::list< EqvClass > env; 131 100 132 std::list< EqvClass >::iterator internal_lookup( const std::string &var ); 101 133 }; -
src/ResolvExpr/Unify.cc
rf9feab8 r90152a4 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 12:27:10 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Thu Mar 16 16:22:54 201713 // Update Count : 4 211 // Last Modified By : Aaron B. Moss 12 // Last Modified On : Mon Jun 18 11:58:00 2018 13 // Update Count : 43 14 14 // 15 15 … … 20 20 #include <set> // for set 21 21 #include <string> // for string, operator==, operator!=, bas... 22 #include <utility> // for pair 22 #include <utility> // for pair, move 23 23 24 24 #include "Common/PassVisitor.h" // for PassVisitor … … 44 44 namespace ResolvExpr { 45 45 46 class Unify : public Visitor { 47 public: 46 struct Unify : public WithShortCircuiting { 48 47 Unify( Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ); 49 48 50 49 bool get_result() const { return result; } 50 51 void previsit( BaseSyntaxNode * ) { visit_children = false; } 52 53 void postvisit( VoidType * voidType ); 54 void postvisit( BasicType * basicType ); 55 void postvisit( PointerType * pointerType ); 56 void postvisit( ArrayType * arrayType ); 57 void postvisit( ReferenceType * refType ); 58 void postvisit( FunctionType * functionType ); 59 void postvisit( StructInstType * aggregateUseType ); 60 void postvisit( UnionInstType * aggregateUseType ); 61 void postvisit( EnumInstType * aggregateUseType ); 62 void postvisit( TraitInstType * aggregateUseType ); 63 void postvisit( TypeInstType * aggregateUseType ); 64 void postvisit( TupleType * tupleType ); 65 void postvisit( VarArgsType * varArgsType ); 66 void postvisit( ZeroType * zeroType ); 67 void postvisit( OneType * oneType ); 68 51 69 private: 52 virtual void visit(VoidType *voidType);53 virtual void visit(BasicType *basicType);54 virtual void visit(PointerType *pointerType);55 virtual void visit(ArrayType *arrayType);56 virtual void visit(ReferenceType *refType);57 virtual void visit(FunctionType *functionType);58 virtual void visit(StructInstType *aggregateUseType);59 virtual void visit(UnionInstType *aggregateUseType);60 virtual void visit(EnumInstType *aggregateUseType);61 virtual void visit(TraitInstType *aggregateUseType);62 virtual void visit(TypeInstType *aggregateUseType);63 virtual void visit(TupleType *tupleType);64 virtual void visit(VarArgsType *varArgsType);65 virtual void visit(ZeroType *zeroType);66 virtual void visit(OneType *oneType);67 68 70 template< typename RefType > void handleRefType( RefType *inst, Type *other ); 69 71 template< typename RefType > void handleGenericRefType( RefType *inst, Type *other ); … … 127 129 } 128 130 129 bool isFtype( Type *type ) {130 if ( dynamic_cast< FunctionType* >( type ) ) {131 return true;132 } else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( type ) ) {133 return typeInst->get_isFtype();134 } // if135 return false;136 }137 138 bool tyVarCompatible( const TypeDecl::Data & data, Type *type ) {139 switch ( data.kind ) {140 case TypeDecl::Dtype:141 // to bind to an object type variable, the type must not be a function type.142 // if the type variable is specified to be a complete type then the incoming143 // type must also be complete144 // xxx - should this also check that type is not a tuple type and that it's not a ttype?145 return ! isFtype( type ) && (! data.isComplete || type->isComplete() );146 case TypeDecl::Ftype:147 return isFtype( type );148 case TypeDecl::Ttype:149 // ttype unifies with any tuple type150 return dynamic_cast< TupleType * >( type ) || Tuples::isTtype( type );151 } // switch152 return false;153 }154 155 bool bindVar( TypeInstType *typeInst, Type *other, const TypeDecl::Data & data, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ) {156 // remove references from other, so that type variables can only bind to value types157 other = other->stripReferences();158 OpenVarSet::const_iterator tyvar = openVars.find( typeInst->get_name() );159 assert( tyvar != openVars.end() );160 if ( ! tyVarCompatible( tyvar->second, other ) ) {161 return false;162 } // if163 if ( occurs( other, typeInst->get_name(), env ) ) {164 return false;165 } // if166 EqvClass curClass;167 if ( env.lookup( typeInst->get_name(), curClass ) ) {168 if ( curClass.type ) {169 Type *common = 0;170 // attempt to unify equivalence class type (which has qualifiers stripped, so they must be restored) with the type to bind to171 std::unique_ptr< Type > newType( curClass.type->clone() );172 newType->get_qualifiers() = typeInst->get_qualifiers();173 if ( unifyInexact( newType.get(), other, env, needAssertions, haveAssertions, openVars, widenMode & WidenMode( curClass.allowWidening, true ), indexer, common ) ) {174 if ( common ) {175 common->get_qualifiers() = Type::Qualifiers();176 delete curClass.type;177 curClass.type = common;178 env.add( curClass );179 } // if180 return true;181 } else {182 return false;183 } // if184 } else {185 curClass.type = other->clone();186 curClass.type->get_qualifiers() = Type::Qualifiers();187 curClass.allowWidening = widenMode.widenFirst && widenMode.widenSecond;188 env.add( curClass );189 } // if190 } else {191 EqvClass newClass;192 newClass.vars.insert( typeInst->get_name() );193 newClass.type = other->clone();194 newClass.type->get_qualifiers() = Type::Qualifiers();195 newClass.allowWidening = widenMode.widenFirst && widenMode.widenSecond;196 newClass.data = data;197 env.add( newClass );198 } // if199 return true;200 }201 202 bool bindVarToVar( TypeInstType *var1, TypeInstType *var2, const TypeDecl::Data & data, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ) {203 bool result = true;204 EqvClass class1, class2;205 bool hasClass1 = false, hasClass2 = false;206 bool widen1 = false, widen2 = false;207 Type *type1 = 0, *type2 = 0;208 209 if ( env.lookup( var1->get_name(), class1 ) ) {210 hasClass1 = true;211 if ( class1.type ) {212 if ( occurs( class1.type, var2->get_name(), env ) ) {213 return false;214 } // if215 type1 = class1.type->clone();216 } // if217 widen1 = widenMode.widenFirst && class1.allowWidening;218 } // if219 if ( env.lookup( var2->get_name(), class2 ) ) {220 hasClass2 = true;221 if ( class2.type ) {222 if ( occurs( class2.type, var1->get_name(), env ) ) {223 return false;224 } // if225 type2 = class2.type->clone();226 } // if227 widen2 = widenMode.widenSecond && class2.allowWidening;228 } // if229 230 if ( type1 && type2 ) {231 // std::cerr << "has type1 && type2" << std::endl;232 WidenMode newWidenMode ( widen1, widen2 );233 Type *common = 0;234 if ( unifyInexact( type1, type2, env, needAssertions, haveAssertions, openVars, newWidenMode, indexer, common ) ) {235 class1.vars.insert( class2.vars.begin(), class2.vars.end() );236 class1.allowWidening = widen1 && widen2;237 if ( common ) {238 common->get_qualifiers() = Type::Qualifiers();239 delete class1.type;240 class1.type = common;241 } // if242 env.add( class1 );243 } else {244 result = false;245 } // if246 } else if ( hasClass1 && hasClass2 ) {247 if ( type1 ) {248 class1.vars.insert( class2.vars.begin(), class2.vars.end() );249 class1.allowWidening = widen1;250 env.add( class1 );251 } else {252 class2.vars.insert( class1.vars.begin(), class1.vars.end() );253 class2.allowWidening = widen2;254 env.add( class2 );255 } // if256 } else if ( hasClass1 ) {257 class1.vars.insert( var2->get_name() );258 class1.allowWidening = widen1;259 env.add( class1 );260 } else if ( hasClass2 ) {261 class2.vars.insert( var1->get_name() );262 class2.allowWidening = widen2;263 env.add( class2 );264 } else {265 EqvClass newClass;266 newClass.vars.insert( var1->get_name() );267 newClass.vars.insert( var2->get_name() );268 newClass.allowWidening = widen1 && widen2;269 newClass.data = data;270 env.add( newClass );271 } // if272 delete type1;273 delete type2;274 return result;275 }276 277 131 bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer ) { 278 132 OpenVarSet closedVars; … … 319 173 320 174 if ( isopen1 && isopen2 && entry1->second == entry2->second ) { 321 result = bindVarToVar( var1, var2, entry1->second, env, needAssertions, haveAssertions, openVars, widenMode, indexer );175 result = env.bindVarToVar( var1, var2, entry1->second, needAssertions, haveAssertions, openVars, widenMode, indexer ); 322 176 } else if ( isopen1 ) { 323 result = bindVar( var1, type2, entry1->second, env, needAssertions, haveAssertions, openVars, widenMode, indexer );324 } else if ( isopen2 ) { 325 result = bindVar( var2, type1, entry2->second, env, needAssertions, haveAssertions, openVars, widenMode, indexer );177 result = env.bindVar( var1, type2, entry1->second, needAssertions, haveAssertions, openVars, widenMode, indexer ); 178 } else if ( isopen2 ) { // TODO: swap widenMode values in call, since type positions are flipped? 179 result = env.bindVar( var2, type1, entry2->second, needAssertions, haveAssertions, openVars, widenMode, indexer ); 326 180 } else { 327 Unifycomparator( type2, env, needAssertions, haveAssertions, openVars, widenMode, indexer );181 PassVisitor<Unify> comparator( type2, env, needAssertions, haveAssertions, openVars, widenMode, indexer ); 328 182 type1->accept( comparator ); 329 result = comparator. get_result();183 result = comparator.pass.get_result(); 330 184 } // if 331 185 #ifdef DEBUG … … 404 258 } 405 259 406 void Unify:: visit( __attribute__((unused)) VoidType *voidType) {260 void Unify::postvisit( __attribute__((unused)) VoidType *voidType) { 407 261 result = dynamic_cast< VoidType* >( type2 ); 408 262 } 409 263 410 void Unify:: visit(BasicType *basicType) {264 void Unify::postvisit(BasicType *basicType) { 411 265 if ( BasicType *otherBasic = dynamic_cast< BasicType* >( type2 ) ) { 412 266 result = basicType->get_kind() == otherBasic->get_kind(); … … 436 290 } 437 291 438 void Unify:: visit(PointerType *pointerType) {292 void Unify::postvisit(PointerType *pointerType) { 439 293 if ( PointerType *otherPointer = dynamic_cast< PointerType* >( type2 ) ) { 440 294 result = unifyExact( pointerType->get_base(), otherPointer->get_base(), env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer ); … … 444 298 } 445 299 446 void Unify:: visit(ReferenceType *refType) {300 void Unify::postvisit(ReferenceType *refType) { 447 301 if ( ReferenceType *otherRef = dynamic_cast< ReferenceType* >( type2 ) ) { 448 302 result = unifyExact( refType->get_base(), otherRef->get_base(), env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer ); … … 452 306 } 453 307 454 void Unify:: visit(ArrayType *arrayType) {308 void Unify::postvisit(ArrayType *arrayType) { 455 309 ArrayType *otherArray = dynamic_cast< ArrayType* >( type2 ); 456 310 // to unify, array types must both be VLA or both not VLA … … 537 391 void premutate( TypeInstType * ) { visit_children = false; } 538 392 Type * postmutate( TypeInstType * typeInst ) { 539 EqvClass eqvClass; 540 if ( tenv.lookup( typeInst->get_name(), eqvClass ) ) { 541 if ( eqvClass.data.kind == TypeDecl::Ttype ) { 542 // expand ttype parameter into its actual type 543 if ( eqvClass.type ) { 544 delete typeInst; 545 return eqvClass.type->clone(); 546 } 393 if ( const EqvClass *eqvClass = tenv.lookup( typeInst->get_name() ) ) { 394 // expand ttype parameter into its actual type 395 if ( eqvClass->data.kind == TypeDecl::Ttype && eqvClass->type ) { 396 delete typeInst; 397 return eqvClass->type->clone(); 547 398 } 548 399 } … … 561 412 flatten( dcl->get_type(), back_inserter( types ) ); 562 413 for ( Type * t : types ) { 414 // outermost const, volatile, _Atomic qualifiers in parameters should not play a role in the unification of function types, since they do not determine whether a function is callable. 415 // Note: MUST consider at least mutex qualifier, since functions can be overloaded on outermost mutex and a mutex function has different requirements than a non-mutex function. 416 t->get_qualifiers() -= Type::Qualifiers(Type::Const | Type::Volatile | Type::Atomic); 417 563 418 dst.push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::C, nullptr, t, nullptr ) ); 564 419 } … … 567 422 } 568 423 569 void Unify:: visit(FunctionType *functionType) {424 void Unify::postvisit(FunctionType *functionType) { 570 425 FunctionType *otherFunction = dynamic_cast< FunctionType* >( type2 ); 571 426 if ( otherFunction && functionType->get_isVarArgs() == otherFunction->get_isVarArgs() ) { … … 578 433 579 434 // sizes don't have to match if ttypes are involved; need to be more precise wrt where the ttype is to prevent errors 580 if ( (flatFunc-> get_parameters().size() == flatOther->get_parameters().size() && flatFunc->get_returnVals().size() == flatOther->get_returnVals().size()) || flatFunc->isTtype() || flatOther->isTtype() ) {581 if ( unifyDeclList( flatFunc-> get_parameters().begin(), flatFunc->get_parameters().end(), flatOther->get_parameters().begin(), flatOther->get_parameters().end(), env, needAssertions, haveAssertions, openVars, indexer ) ) {582 if ( unifyDeclList( flatFunc-> get_returnVals().begin(), flatFunc->get_returnVals().end(), flatOther->get_returnVals().begin(), flatOther->get_returnVals().end(), env, needAssertions, haveAssertions, openVars, indexer ) ) {435 if ( (flatFunc->parameters.size() == flatOther->parameters.size() && flatFunc->returnVals.size() == flatOther->returnVals.size()) || flatFunc->isTtype() || flatOther->isTtype() ) { 436 if ( unifyDeclList( flatFunc->parameters.begin(), flatFunc->parameters.end(), flatOther->parameters.begin(), flatOther->parameters.end(), env, needAssertions, haveAssertions, openVars, indexer ) ) { 437 if ( unifyDeclList( flatFunc->returnVals.begin(), flatFunc->returnVals.end(), flatOther->returnVals.begin(), flatOther->returnVals.end(), env, needAssertions, haveAssertions, openVars, indexer ) ) { 583 438 584 439 // the original types must be used in mark assertions, since pointer comparisons are used … … 597 452 // check that other type is compatible and named the same 598 453 RefType *otherStruct = dynamic_cast< RefType* >( other ); 599 result = otherStruct && inst-> get_name() == otherStruct->get_name();454 result = otherStruct && inst->name == otherStruct->name; 600 455 } 601 456 … … 606 461 if ( ! result ) return; 607 462 // Check that parameters of types unify, if any 608 std::list< Expression* > params = inst-> get_parameters();609 std::list< Expression* > otherParams = ((RefType*)other)-> get_parameters();463 std::list< Expression* > params = inst->parameters; 464 std::list< Expression* > otherParams = ((RefType*)other)->parameters; 610 465 611 466 std::list< Expression* >::const_iterator it = params.begin(), jt = otherParams.begin(); … … 669 524 } 670 525 671 void Unify:: visit(StructInstType *structInst) {526 void Unify::postvisit(StructInstType *structInst) { 672 527 handleGenericRefType( structInst, type2 ); 673 528 } 674 529 675 void Unify:: visit(UnionInstType *unionInst) {530 void Unify::postvisit(UnionInstType *unionInst) { 676 531 handleGenericRefType( unionInst, type2 ); 677 532 } 678 533 679 void Unify:: visit(EnumInstType *enumInst) {534 void Unify::postvisit(EnumInstType *enumInst) { 680 535 handleRefType( enumInst, type2 ); 681 536 } 682 537 683 void Unify:: visit(TraitInstType *contextInst) {538 void Unify::postvisit(TraitInstType *contextInst) { 684 539 handleRefType( contextInst, type2 ); 685 540 } 686 541 687 void Unify:: visit(TypeInstType *typeInst) {542 void Unify::postvisit(TypeInstType *typeInst) { 688 543 assert( openVars.find( typeInst->get_name() ) == openVars.end() ); 689 544 TypeInstType *otherInst = dynamic_cast< TypeInstType* >( type2 ); … … 740 595 } 741 596 742 void Unify:: visit(TupleType *tupleType) {597 void Unify::postvisit(TupleType *tupleType) { 743 598 if ( TupleType *otherTuple = dynamic_cast< TupleType* >( type2 ) ) { 744 599 std::unique_ptr<TupleType> flat1( tupleType->clone() ); … … 757 612 } 758 613 759 void Unify:: visit( __attribute__((unused)) VarArgsType *varArgsType ) {614 void Unify::postvisit( __attribute__((unused)) VarArgsType *varArgsType ) { 760 615 result = dynamic_cast< VarArgsType* >( type2 ); 761 616 } 762 617 763 void Unify:: visit( __attribute__((unused)) ZeroType *zeroType ) {618 void Unify::postvisit( __attribute__((unused)) ZeroType *zeroType ) { 764 619 result = dynamic_cast< ZeroType* >( type2 ); 765 620 } 766 621 767 void Unify:: visit( __attribute__((unused)) OneType *oneType ) {622 void Unify::postvisit( __attribute__((unused)) OneType *oneType ) { 768 623 result = dynamic_cast< OneType* >( type2 ); 769 624 } -
src/ResolvExpr/Unify.h
rf9feab8 r90152a4 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 13:09:04 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Fri Jul 21 23:09:34 201713 // Update Count : 311 // Last Modified By : Aaron B. Moss 12 // Last Modified On : Mon Jun 18 11:58:00 2018 13 // Update Count : 4 14 14 // 15 15 … … 21 21 #include "SynTree/Declaration.h" // for TypeDecl, TypeDecl::Data 22 22 #include "TypeEnvironment.h" // for AssertionSet, OpenVarSet 23 #include "WidenMode.h" // for WidenMode 23 24 24 25 class Type; … … 29 30 30 31 namespace ResolvExpr { 31 struct WidenMode {32 WidenMode( bool widenFirst, bool widenSecond ): widenFirst( widenFirst ), widenSecond( widenSecond ) {}33 WidenMode &operator|=( const WidenMode &other ) { widenFirst |= other.widenFirst; widenSecond |= other.widenSecond; return *this; }34 WidenMode &operator&=( const WidenMode &other ) { widenFirst &= other.widenFirst; widenSecond &= other.widenSecond; return *this; }35 WidenMode operator|( const WidenMode &other ) { WidenMode newWM( *this ); newWM |= other; return newWM; }36 WidenMode operator&( const WidenMode &other ) { WidenMode newWM( *this ); newWM &= other; return newWM; }37 operator bool() { return widenFirst && widenSecond; }38 39 bool widenFirst : 1, widenSecond : 1;40 };41 42 bool bindVar( TypeInstType *typeInst, Type *other, const TypeDecl::Data & data, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer );43 32 bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer ); 44 33 bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer, Type *&commonType ); 45 34 bool unifyExact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer ); 35 bool unifyInexact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer, Type *&common ); 46 36 47 37 template< typename Iterator1, typename Iterator2 > -
src/ResolvExpr/typeops.h
rf9feab8 r90152a4 56 56 void adjustExprType( Type *&type, const TypeEnvironment &env, const SymTab::Indexer &indexer ); 57 57 58 /// Replaces array types with the equivalent pointer, and function types with a pointer-to-function using empty TypeEnvironment and Indexer 59 void adjustExprType( Type *& type ); 60 58 61 template< typename ForwardIterator > 59 62 void adjustExprTypeList( ForwardIterator begin, ForwardIterator end, const TypeEnvironment &env, const SymTab::Indexer &indexer ) { … … 103 106 104 107 // in AlternativeFinder.cc 105 void referenceToRvalueConversion( Expression *& expr );108 void referenceToRvalueConversion( Expression *& expr, Cost & cost ); 106 109 107 110 // flatten tuple type into list of types -
src/SymTab/Autogen.cc
rf9feab8 r90152a4 9 9 // Author : Rob Schluntz 10 10 // Created On : Thu Mar 03 15:45:56 2016 11 // Last Modified By : Andrew Beach12 // Last Modified On : Fri Jul 14 16:41:00 201713 // Update Count : 6 211 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Apr 27 14:39:06 2018 13 // Update Count : 63 14 14 // 15 15 … … 24 24 #include <vector> // for vector 25 25 26 #include "AddVisit.h" // for addVisit27 26 #include "CodeGen/OperatorTable.h" // for isCtorDtor, isCtorDtorAssign 28 27 #include "Common/PassVisitor.h" // for PassVisitor … … 335 334 definitions.push_back( dcl ); 336 335 indexer.addId( dcl ); 337 } catch ( SemanticError err) {336 } catch ( SemanticErrorException & ) { 338 337 // okay if decl does not resolve - that means the function should not be generated 339 338 delete dcl; … … 380 379 paramType->attributes.clear(); 381 380 // add a parameter corresponding to this field 382 memCtorType->parameters.push_back( new ObjectDecl( field->name, Type::StorageClasses(), LinkageSpec::Cforall, nullptr, paramType, nullptr ) ); 381 ObjectDecl * param = new ObjectDecl( field->name, Type::StorageClasses(), LinkageSpec::Cforall, nullptr, paramType, nullptr ); 382 cloneAll_if( field->attributes, param->attributes, [](Attribute * attr) { return attr->isValidOnFuncParam(); } ); 383 memCtorType->parameters.push_back( param ); 383 384 FunctionDecl * ctor = genFunc( "?{}", memCtorType->clone(), functionNesting ); 384 385 makeFieldCtorBody( aggregateDecl->members.begin(), aggregateDecl->members.end(), ctor ); -
src/SymTab/FixFunction.cc
rf9feab8 r90152a4 30 30 // can't delete function type because it may contain assertions, so transfer ownership to new object 31 31 ObjectDecl *pointer = new ObjectDecl( functionDecl->name, functionDecl->get_storageClasses(), functionDecl->linkage, nullptr, new PointerType( Type::Qualifiers(), functionDecl->type ), nullptr, functionDecl->attributes ); 32 pointer->location = functionDecl->location; 32 33 functionDecl->attributes.clear(); 33 34 functionDecl->type = nullptr; … … 36 37 } 37 38 39 // xxx - this passes on void[], e.g. 40 // void foo(void [10]); 41 // does not cause an error 42 38 43 Type * FixFunction::postmutate(ArrayType *arrayType) { 39 44 // need to recursively mutate the base type in order for multi-dimensional arrays to work. 40 45 PointerType *pointerType = new PointerType( arrayType->get_qualifiers(), arrayType->base, arrayType->dimension, arrayType->isVarLen, arrayType->isStatic ); 46 pointerType->location = arrayType->location; 41 47 arrayType->base = nullptr; 42 48 arrayType->dimension = nullptr; … … 62 68 void FixFunction::premutate(ZeroType *) { visit_children = false; } 63 69 void FixFunction::premutate(OneType *) { visit_children = false; } 70 71 bool fixFunction( DeclarationWithType *& dwt ) { 72 PassVisitor<FixFunction> fixer; 73 dwt = dwt->acceptMutator( fixer ); 74 return fixer.pass.isVoid; 75 } 64 76 } // namespace SymTab 65 77 -
src/SymTab/FixFunction.h
rf9feab8 r90152a4 47 47 bool isVoid; 48 48 }; 49 50 bool fixFunction( DeclarationWithType *& ); 49 51 } // namespace SymTab 50 52 -
src/SymTab/Indexer.cc
rf9feab8 r90152a4 26 26 #include "Common/SemanticError.h" // for SemanticError 27 27 #include "Common/utility.h" // for cloneAll 28 #include "GenPoly/GenPoly.h" 28 29 #include "InitTweak/InitTweak.h" // for isConstructor, isCopyFunction, isC... 29 30 #include "Mangler.h" // for Mangler … … 105 106 if ( ! CodeGen::isCtorDtorAssign( id ) ) return; 106 107 107 // helpful data structure 108 // helpful data structure to organize properties for a type 108 109 struct ValueType { 109 struct DeclBall { 110 struct DeclBall { // properties for this particular decl 110 111 IdData decl; 111 bool isUserDefinedFunc; // properties for this particular decl 112 bool isDefaultCtor; 113 bool isDtor; 112 bool isUserDefinedFunc; 114 113 bool isCopyFunc; 115 114 }; 116 115 // properties for this type 117 bool existsUserDefinedFunc = false; // any user-defined function found118 bool existsUserDefinedCtor = false; // any user-defined constructor found119 bool existsUserDefinedDtor = false; // any user-defined destructor found120 116 bool existsUserDefinedCopyFunc = false; // user-defined copy ctor found 121 bool existsUserDefinedDefaultCtor = false; // user-defined default ctorfound117 BaseSyntaxNode * deleteStmt = nullptr; // non-null if a user-defined function is found 122 118 std::list< DeclBall > decls; 123 119 … … 126 122 ValueType & operator+=( IdData data ) { 127 123 DeclarationWithType * function = data.id; 128 bool isUserDefinedFunc = ! LinkageSpec::isOverridable( function->get_linkage() ); 129 bool isDefaultCtor = InitTweak::isDefaultConstructor( function ); 130 bool isDtor = InitTweak::isDestructor( function ); 131 bool isCopyFunc = InitTweak::isCopyFunction( function, function->get_name() ); 132 decls.push_back( DeclBall{ data, isUserDefinedFunc, isDefaultCtor, isDtor, isCopyFunc } ); 133 existsUserDefinedFunc = existsUserDefinedFunc || isUserDefinedFunc; 134 existsUserDefinedCtor = existsUserDefinedCtor || (isUserDefinedFunc && CodeGen::isConstructor( function->get_name() ) ); 135 existsUserDefinedDtor = existsUserDefinedDtor || (isUserDefinedFunc && isDtor); 124 bool isUserDefinedFunc = ! LinkageSpec::isOverridable( function->linkage ); 125 bool isCopyFunc = InitTweak::isCopyFunction( function, function->name ); 126 decls.push_back( DeclBall{ data, isUserDefinedFunc, isCopyFunc } ); 136 127 existsUserDefinedCopyFunc = existsUserDefinedCopyFunc || (isUserDefinedFunc && isCopyFunc); 137 existsUserDefinedDefaultCtor = existsUserDefinedDefaultCtor || (isUserDefinedFunc && isDefaultCtor); 128 if ( isUserDefinedFunc && ! deleteStmt ) { 129 // any user-defined function can act as an implicit delete statement for generated constructors. 130 // a delete stmt should not act as an implicit delete statement. 131 deleteStmt = data.id; 132 } 138 133 return *this; 139 134 } … … 147 142 for ( auto decl : copy ) { 148 143 if ( FunctionDecl * function = dynamic_cast< FunctionDecl * >( decl.id ) ) { 149 std::list< DeclarationWithType * > & params = function-> get_functionType()->get_parameters();144 std::list< DeclarationWithType * > & params = function->type->parameters; 150 145 assert( ! params.empty() ); 151 146 // use base type of pointer, so that qualifiers on the pointer type aren't considered. … … 159 154 160 155 // if a type contains user defined ctor/dtor/assign, then special rules trigger, which determine 161 // the set of ctor/dtor/assign that are seen by the requester. In particular, if the user defines 162 // a default ctor, then the generated default ctor should never be seen, likewise for copy ctor 163 // and dtor. If the user defines any ctor/dtor, then no generated field ctors should be seen. 164 // If the user defines any ctor then the generated default ctor should not be seen (intrinsic default 165 // ctor must be overridden exactly). 156 // the set of ctor/dtor/assign that can be used by the requester. In particular, if the user defines 157 // a default ctor, then the generated default ctor is unavailable, likewise for copy ctor 158 // and dtor. If the user defines any ctor/dtor, then no generated field ctors are available. 159 // If the user defines any ctor then the generated default ctor is unavailable (intrinsic default 160 // ctor must be overridden exactly). If the user defines anything that looks like a copy constructor, 161 // then the generated copy constructor is unavailable, and likewise for the assignment operator. 166 162 for ( std::pair< const std::string, ValueType > & pair : funcMap ) { 167 163 ValueType & val = pair.second; 168 164 for ( ValueType::DeclBall ball : val.decls ) { 169 bool noUserDefinedFunc = ! val.existsUserDefinedFunc; 170 bool isUserDefinedFunc = ball.isUserDefinedFunc; 171 bool isAcceptableDefaultCtor = (! val.existsUserDefinedCtor || (! val.existsUserDefinedDefaultCtor && ball.decl.id->get_linkage() == LinkageSpec::Intrinsic)) && ball.isDefaultCtor; // allow default constructors only when no user-defined constructors exist, except in the case of intrinsics, which require exact overrides 172 bool isAcceptableCopyFunc = ! val.existsUserDefinedCopyFunc && ball.isCopyFunc; // handles copy ctor and assignment operator 173 bool isAcceptableDtor = ! val.existsUserDefinedDtor && ball.isDtor; 174 if ( noUserDefinedFunc || isUserDefinedFunc || isAcceptableDefaultCtor || isAcceptableCopyFunc || isAcceptableDtor ) { 175 // decl conforms to the rules described above, so it should be seen by the requester 176 out.push_back( ball.decl ); 165 bool isNotUserDefinedFunc = ! ball.isUserDefinedFunc && ball.decl.id->linkage != LinkageSpec::Intrinsic; 166 bool isCopyFunc = ball.isCopyFunc; 167 bool existsUserDefinedCopyFunc = val.existsUserDefinedCopyFunc; 168 169 // only implicitly delete non-user defined functions that are not intrinsic, and are 170 // not copy functions (assignment or copy constructor). If a user-defined copy function exists, 171 // do not pass along the non-user-defined copy functions since signatures do not have to match, 172 // and the generated functions will often be cheaper. 173 if ( isNotUserDefinedFunc ) { 174 if ( isCopyFunc ) { 175 // Skip over non-user-defined copy functions when there is a user-defined copy function. 176 // Since their signatures do not have to be exact, deleting them is the wrong choice. 177 if ( existsUserDefinedCopyFunc ) continue; 178 } else { 179 // delete non-user-defined non-copy functions if applicable. 180 // deleteStmt will be non-null only if a user-defined function is found. 181 ball.decl.deleteStmt = val.deleteStmt; 182 } 177 183 } 184 out.push_back( ball.decl ); 178 185 } 179 186 } … … 265 272 } 266 273 274 NamedTypeDecl *Indexer::globalLookupType( const std::string &id ) const { 275 return lookupTypeAtScope( id, 0 ); 276 } 277 278 StructDecl *Indexer::globalLookupStruct( const std::string &id ) const { 279 return lookupStructAtScope( id, 0 ); 280 } 281 282 UnionDecl *Indexer::globalLookupUnion( const std::string &id ) const { 283 return lookupUnionAtScope( id, 0 ); 284 } 285 286 EnumDecl *Indexer::globalLookupEnum( const std::string &id ) const { 287 return lookupEnumAtScope( id, 0 ); 288 } 289 267 290 EnumDecl *Indexer::lookupEnum( const std::string &id ) const { 268 291 if ( ! tables ) return 0; … … 286 309 } 287 310 288 DeclarationWithType *Indexer::lookupIdAtScope( const std::string &id, const std::string &mangleName, unsigned long scope ) const {289 if ( ! tables ) return 0;290 if ( tables->scope < scope ) return 0;311 const Indexer::IdData * Indexer::lookupIdAtScope( const std::string &id, const std::string &mangleName, unsigned long scope ) const { 312 if ( ! tables ) return nullptr; 313 if ( tables->scope < scope ) return nullptr; 291 314 292 315 IdTable::const_iterator decls = tables->idTable.find( id ); … … 294 317 const MangleTable &mangleTable = decls->second; 295 318 MangleTable::const_iterator decl = mangleTable.find( mangleName ); 296 if ( decl != mangleTable.end() ) return decl->second.id;319 if ( decl != mangleTable.end() ) return &decl->second; 297 320 } 298 321 299 322 return tables->base.lookupIdAtScope( id, mangleName, scope ); 323 } 324 325 Indexer::IdData * Indexer::lookupIdAtScope( const std::string &id, const std::string &mangleName, unsigned long scope ) { 326 return const_cast<IdData *>(const_cast<const Indexer *>(this)->lookupIdAtScope( id, mangleName, scope )); 300 327 } 301 328 … … 336 363 if ( ! tables ) return 0; 337 364 if ( tables->scope < scope ) return 0; 365 if ( tables->scope > scope ) return tables->base.lookupTypeAtScope( id, scope ); 338 366 339 367 TypeTable::const_iterator ret = tables->typeTable.find( id ); … … 344 372 if ( ! tables ) return 0; 345 373 if ( tables->scope < scope ) return 0; 374 if ( tables->scope > scope ) return tables->base.lookupStructAtScope( id, scope ); 346 375 347 376 StructTable::const_iterator ret = tables->structTable.find( id ); … … 352 381 if ( ! tables ) return 0; 353 382 if ( tables->scope < scope ) return 0; 383 if ( tables->scope > scope ) return tables->base.lookupEnumAtScope( id, scope ); 354 384 355 385 EnumTable::const_iterator ret = tables->enumTable.find( id ); … … 360 390 if ( ! tables ) return 0; 361 391 if ( tables->scope < scope ) return 0; 392 if ( tables->scope > scope ) return tables->base.lookupUnionAtScope( id, scope ); 362 393 363 394 UnionTable::const_iterator ret = tables->unionTable.find( id ); … … 368 399 if ( ! tables ) return 0; 369 400 if ( tables->scope < scope ) return 0; 401 if ( tables->scope > scope ) return tables->base.lookupTraitAtScope( id, scope ); 370 402 371 403 TraitTable::const_iterator ret = tables->traitTable.find( id ); … … 373 405 } 374 406 375 bool addedIdConflicts( DeclarationWithType *existing, DeclarationWithType *added ) { 407 bool isFunction( DeclarationWithType * decl ) { 408 return GenPoly::getFunctionType( decl->get_type() ); 409 } 410 411 bool isObject( DeclarationWithType * decl ) { 412 return ! isFunction( decl ); 413 } 414 415 bool isDefinition( DeclarationWithType * decl ) { 416 if ( FunctionDecl * func = dynamic_cast< FunctionDecl * >( decl ) ) { 417 // a function is a definition if it has a body 418 return func->statements; 419 } else { 420 // an object is a definition if it is not marked extern. 421 // both objects must be marked extern 422 return ! decl->get_storageClasses().is_extern; 423 } 424 } 425 426 bool addedIdConflicts( Indexer::IdData & existing, DeclarationWithType *added, BaseSyntaxNode * deleteStmt, Indexer::ConflictFunction handleConflicts ) { 376 427 // if we're giving the same name mangling to things of different types then there is something wrong 377 assert( ( dynamic_cast<ObjectDecl*>( added ) && dynamic_cast<ObjectDecl*>( existing) )378 || ( dynamic_cast<FunctionDecl*>( added ) && dynamic_cast<FunctionDecl*>( existing) ) );379 380 if ( LinkageSpec::isOverridable( existing ->get_linkage() ) ) {428 assert( (isObject( added ) && isObject( existing.id ) ) 429 || ( isFunction( added ) && isFunction( existing.id ) ) ); 430 431 if ( LinkageSpec::isOverridable( existing.id->get_linkage() ) ) { 381 432 // new definition shadows the autogenerated one, even at the same scope 382 433 return false; 383 } else if ( LinkageSpec::isMangled( added->get_linkage() ) || ResolvExpr::typesCompatible( added->get_type(), existing->get_type(), Indexer() ) ) { 384 // typesCompatible doesn't really do the right thing here. When checking compatibility of function types, 385 // we should ignore outermost pointer qualifiers, except _Atomic? 386 FunctionDecl *newentry = dynamic_cast< FunctionDecl* >( added ); 387 FunctionDecl *oldentry = dynamic_cast< FunctionDecl* >( existing ); 388 if ( newentry && oldentry ) { 389 if ( newentry->get_statements() && oldentry->get_statements() ) { 390 throw SemanticError( "duplicate function definition for ", added ); 391 } // if 392 } else { 393 // two objects with the same mangled name defined in the same scope. 394 // both objects must be marked extern or both must be intrinsic for this to be okay 395 // xxx - perhaps it's actually if either is intrinsic then this is okay? 396 // might also need to be same storage class? 397 ObjectDecl *newobj = dynamic_cast< ObjectDecl* >( added ); 398 ObjectDecl *oldobj = dynamic_cast< ObjectDecl* >( existing ); 399 if ( ! newobj->get_storageClasses().is_extern && ! oldobj->get_storageClasses().is_extern ) { 400 throw SemanticError( "duplicate object definition for ", added ); 434 } else if ( LinkageSpec::isMangled( added->get_linkage() ) || ResolvExpr::typesCompatible( added->get_type(), existing.id->get_type(), Indexer() ) ) { 435 436 // it is a conflict if one declaration is deleted and the other is not 437 if ( deleteStmt && ! existing.deleteStmt ) { 438 return handleConflicts( existing, "deletion of defined identifier " ); 439 } else if ( ! deleteStmt && existing.deleteStmt ) { 440 return handleConflicts( existing, "definition of deleted identifier " ); 441 } 442 443 if ( isDefinition( added ) && isDefinition( existing.id ) ) { 444 if ( isFunction( added ) ) { 445 return handleConflicts( existing, "duplicate function definition for " ); 446 } else { 447 return handleConflicts( existing, "duplicate object definition for " ); 401 448 } // if 402 449 } // if 403 450 } else { 404 throw SemanticError( "duplicate definition for ", added);451 return handleConflicts( existing, "duplicate definition for " ); 405 452 } // if 406 453 … … 408 455 } 409 456 410 void Indexer::addId( DeclarationWithType *decl, Expression * baseExpr ) { 457 void Indexer::addId( DeclarationWithType *decl, ConflictFunction handleConflicts, Expression * baseExpr, BaseSyntaxNode * deleteStmt ) { 458 if ( decl->name == "" ) return; 411 459 debugPrint( "Adding Id " << decl->name << std::endl ); 412 460 makeWritable(); … … 430 478 // isomorphic to C type-compatibility, which it may not be. 431 479 if ( hasIncompatibleCDecl( name, mangleName, scope ) ) { 432 throw SemanticError( "conflicting overload of C function ", decl);433 } 434 } else { 435 // Check that a Cforall declaration doesn't over loadany C declaration480 SemanticError( decl, "conflicting overload of C function " ); 481 } 482 } else { 483 // Check that a Cforall declaration doesn't override any C declaration 436 484 if ( hasCompatibleCDecl( name, mangleName, scope ) ) { 437 throw SemanticError( "Cforall declaration hides C function ", decl);485 SemanticError( decl, "Cforall declaration hides C function " ); 438 486 } 439 487 } 440 488 441 489 // Skip repeat declarations of the same identifier 442 DeclarationWithType *existing = lookupIdAtScope( name, mangleName, scope );443 if ( existing && addedIdConflicts( existing, decl) ) return;490 IdData * existing = lookupIdAtScope( name, mangleName, scope ); 491 if ( existing && existing->id && addedIdConflicts( *existing, decl, deleteStmt, handleConflicts ) ) return; 444 492 445 493 // add to indexer 446 tables->idTable[ name ][ mangleName ] = { decl, baseExpr};494 tables->idTable[ name ][ mangleName ] = IdData{ decl, baseExpr, deleteStmt }; 447 495 ++tables->size; 448 496 } 449 497 498 void Indexer::addId( DeclarationWithType * decl, Expression * baseExpr ) { 499 // default handling of conflicts is to raise an error 500 addId( decl, [decl](IdData &, const std::string & msg) { SemanticError( decl, msg ); return true; }, baseExpr, decl->isDeleted ? decl : nullptr ); 501 } 502 503 void Indexer::addDeletedId( DeclarationWithType * decl, BaseSyntaxNode * deleteStmt ) { 504 // default handling of conflicts is to raise an error 505 addId( decl, [decl](IdData &, const std::string & msg) { SemanticError( decl, msg ); return true; }, nullptr, deleteStmt ); 506 } 507 450 508 bool addedTypeConflicts( NamedTypeDecl *existing, NamedTypeDecl *added ) { 451 if ( existing-> get_base() == 0) {509 if ( existing->base == nullptr ) { 452 510 return false; 453 } else if ( added-> get_base() == 0) {511 } else if ( added->base == nullptr ) { 454 512 return true; 455 513 } else { 456 throw SemanticError( "redeclaration of ", added ); 457 } 514 assert( existing->base && added->base ); 515 // typedef redeclarations are errors only if types are different 516 if ( ! ResolvExpr::typesCompatible( existing->base, added->base, Indexer() ) ) { 517 SemanticError( added->location, "redeclaration of " + added->name ); 518 } 519 } 520 // does not need to be added to the table if both existing and added have a base that are the same 521 return true; 458 522 } 459 523 … … 462 526 makeWritable(); 463 527 464 const std::string &id = decl-> get_name();528 const std::string &id = decl->name; 465 529 TypeTable::iterator existing = tables->typeTable.find( id ); 466 530 if ( existing == tables->typeTable.end() ) { … … 478 542 479 543 bool addedDeclConflicts( AggregateDecl *existing, AggregateDecl *added ) { 480 if ( existing->get_members().empty()) {544 if ( ! existing->body ) { 481 545 return false; 482 } else if ( ! added->get_members().empty()) {483 throw SemanticError( "redeclaration of ", added);546 } else if ( added->body ) { 547 SemanticError( added, "redeclaration of " ); 484 548 } // if 485 549 return true; … … 495 559 makeWritable(); 496 560 497 const std::string &id = decl-> get_name();561 const std::string &id = decl->name; 498 562 StructTable::iterator existing = tables->structTable.find( id ); 499 563 if ( existing == tables->structTable.end() ) { … … 514 578 makeWritable(); 515 579 516 const std::string &id = decl-> get_name();580 const std::string &id = decl->name; 517 581 EnumTable::iterator existing = tables->enumTable.find( id ); 518 582 if ( existing == tables->enumTable.end() ) { … … 538 602 makeWritable(); 539 603 540 const std::string &id = decl-> get_name();604 const std::string &id = decl->name; 541 605 UnionTable::iterator existing = tables->unionTable.find( id ); 542 606 if ( existing == tables->unionTable.end() ) { … … 557 621 makeWritable(); 558 622 559 const std::string &id = decl-> get_name();623 const std::string &id = decl->name; 560 624 TraitTable::iterator existing = tables->traitTable.find( id ); 561 625 if ( existing == tables->traitTable.end() ) { … … 572 636 } 573 637 574 void Indexer::addWith( WithStmt * stmt ) { 575 for ( Expression * expr : stmt->exprs ) { 638 void Indexer::addMembers( AggregateDecl * aggr, Expression * expr, ConflictFunction handleConflicts ) { 639 for ( Declaration * decl : aggr->members ) { 640 if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * >( decl ) ) { 641 addId( dwt, handleConflicts, expr ); 642 if ( dwt->name == "" ) { 643 Type * t = dwt->get_type()->stripReferences(); 644 if ( dynamic_cast< StructInstType * >( t ) || dynamic_cast< UnionInstType * >( t ) ) { 645 Expression * base = expr->clone(); 646 ResolvExpr::Cost cost = ResolvExpr::Cost::zero; // xxx - carry this cost into the indexer as a base cost? 647 ResolvExpr::referenceToRvalueConversion( base, cost ); 648 addMembers( t->getAggr(), new MemberExpr( dwt, base ), handleConflicts ); 649 } 650 } 651 } 652 } 653 } 654 655 void Indexer::addWith( std::list< Expression * > & withExprs, BaseSyntaxNode * withStmt ) { 656 for ( Expression * expr : withExprs ) { 576 657 if ( expr->result ) { 577 658 AggregateDecl * aggr = expr->result->stripReferences()->getAggr(); 578 659 assertf( aggr, "WithStmt expr has non-aggregate type: %s", toString( expr->result ).c_str() ); 579 660 580 for ( Declaration * decl : aggr->members) {581 if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * >( decl ) ) {582 addId( dwt, expr );583 }584 } 661 addMembers( aggr, expr, [withStmt](IdData & existing, const std::string &) { 662 // on conflict, delete the identifier 663 existing.deleteStmt = withStmt; 664 return true; 665 }); 585 666 } 586 667 } … … 641 722 642 723 void Indexer::print( std::ostream &os, int indent ) const { 643 724 using std::cerr; 644 725 645 726 if ( tables ) { … … 666 747 } 667 748 668 Expression * Indexer::IdData::combine() const { 749 Expression * Indexer::IdData::combine( ResolvExpr::Cost & cost ) const { 750 Expression * ret = nullptr; 669 751 if ( baseExpr ) { 670 752 Expression * base = baseExpr->clone(); 671 ResolvExpr::referenceToRvalueConversion( base );672 Expression *ret = new MemberExpr( id, base );753 ResolvExpr::referenceToRvalueConversion( base, cost ); 754 ret = new MemberExpr( id, base ); 673 755 // xxx - this introduces hidden environments, for now remove them. 674 756 // std::swap( base->env, ret->env ); 675 757 delete base->env; 676 758 base->env = nullptr; 677 return ret; 678 } else { 679 return new VariableExpr( id ); 680 } 759 } else { 760 ret = new VariableExpr( id ); 761 } 762 if ( deleteStmt ) ret = new DeletedExpr( ret, deleteStmt ); 763 return ret; 681 764 } 682 765 } // namespace SymTab -
src/SymTab/Indexer.h
rf9feab8 r90152a4 19 19 #include <list> // for list 20 20 #include <string> // for string 21 #include <functional> // for function 21 22 22 23 #include "SynTree/Visitor.h" // for Visitor 23 24 #include "SynTree/SynTree.h" // for AST nodes 25 26 namespace ResolvExpr { 27 class Cost; 28 } 24 29 25 30 namespace SymTab { … … 40 45 41 46 struct IdData { 42 DeclarationWithType * id ;43 Expression * baseExpr ; // WithExpr47 DeclarationWithType * id = nullptr; 48 Expression * baseExpr = nullptr; // WithExpr 44 49 45 Expression * combine() const; 50 /// non-null if this declaration is deleted 51 BaseSyntaxNode * deleteStmt = nullptr; 52 53 // NOTE: shouldn't need either of these constructors, but gcc-4 does not properly support initializer lists with default members. 54 IdData() = default; 55 IdData( DeclarationWithType * id, Expression * baseExpr, BaseSyntaxNode * deleteStmt ) : id( id ), baseExpr( baseExpr ), deleteStmt( deleteStmt ) {} 56 57 Expression * combine( ResolvExpr::Cost & cost ) const; 46 58 }; 47 59 … … 59 71 TraitDecl *lookupTrait( const std::string &id ) const; 60 72 73 /// Gets the type declaration with the given ID at global scope 74 NamedTypeDecl *globalLookupType( const std::string &id ) const; 75 /// Gets the struct declaration with the given ID at global scope 76 StructDecl *globalLookupStruct( const std::string &id ) const; 77 /// Gets the union declaration with the given ID at global scope 78 UnionDecl *globalLookupUnion( const std::string &id ) const; 79 /// Gets the enum declaration with the given ID at global scope 80 EnumDecl *globalLookupEnum( const std::string &id ) const; 81 61 82 void print( std::ostream &os, int indent = 0 ) const; 62 83 63 84 /// looks up a specific mangled ID at the given scope 64 DeclarationWithType *lookupIdAtScope( const std::string &id, const std::string &mangleName, unsigned long scope ) const; 85 IdData * lookupIdAtScope( const std::string &id, const std::string &mangleName, unsigned long scope ); 86 const IdData * lookupIdAtScope( const std::string &id, const std::string &mangleName, unsigned long scope ) const; 65 87 /// returns true if there exists a declaration with C linkage and the given name with a different mangled name 66 88 bool hasIncompatibleCDecl( const std::string &id, const std::string &mangleName, unsigned long scope ) const; … … 74 96 TraitDecl *lookupTraitAtScope( const std::string &id, unsigned long scope ) const; 75 97 76 void addId( DeclarationWithType *decl, Expression * baseExpr = nullptr ); 98 typedef std::function<bool(IdData &, const std::string &)> ConflictFunction; 99 100 void addId( DeclarationWithType * decl, Expression * baseExpr = nullptr ); 101 void addDeletedId( DeclarationWithType * decl, BaseSyntaxNode * deleteStmt ); 102 77 103 void addType( NamedTypeDecl *decl ); 78 104 void addStruct( const std::string &id ); … … 84 110 85 111 /// adds all of the IDs from WithStmt exprs 86 void addWith( WithStmt * ); 112 void addWith( std::list< Expression * > & withExprs, BaseSyntaxNode * withStmt ); 113 114 /// adds all of the members of the Aggregate (addWith helper) 115 void addMembers( AggregateDecl * aggr, Expression * expr, ConflictFunction ); 87 116 88 117 /// convenience function for adding a list of Ids to the indexer … … 114 143 /// Ensures that tables variable is writable (i.e. allocated, uniquely owned by this Indexer, and at the current scope) 115 144 void makeWritable(); 145 146 /// common code for addId, addDeletedId, etc. 147 void addId( DeclarationWithType * decl, ConflictFunction, Expression * baseExpr = nullptr, BaseSyntaxNode * deleteStmt = nullptr ); 116 148 }; 117 149 } // namespace SymTab -
src/SymTab/Mangler.cc
rf9feab8 r90152a4 23 23 24 24 #include "CodeGen/OperatorTable.h" // for OperatorInfo, operatorLookup 25 #include "Common/PassVisitor.h" 25 26 #include "Common/SemanticError.h" // for SemanticError 26 27 #include "Common/utility.h" // for toString … … 31 32 32 33 namespace SymTab { 33 std::string Mangler::mangleType( Type * ty ) { 34 Mangler mangler( false, true, true ); 35 maybeAccept( ty, mangler ); 36 return mangler.get_mangleName(); 37 } 38 39 std::string Mangler::mangleConcrete( Type* ty ) { 40 Mangler mangler( false, false, false ); 41 maybeAccept( ty, mangler ); 42 return mangler.get_mangleName(); 43 } 44 45 Mangler::Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams ) 46 : nextVarNum( 0 ), isTopLevel( true ), mangleOverridable( mangleOverridable ), typeMode( typeMode ), mangleGenericParams( mangleGenericParams ) {} 47 48 Mangler::Mangler( const Mangler &rhs ) : mangleName() { 49 varNums = rhs.varNums; 50 nextVarNum = rhs.nextVarNum; 51 isTopLevel = rhs.isTopLevel; 52 mangleOverridable = rhs.mangleOverridable; 53 typeMode = rhs.typeMode; 54 } 55 56 void Mangler::mangleDecl( DeclarationWithType * declaration ) { 57 bool wasTopLevel = isTopLevel; 58 if ( isTopLevel ) { 59 varNums.clear(); 60 nextVarNum = 0; 61 isTopLevel = false; 62 } // if 63 mangleName << "__"; 64 CodeGen::OperatorInfo opInfo; 65 if ( operatorLookup( declaration->get_name(), opInfo ) ) { 66 mangleName << opInfo.outputName; 67 } else { 68 mangleName << declaration->get_name(); 69 } // if 70 mangleName << "__"; 71 maybeAccept( declaration->get_type(), *this ); 72 if ( mangleOverridable && LinkageSpec::isOverridable( declaration->get_linkage() ) ) { 73 // want to be able to override autogenerated and intrinsic routines, 74 // so they need a different name mangling 75 if ( declaration->get_linkage() == LinkageSpec::AutoGen ) { 76 mangleName << "autogen__"; 77 } else if ( declaration->get_linkage() == LinkageSpec::Intrinsic ) { 78 mangleName << "intrinsic__"; 79 } else { 80 // if we add another kind of overridable function, this has to change 81 assert( false && "unknown overrideable linkage" ); 82 } // if 34 namespace Mangler { 35 namespace { 36 /// Mangles names to a unique C identifier 37 struct Mangler : public WithShortCircuiting, public WithVisitorRef<Mangler>, public WithGuards { 38 Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams ); 39 Mangler( const Mangler & ) = delete; 40 41 void previsit( BaseSyntaxNode * ) { visit_children = false; } 42 43 void postvisit( ObjectDecl * declaration ); 44 void postvisit( FunctionDecl * declaration ); 45 void postvisit( TypeDecl * declaration ); 46 47 void postvisit( VoidType * voidType ); 48 void postvisit( BasicType * basicType ); 49 void postvisit( PointerType * pointerType ); 50 void postvisit( ArrayType * arrayType ); 51 void postvisit( ReferenceType * refType ); 52 void postvisit( FunctionType * functionType ); 53 void postvisit( StructInstType * aggregateUseType ); 54 void postvisit( UnionInstType * aggregateUseType ); 55 void postvisit( EnumInstType * aggregateUseType ); 56 void postvisit( TypeInstType * aggregateUseType ); 57 void postvisit( TraitInstType * inst ); 58 void postvisit( TupleType * tupleType ); 59 void postvisit( VarArgsType * varArgsType ); 60 void postvisit( ZeroType * zeroType ); 61 void postvisit( OneType * oneType ); 62 void postvisit( QualifiedType * qualType ); 63 64 std::string get_mangleName() { return mangleName.str(); } 65 private: 66 std::ostringstream mangleName; ///< Mangled name being constructed 67 typedef std::map< std::string, std::pair< int, int > > VarMapType; 68 VarMapType varNums; ///< Map of type variables to indices 69 int nextVarNum; ///< Next type variable index 70 bool isTopLevel; ///< Is the Mangler at the top level 71 bool mangleOverridable; ///< Specially mangle overridable built-in methods 72 bool typeMode; ///< Produce a unique mangled name for a type 73 bool mangleGenericParams; ///< Include generic parameters in name mangling if true 74 bool inFunctionType = false; ///< Include type qualifiers if false. 75 bool inQualifiedType = false; ///< Add start/end delimiters around qualified type 76 77 void mangleDecl( DeclarationWithType *declaration ); 78 void mangleRef( ReferenceToType *refType, std::string prefix ); 79 80 void printQualifiers( Type *type ); 81 }; // Mangler 82 } // namespace 83 84 std::string mangle( BaseSyntaxNode * decl, bool mangleOverridable, bool typeMode, bool mangleGenericParams ) { 85 PassVisitor<Mangler> mangler( mangleOverridable, typeMode, mangleGenericParams ); 86 maybeAccept( decl, mangler ); 87 return mangler.pass.get_mangleName(); 83 88 } 84 isTopLevel = wasTopLevel; 85 } 86 87 void Mangler::visit( ObjectDecl * declaration ) { 88 mangleDecl( declaration ); 89 } 90 91 void Mangler::visit( FunctionDecl * declaration ) { 92 mangleDecl( declaration ); 93 } 94 95 void Mangler::visit( VoidType * voidType ) { 96 printQualifiers( voidType ); 97 mangleName << "v"; 98 } 99 100 void Mangler::visit( BasicType * basicType ) { 101 static const char *btLetter[] = { 102 "b", // Bool 103 "c", // Char 104 "Sc", // SignedChar 105 "Uc", // UnsignedChar 106 "s", // ShortSignedInt 107 "Us", // ShortUnsignedInt 108 "i", // SignedInt 109 "Ui", // UnsignedInt 110 "l", // LongSignedInt 111 "Ul", // LongUnsignedInt 112 "q", // LongLongSignedInt 113 "Uq", // LongLongUnsignedInt 114 "f", // Float 115 "d", // Double 116 "r", // LongDouble 117 "Xf", // FloatComplex 118 "Xd", // DoubleComplex 119 "Xr", // LongDoubleComplex 120 "If", // FloatImaginary 121 "Id", // DoubleImaginary 122 "Ir", // LongDoubleImaginary 123 "w", // SignedInt128 124 "Uw", // UnsignedInt128 125 }; 126 127 printQualifiers( basicType ); 128 mangleName << btLetter[ basicType->get_kind() ]; 129 } 130 131 void Mangler::visit( PointerType * pointerType ) { 132 printQualifiers( pointerType ); 133 mangleName << "P"; 134 maybeAccept( pointerType->get_base(), *this ); 135 } 136 137 void Mangler::visit( ArrayType * arrayType ) { 138 // TODO: encode dimension 139 printQualifiers( arrayType ); 140 mangleName << "A0"; 141 maybeAccept( arrayType->get_base(), *this ); 142 } 143 144 void Mangler::visit( ReferenceType * refType ) { 145 printQualifiers( refType ); 146 mangleName << "R"; 147 maybeAccept( refType->get_base(), *this ); 148 } 149 150 namespace { 151 inline std::list< Type* > getTypes( const std::list< DeclarationWithType* > decls ) { 152 std::list< Type* > ret; 153 std::transform( decls.begin(), decls.end(), std::back_inserter( ret ), 154 std::mem_fun( &DeclarationWithType::get_type ) ); 155 return ret; 89 90 std::string mangleType( Type * ty ) { 91 PassVisitor<Mangler> mangler( false, true, true ); 92 maybeAccept( ty, mangler ); 93 return mangler.pass.get_mangleName(); 156 94 } 157 } 158 159 void Mangler::visit( FunctionType * functionType ) { 160 printQualifiers( functionType ); 161 mangleName << "F"; 162 std::list< Type* > returnTypes = getTypes( functionType->get_returnVals() ); 163 acceptAll( returnTypes, *this ); 164 mangleName << "_"; 165 std::list< Type* > paramTypes = getTypes( functionType->get_parameters() ); 166 acceptAll( paramTypes, *this ); 167 mangleName << "_"; 168 } 169 170 void Mangler::mangleRef( ReferenceToType * refType, std::string prefix ) { 171 printQualifiers( refType ); 172 173 mangleName << ( refType->get_name().length() + prefix.length() ) << prefix << refType->get_name(); 174 175 if ( mangleGenericParams ) { 176 std::list< Expression* >& params = refType->get_parameters(); 177 if ( ! params.empty() ) { 95 96 std::string mangleConcrete( Type * ty ) { 97 PassVisitor<Mangler> mangler( false, false, false ); 98 maybeAccept( ty, mangler ); 99 return mangler.pass.get_mangleName(); 100 } 101 102 namespace { 103 Mangler::Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams ) 104 : nextVarNum( 0 ), isTopLevel( true ), mangleOverridable( mangleOverridable ), typeMode( typeMode ), mangleGenericParams( mangleGenericParams ) {} 105 106 void Mangler::mangleDecl( DeclarationWithType * declaration ) { 107 bool wasTopLevel = isTopLevel; 108 if ( isTopLevel ) { 109 varNums.clear(); 110 nextVarNum = 0; 111 isTopLevel = false; 112 } // if 113 mangleName << Encoding::manglePrefix; 114 CodeGen::OperatorInfo opInfo; 115 if ( operatorLookup( declaration->get_name(), opInfo ) ) { 116 mangleName << opInfo.outputName.size() << opInfo.outputName; 117 } else { 118 mangleName << declaration->name.size() << declaration->name; 119 } // if 120 maybeAccept( declaration->get_type(), *visitor ); 121 if ( mangleOverridable && LinkageSpec::isOverridable( declaration->get_linkage() ) ) { 122 // want to be able to override autogenerated and intrinsic routines, 123 // so they need a different name mangling 124 if ( declaration->get_linkage() == LinkageSpec::AutoGen ) { 125 mangleName << Encoding::autogen; 126 } else if ( declaration->get_linkage() == LinkageSpec::Intrinsic ) { 127 mangleName << Encoding::intrinsic; 128 } else { 129 // if we add another kind of overridable function, this has to change 130 assert( false && "unknown overrideable linkage" ); 131 } // if 132 } 133 isTopLevel = wasTopLevel; 134 } 135 136 void Mangler::postvisit( ObjectDecl * declaration ) { 137 mangleDecl( declaration ); 138 } 139 140 void Mangler::postvisit( FunctionDecl * declaration ) { 141 mangleDecl( declaration ); 142 } 143 144 void Mangler::postvisit( VoidType * voidType ) { 145 printQualifiers( voidType ); 146 mangleName << Encoding::void_t; 147 } 148 149 void Mangler::postvisit( BasicType * basicType ) { 150 printQualifiers( basicType ); 151 assertf( basicType->get_kind() < BasicType::NUMBER_OF_BASIC_TYPES, "Unhandled basic type: %d", basicType->get_kind() ); 152 mangleName << Encoding::basicTypes[ basicType->get_kind() ]; 153 } 154 155 void Mangler::postvisit( PointerType * pointerType ) { 156 printQualifiers( pointerType ); 157 // mangle void (*f)() and void f() to the same name to prevent overloading on functions and function pointers 158 if ( ! dynamic_cast<FunctionType *>( pointerType->base ) ) mangleName << Encoding::pointer; 159 maybeAccept( pointerType->base, *visitor ); 160 } 161 162 void Mangler::postvisit( ArrayType * arrayType ) { 163 // TODO: encode dimension 164 printQualifiers( arrayType ); 165 mangleName << Encoding::array << "0"; 166 maybeAccept( arrayType->base, *visitor ); 167 } 168 169 void Mangler::postvisit( ReferenceType * refType ) { 170 // don't print prefix (e.g. 'R') for reference types so that references and non-references do not overload. 171 // Further, do not print the qualifiers for a reference type (but do run printQualifers because of TypeDecls, etc.), 172 // by pretending every reference type is a function parameter. 173 GuardValue( inFunctionType ); 174 inFunctionType = true; 175 printQualifiers( refType ); 176 maybeAccept( refType->base, *visitor ); 177 } 178 179 namespace { 180 inline std::list< Type* > getTypes( const std::list< DeclarationWithType* > decls ) { 181 std::list< Type* > ret; 182 std::transform( decls.begin(), decls.end(), std::back_inserter( ret ), 183 std::mem_fun( &DeclarationWithType::get_type ) ); 184 return ret; 185 } 186 } 187 188 void Mangler::postvisit( FunctionType * functionType ) { 189 printQualifiers( functionType ); 190 mangleName << Encoding::function; 191 // turn on inFunctionType so that printQualifiers does not print most qualifiers for function parameters, 192 // since qualifiers on outermost parameter type do not differentiate function types, e.g., 193 // void (*)(const int) and void (*)(int) are the same type, but void (*)(const int *) and void (*)(int *) are different 194 GuardValue( inFunctionType ); 195 inFunctionType = true; 196 std::list< Type* > returnTypes = getTypes( functionType->returnVals ); 197 if (returnTypes.empty()) mangleName << Encoding::void_t; 198 else acceptAll( returnTypes, *visitor ); 178 199 mangleName << "_"; 179 for ( std::list< Expression* >::const_iterator param = params.begin(); param != params.end(); ++param ) { 180 TypeExpr *paramType = dynamic_cast< TypeExpr* >( *param ); 181 assertf(paramType, "Aggregate parameters should be type expressions: %s", toString(*param).c_str()); 182 maybeAccept( paramType->get_type(), *this ); 183 } 200 std::list< Type* > paramTypes = getTypes( functionType->parameters ); 201 acceptAll( paramTypes, *visitor ); 184 202 mangleName << "_"; 185 203 } 186 } 187 } 188 189 void Mangler::visit( StructInstType * aggregateUseType ) { 190 mangleRef( aggregateUseType, "s" ); 191 } 192 193 void Mangler::visit( UnionInstType * aggregateUseType ) { 194 mangleRef( aggregateUseType, "u" ); 195 } 196 197 void Mangler::visit( EnumInstType * aggregateUseType ) { 198 mangleRef( aggregateUseType, "e" ); 199 } 200 201 void Mangler::visit( TypeInstType * typeInst ) { 202 VarMapType::iterator varNum = varNums.find( typeInst->get_name() ); 203 if ( varNum == varNums.end() ) { 204 mangleRef( typeInst, "t" ); 205 } else { 206 printQualifiers( typeInst ); 207 std::ostringstream numStream; 208 numStream << varNum->second.first; 209 switch ( (TypeDecl::Kind )varNum->second.second ) { 210 case TypeDecl::Dtype: 211 mangleName << "d"; 212 break; 213 case TypeDecl::Ftype: 214 mangleName << "f"; 215 break; 216 case TypeDecl::Ttype: 217 mangleName << "tVARGS"; 218 break; 219 default: 220 assert( false ); 221 } // switch 222 mangleName << numStream.str(); 223 } // if 224 } 225 226 void Mangler::visit( TupleType * tupleType ) { 227 printQualifiers( tupleType ); 228 mangleName << "T"; 229 acceptAll( tupleType->types, *this ); 230 mangleName << "_"; 231 } 232 233 void Mangler::visit( VarArgsType * varArgsType ) { 234 printQualifiers( varArgsType ); 235 mangleName << "VARGS"; 236 } 237 238 void Mangler::visit( ZeroType * ) { 239 mangleName << "Z"; 240 } 241 242 void Mangler::visit( OneType * ) { 243 mangleName << "O"; 244 } 245 246 void Mangler::visit( TypeDecl * decl ) { 247 static const char *typePrefix[] = { "BT", "BD", "BF" }; 248 mangleName << typePrefix[ decl->get_kind() ] << ( decl->name.length() + 1 ) << decl->name; 249 } 250 251 void printVarMap( const std::map< std::string, std::pair< int, int > > &varMap, std::ostream &os ) { 252 for ( std::map< std::string, std::pair< int, int > >::const_iterator i = varMap.begin(); i != varMap.end(); ++i ) { 253 os << i->first << "(" << i->second.first << "/" << i->second.second << ")" << std::endl; 254 } // for 255 } 256 257 void Mangler::printQualifiers( Type * type ) { 258 // skip if not including qualifiers 259 if ( typeMode ) return; 260 261 if ( ! type->get_forall().empty() ) { 262 std::list< std::string > assertionNames; 263 int tcount = 0, dcount = 0, fcount = 0, vcount = 0; 264 mangleName << "A"; 265 for ( Type::ForallList::iterator i = type->forall.begin(); i != type->forall.end(); ++i ) { 266 switch ( (*i)->get_kind() ) { 267 case TypeDecl::Dtype: 268 dcount++; 269 break; 270 case TypeDecl::Ftype: 271 fcount++; 272 break; 273 case TypeDecl::Ttype: 274 vcount++; 275 break; 276 default: 277 assert( false ); 278 } // switch 279 varNums[ (*i)->name ] = std::pair< int, int >( nextVarNum++, (int)(*i)->get_kind() ); 280 for ( std::list< DeclarationWithType* >::iterator assert = (*i)->assertions.begin(); assert != (*i)->assertions.end(); ++assert ) { 281 Mangler sub_mangler( mangleOverridable, typeMode, mangleGenericParams ); 282 sub_mangler.nextVarNum = nextVarNum; 283 sub_mangler.isTopLevel = false; 284 sub_mangler.varNums = varNums; 285 (*assert)->accept( sub_mangler ); 286 assertionNames.push_back( sub_mangler.mangleName.str() ); 204 205 void Mangler::mangleRef( ReferenceToType * refType, std::string prefix ) { 206 printQualifiers( refType ); 207 208 mangleName << prefix << refType->name.length() << refType->name; 209 210 if ( mangleGenericParams ) { 211 std::list< Expression* >& params = refType->parameters; 212 if ( ! params.empty() ) { 213 mangleName << "_"; 214 for ( std::list< Expression* >::const_iterator param = params.begin(); param != params.end(); ++param ) { 215 TypeExpr *paramType = dynamic_cast< TypeExpr* >( *param ); 216 assertf(paramType, "Aggregate parameters should be type expressions: %s", toCString(*param)); 217 maybeAccept( paramType->type, *visitor ); 218 } 219 mangleName << "_"; 220 } 221 } 222 } 223 224 void Mangler::postvisit( StructInstType * aggregateUseType ) { 225 mangleRef( aggregateUseType, Encoding::struct_t ); 226 } 227 228 void Mangler::postvisit( UnionInstType * aggregateUseType ) { 229 mangleRef( aggregateUseType, Encoding::union_t ); 230 } 231 232 void Mangler::postvisit( EnumInstType * aggregateUseType ) { 233 mangleRef( aggregateUseType, Encoding::enum_t ); 234 } 235 236 void Mangler::postvisit( TypeInstType * typeInst ) { 237 VarMapType::iterator varNum = varNums.find( typeInst->get_name() ); 238 if ( varNum == varNums.end() ) { 239 mangleRef( typeInst, Encoding::type ); 240 } else { 241 printQualifiers( typeInst ); 242 // Note: Can't use name here, since type variable names do not actually disambiguate a function, e.g. 243 // forall(dtype T) void f(T); 244 // forall(dtype S) void f(S); 245 // are equivalent and should mangle the same way. This is accomplished by numbering the type variables when they 246 // are first found and prefixing with the appropriate encoding for the type class. 247 assertf( varNum->second.second < TypeDecl::NUMBER_OF_KINDS, "Unhandled type variable kind: %d", varNum->second.second ); 248 mangleName << Encoding::typeVariables[varNum->second.second] << varNum->second.first; 249 } // if 250 } 251 252 void Mangler::postvisit( TraitInstType * inst ) { 253 printQualifiers( inst ); 254 mangleName << inst->name.size() << inst->name; 255 } 256 257 void Mangler::postvisit( TupleType * tupleType ) { 258 printQualifiers( tupleType ); 259 mangleName << Encoding::tuple << tupleType->types.size(); 260 acceptAll( tupleType->types, *visitor ); 261 } 262 263 void Mangler::postvisit( VarArgsType * varArgsType ) { 264 printQualifiers( varArgsType ); 265 static const std::string vargs = "__builtin_va_list"; 266 mangleName << Encoding::type << vargs.size() << vargs; 267 } 268 269 void Mangler::postvisit( ZeroType * ) { 270 mangleName << Encoding::zero; 271 } 272 273 void Mangler::postvisit( OneType * ) { 274 mangleName << Encoding::one; 275 } 276 277 void Mangler::postvisit( QualifiedType * qualType ) { 278 bool inqual = inQualifiedType; 279 if (! inqual ) { 280 // N marks the start of a qualified type 281 inQualifiedType = true; 282 mangleName << Encoding::qualifiedTypeStart; 283 } 284 maybeAccept( qualType->parent, *visitor ); 285 maybeAccept( qualType->child, *visitor ); 286 if ( ! inqual ) { 287 // E marks the end of a qualified type 288 inQualifiedType = false; 289 mangleName << Encoding::qualifiedTypeEnd; 290 } 291 } 292 293 void Mangler::postvisit( TypeDecl * decl ) { 294 // TODO: is there any case where mangling a TypeDecl makes sense? If so, this code needs to be 295 // fixed to ensure that two TypeDecls mangle to the same name when they are the same type and vice versa. 296 // Note: The current scheme may already work correctly for this case, I have not thought about this deeply 297 // and the case has not yet come up in practice. Alternatively, if not then this code can be removed 298 // aside from the assert false. 299 assertf(false, "Mangler should not visit typedecl: %s", toCString(decl)); 300 assertf( decl->get_kind() < TypeDecl::NUMBER_OF_KINDS, "Unhandled type variable kind: %d", decl->get_kind() ); 301 mangleName << Encoding::typeVariables[ decl->get_kind() ] << ( decl->name.length() ) << decl->name; 302 } 303 304 __attribute__((unused)) void printVarMap( const std::map< std::string, std::pair< int, int > > &varMap, std::ostream &os ) { 305 for ( std::map< std::string, std::pair< int, int > >::const_iterator i = varMap.begin(); i != varMap.end(); ++i ) { 306 os << i->first << "(" << i->second.first << "/" << i->second.second << ")" << std::endl; 287 307 } // for 288 } // for 289 mangleName << tcount << "_" << dcount << "_" << fcount << "_" << vcount << "_"; 290 std::copy( assertionNames.begin(), assertionNames.end(), std::ostream_iterator< std::string >( mangleName, "" ) ); 291 mangleName << "_"; 292 } // if 293 if ( type->get_const() ) { 294 mangleName << "C"; 295 } // if 296 if ( type->get_volatile() ) { 297 mangleName << "V"; 298 } // if 299 if ( type->get_mutex() ) { 300 mangleName << "M"; 301 } // if 302 // Removed due to restrict not affecting function compatibility in GCC 303 // if ( type->get_isRestrict() ) { 304 // mangleName << "E"; 305 // } // if 306 if ( type->get_lvalue() ) { 307 // mangle based on whether the type is lvalue, so that the resolver can differentiate lvalues and rvalues 308 mangleName << "L"; 309 } 310 if ( type->get_atomic() ) { 311 mangleName << "A"; 312 } // if 313 } 308 } 309 310 void Mangler::printQualifiers( Type * type ) { 311 // skip if not including qualifiers 312 if ( typeMode ) return; 313 if ( ! type->get_forall().empty() ) { 314 std::list< std::string > assertionNames; 315 int dcount = 0, fcount = 0, vcount = 0, acount = 0; 316 mangleName << Encoding::forall; 317 for ( Type::ForallList::iterator i = type->forall.begin(); i != type->forall.end(); ++i ) { 318 switch ( (*i)->get_kind() ) { 319 case TypeDecl::Dtype: 320 dcount++; 321 break; 322 case TypeDecl::Ftype: 323 fcount++; 324 break; 325 case TypeDecl::Ttype: 326 vcount++; 327 break; 328 default: 329 assert( false ); 330 } // switch 331 varNums[ (*i)->name ] = std::pair< int, int >( nextVarNum++, (int)(*i)->get_kind() ); 332 for ( std::list< DeclarationWithType* >::iterator assert = (*i)->assertions.begin(); assert != (*i)->assertions.end(); ++assert ) { 333 PassVisitor<Mangler> sub_mangler( mangleOverridable, typeMode, mangleGenericParams ); 334 sub_mangler.pass.nextVarNum = nextVarNum; 335 sub_mangler.pass.isTopLevel = false; 336 sub_mangler.pass.varNums = varNums; 337 (*assert)->accept( sub_mangler ); 338 assertionNames.push_back( sub_mangler.pass.mangleName.str() ); 339 acount++; 340 } // for 341 } // for 342 mangleName << dcount << "_" << fcount << "_" << vcount << "_" << acount << "_"; 343 std::copy( assertionNames.begin(), assertionNames.end(), std::ostream_iterator< std::string >( mangleName, "" ) ); 344 mangleName << "_"; 345 } // if 346 if ( ! inFunctionType ) { 347 // these qualifiers do not distinguish the outermost type of a function parameter 348 if ( type->get_const() ) { 349 mangleName << Encoding::qualifiers.at(Type::Const); 350 } // if 351 if ( type->get_volatile() ) { 352 mangleName << Encoding::qualifiers.at(Type::Volatile); 353 } // if 354 // Removed due to restrict not affecting function compatibility in GCC 355 // if ( type->get_isRestrict() ) { 356 // mangleName << "E"; 357 // } // if 358 if ( type->get_atomic() ) { 359 mangleName << Encoding::qualifiers.at(Type::Atomic); 360 } // if 361 } 362 if ( type->get_mutex() ) { 363 mangleName << Encoding::qualifiers.at(Type::Mutex); 364 } // if 365 if ( type->get_lvalue() ) { 366 // mangle based on whether the type is lvalue, so that the resolver can differentiate lvalues and rvalues 367 mangleName << Encoding::qualifiers.at(Type::Lvalue); 368 } 369 370 if ( inFunctionType ) { 371 // turn off inFunctionType so that types can be differentiated for nested qualifiers 372 GuardValue( inFunctionType ); 373 inFunctionType = false; 374 } 375 } 376 } // namespace 377 } // namespace Mangler 314 378 } // namespace SymTab 315 379 -
src/SymTab/Mangler.h
rf9feab8 r90152a4 24 24 #include "SynTree/Visitor.h" // for Visitor, maybeAccept 25 25 26 // https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling 27 // The CFA name mangling scheme is based closely on the itanium C++ name mangling scheme, with the following key differences: 28 // * Variable names are also mangled to include type information, not just functions 29 // * CFA does not have template expansion, so the rules for function specialization do not apply. 30 // * CFA instead has to handle type parameters and assertion parameters. 31 // * Currently name compression is not implemented. 32 26 33 namespace SymTab { 27 /// Mangles names to a unique C identifier 28 class Mangler : public Visitor { 29 public: 34 namespace Mangler { 30 35 /// Mangle syntax tree object; primary interface to clients 31 template< typename SynTreeClass >32 static std::string mangle( SynTreeClass *decl, bool mangleOverridable = true, bool typeMode = false, bool mangleGenericParams = true ); 36 std::string mangle( BaseSyntaxNode * decl, bool mangleOverridable = true, bool typeMode = false, bool mangleGenericParams = true ); 37 33 38 /// Mangle a type name; secondary interface 34 st atic std::string mangleType( Type* ty );39 std::string mangleType( Type* ty ); 35 40 /// Mangle ignoring generic type parameters 36 st atic std::string mangleConcrete( Type* ty );41 std::string mangleConcrete( Type* ty ); 37 42 43 namespace Encoding { 44 extern const std::string manglePrefix; 45 extern const std::string basicTypes[]; 46 extern const std::map<int, std::string> qualifiers; 38 47 39 virtual void visit( ObjectDecl *declaration );40 virtual void visit( FunctionDecl *declaration );41 virtual void visit( TypeDecl *declaration );48 extern const std::string void_t; 49 extern const std::string zero; 50 extern const std::string one; 42 51 43 virtual void visit( VoidType *voidType ); 44 virtual void visit( BasicType *basicType ); 45 virtual void visit( PointerType *pointerType ); 46 virtual void visit( ArrayType *arrayType ); 47 virtual void visit( ReferenceType *refType ); 48 virtual void visit( FunctionType *functionType ); 49 virtual void visit( StructInstType *aggregateUseType ); 50 virtual void visit( UnionInstType *aggregateUseType ); 51 virtual void visit( EnumInstType *aggregateUseType ); 52 virtual void visit( TypeInstType *aggregateUseType ); 53 virtual void visit( TupleType *tupleType ); 54 virtual void visit( VarArgsType *varArgsType ); 55 virtual void visit( ZeroType *zeroType ); 56 virtual void visit( OneType *oneType ); 52 extern const std::string function; 53 extern const std::string tuple; 54 extern const std::string pointer; 55 extern const std::string array; 56 extern const std::string qualifiedTypeStart; 57 extern const std::string qualifiedTypeEnd; 57 58 58 std::string get_mangleName() { return mangleName.str(); } 59 private: 60 std::ostringstream mangleName; ///< Mangled name being constructed 61 typedef std::map< std::string, std::pair< int, int > > VarMapType; 62 VarMapType varNums; ///< Map of type variables to indices 63 int nextVarNum; ///< Next type variable index 64 bool isTopLevel; ///< Is the Mangler at the top level 65 bool mangleOverridable; ///< Specially mangle overridable built-in methods 66 bool typeMode; ///< Produce a unique mangled name for a type 67 bool mangleGenericParams; ///< Include generic parameters in name mangling if true 59 extern const std::string forall; 60 extern const std::string typeVariables[]; 68 61 69 Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams ); 70 Mangler( const Mangler & ); 62 extern const std::string struct_t; 63 extern const std::string union_t; 64 extern const std::string enum_t; 65 extern const std::string type; 71 66 72 void mangleDecl( DeclarationWithType *declaration ); 73 void mangleRef( ReferenceToType *refType, std::string prefix ); 67 extern const std::string autogen; 68 extern const std::string intrinsic; 69 }; 70 } // Mangler 71 } // SymTab 74 72 75 void printQualifiers( Type *type ); 76 }; // Mangler 77 78 template< typename SynTreeClass > 79 std::string Mangler::mangle( SynTreeClass *decl, bool mangleOverridable, bool typeMode, bool mangleGenericParams ) { 80 Mangler mangler( mangleOverridable, typeMode, mangleGenericParams ); 81 maybeAccept( decl, mangler ); 82 return mangler.get_mangleName(); 83 } 84 } // SymTab 73 extern "C" { 74 char * cforall_demangle(const char *, int); 75 } 85 76 86 77 // Local Variables: // -
src/SymTab/Validate.cc
rf9feab8 r90152a4 48 48 #include "CodeGen/CodeGenerator.h" // for genName 49 49 #include "CodeGen/OperatorTable.h" // for isCtorDtor, isCtorDtorAssign 50 #include "ControlStruct/Mutate.h" // for ForExprMutator 50 51 #include "Common/PassVisitor.h" // for PassVisitor, WithDeclsToAdd 51 52 #include "Common/ScopedMap.h" // for ScopedMap … … 60 61 #include "Parser/LinkageSpec.h" // for C 61 62 #include "ResolvExpr/typeops.h" // for typesCompatible 62 #include "SymTab/AddVisit.h" // for addVisit 63 #include "ResolvExpr/Resolver.h" // for findSingleExpression 64 #include "ResolvExpr/ResolveTypeof.h" // for resolveTypeof 63 65 #include "SymTab/Autogen.h" // for SizeType 64 66 #include "SynTree/Attribute.h" // for noAttributes, Attribute … … 72 74 #include "SynTree/TypeSubstitution.h" // for TypeSubstitution 73 75 #include "SynTree/Visitor.h" // for Visitor 76 #include "Validate/HandleAttributes.h" // for handleAttributes 74 77 75 78 class CompoundStmt; … … 77 80 class SwitchStmt; 78 81 79 80 #define debugPrint( x ) if ( doDebug ) { std::cout << x; } 82 #define debugPrint( x ) if ( doDebug ) x 81 83 82 84 namespace SymTab { 85 /// hoists declarations that are difficult to hoist while parsing 86 struct HoistTypeDecls final : public WithDeclsToAdd { 87 void previsit( SizeofExpr * ); 88 void previsit( AlignofExpr * ); 89 void previsit( UntypedOffsetofExpr * ); 90 void previsit( CompoundLiteralExpr * ); 91 void handleType( Type * ); 92 }; 93 94 struct FixQualifiedTypes final : public WithIndexer { 95 Type * postmutate( QualifiedType * ); 96 }; 97 83 98 struct HoistStruct final : public WithDeclsToAdd, public WithGuards { 84 99 /// Flattens nested struct types 85 100 static void hoistStruct( std::list< Declaration * > &translationUnit ); 86 101 87 void previsit( EnumInstType * enumInstType );88 void previsit( StructInstType * structInstType );89 void previsit( UnionInstType * unionInstType );90 102 void previsit( StructDecl * aggregateDecl ); 91 103 void previsit( UnionDecl * aggregateDecl ); 104 void previsit( StaticAssertDecl * assertDecl ); 105 void previsit( StructInstType * type ); 106 void previsit( UnionInstType * type ); 107 void previsit( EnumInstType * type ); 92 108 93 109 private: 94 110 template< typename AggDecl > void handleAggregate( AggDecl *aggregateDecl ); 95 111 96 bool inStruct = false;112 AggregateDecl * parentAggr = nullptr; 97 113 }; 98 114 … … 112 128 113 129 /// Associates forward declarations of aggregates with their definitions 114 struct LinkReferenceToTypes final : public WithIndexer, public WithGuards {130 struct LinkReferenceToTypes final : public WithIndexer, public WithGuards, public WithVisitorRef<LinkReferenceToTypes>, public WithShortCircuiting { 115 131 LinkReferenceToTypes( const Indexer *indexer ); 116 132 void postvisit( TypeInstType *typeInst ); … … 120 136 void postvisit( UnionInstType *unionInst ); 121 137 void postvisit( TraitInstType *traitInst ); 138 void previsit( QualifiedType * qualType ); 139 void postvisit( QualifiedType * qualType ); 122 140 123 141 void postvisit( EnumDecl *enumDecl ); … … 148 166 void previsit( ObjectDecl * object ); 149 167 void previsit( FunctionDecl * func ); 168 void previsit( FunctionType * ftype ); 150 169 void previsit( StructDecl * aggrDecl ); 151 170 void previsit( UnionDecl * aggrDecl ); … … 164 183 }; 165 184 166 struct EliminateTypedef final : public WithVisitorRef<EliminateTypedef>, public WithGuards{167 EliminateTypedef() : scopeLevel( 0 ) {}185 struct ReplaceTypedef final : public WithVisitorRef<ReplaceTypedef>, public WithGuards, public WithShortCircuiting, public WithDeclsToAdd { 186 ReplaceTypedef() : scopeLevel( 0 ) {} 168 187 /// Replaces typedefs by forward declarations 169 static void eliminateTypedef( std::list< Declaration * > &translationUnit ); 170 188 static void replaceTypedef( std::list< Declaration * > &translationUnit ); 189 190 void premutate( QualifiedType * ); 191 Type * postmutate( QualifiedType * qualType ); 171 192 Type * postmutate( TypeInstType * aggregateUseType ); 172 193 Declaration * postmutate( TypedefDecl * typeDecl ); … … 179 200 180 201 void premutate( CompoundStmt * compoundStmt ); 181 CompoundStmt * postmutate( CompoundStmt * compoundStmt );182 202 183 203 void premutate( StructDecl * structDecl ); 184 Declaration * postmutate( StructDecl * structDecl );185 204 void premutate( UnionDecl * unionDecl ); 186 Declaration * postmutate( UnionDecl * unionDecl );187 205 void premutate( EnumDecl * enumDecl ); 188 Declaration * postmutate( EnumDecl * enumDecl ); 189 Declaration * postmutate( TraitDecl * contextDecl ); 206 void premutate( TraitDecl * ); 190 207 191 208 void premutate( FunctionType * ftype ); … … 193 210 private: 194 211 template<typename AggDecl> 195 AggDecl *handleAggregate( AggDecl * aggDecl );196 197 template<typename AggDecl>198 212 void addImplicitTypedef( AggDecl * aggDecl ); 213 template< typename AggDecl > 214 void handleAggregate( AggDecl * aggr ); 199 215 200 216 typedef std::unique_ptr<TypedefDecl> TypedefDeclPtr; 201 217 typedef ScopedMap< std::string, std::pair< TypedefDeclPtr, int > > TypedefMap; 202 typedef std::map< std::string, TypeDecl * > TypeDeclMap;218 typedef ScopedMap< std::string, TypeDecl * > TypeDeclMap; 203 219 TypedefMap typedefNames; 204 220 TypeDeclMap typedeclNames; 205 221 int scopeLevel; 206 222 bool inFunctionType = false; 223 }; 224 225 struct EliminateTypedef { 226 /// removes TypedefDecls from the AST 227 static void eliminateTypedef( std::list< Declaration * > &translationUnit ); 228 229 template<typename AggDecl> 230 void handleAggregate( AggDecl *aggregateDecl ); 231 232 void previsit( StructDecl * aggregateDecl ); 233 void previsit( UnionDecl * aggregateDecl ); 234 void previsit( CompoundStmt * compoundStmt ); 207 235 }; 208 236 … … 222 250 }; 223 251 224 struct ArrayLength { 252 struct FixObjectType : public WithIndexer { 253 /// resolves typeof type in object, function, and type declarations 254 static void fix( std::list< Declaration * > & translationUnit ); 255 256 void previsit( ObjectDecl * ); 257 void previsit( FunctionDecl * ); 258 void previsit( TypeDecl * ); 259 }; 260 261 struct ArrayLength : public WithIndexer { 225 262 /// for array types without an explicit length, compute the length and store it so that it 226 263 /// is known to the rest of the phases. For example, … … 233 270 234 271 void previsit( ObjectDecl * objDecl ); 272 void previsit( ArrayType * arrayType ); 235 273 }; 236 274 … … 262 300 PassVisitor<FindSpecialDeclarations> finder; 263 301 PassVisitor<LabelAddressFixer> labelAddrFixer; 264 265 EliminateTypedef::eliminateTypedef( translationUnit ); 266 HoistStruct::hoistStruct( translationUnit ); // must happen after EliminateTypedef, so that aggregate typedefs occur in the correct order 302 PassVisitor<HoistTypeDecls> hoistDecls; 303 PassVisitor<FixQualifiedTypes> fixQual; 304 305 acceptAll( translationUnit, hoistDecls ); 306 ReplaceTypedef::replaceTypedef( translationUnit ); 267 307 ReturnTypeFixer::fix( translationUnit ); // must happen before autogen 268 308 acceptAll( translationUnit, epc ); // must happen before VerifyCtorDtorAssign, because void return objects should not exist; before LinkReferenceToTypes because it is an indexer and needs correct types for mangling 269 309 acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions 310 mutateAll( translationUnit, fixQual ); // must happen after LinkReferenceToTypes, because aggregate members are accessed 311 HoistStruct::hoistStruct( translationUnit ); // must happen after EliminateTypedef, so that aggregate typedefs occur in the correct order 312 EliminateTypedef::eliminateTypedef( translationUnit ); // 270 313 acceptAll( translationUnit, genericParams ); // check as early as possible - can't happen before LinkReferenceToTypes 271 314 VerifyCtorDtorAssign::verify( translationUnit ); // must happen before autogen, because autogen examines existing ctor/dtors … … 274 317 Concurrency::applyKeywords( translationUnit ); 275 318 acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines, after Concurrency::applyKeywords because uniqueIds must be set on declaration before resolution 319 ControlStruct::hoistControlDecls( translationUnit ); // hoist initialization out of for statements; must happen before autogenerateRoutines 276 320 autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecay 277 321 Concurrency::implementMutexFuncs( translationUnit ); 278 322 Concurrency::implementThreadStarter( translationUnit ); 279 323 mutateAll( translationUnit, compoundliteral ); 324 ResolvExpr::resolveWithExprs( translationUnit ); // must happen before FixObjectType because user-code is resolved and may contain with variables 325 FixObjectType::fix( translationUnit ); 280 326 ArrayLength::computeLength( translationUnit ); 281 327 acceptAll( translationUnit, finder ); // xxx - remove this pass soon 282 328 mutateAll( translationUnit, labelAddrFixer ); 329 Validate::handleAttributes( translationUnit ); 283 330 } 284 331 … … 292 339 } 293 340 341 342 void HoistTypeDecls::handleType( Type * type ) { 343 // some type declarations are buried in expressions and not easy to hoist during parsing; hoist them here 344 AggregateDecl * aggr = nullptr; 345 if ( StructInstType * inst = dynamic_cast< StructInstType * >( type ) ) { 346 aggr = inst->baseStruct; 347 } else if ( UnionInstType * inst = dynamic_cast< UnionInstType * >( type ) ) { 348 aggr = inst->baseUnion; 349 } else if ( EnumInstType * inst = dynamic_cast< EnumInstType * >( type ) ) { 350 aggr = inst->baseEnum; 351 } 352 if ( aggr && aggr->body ) { 353 declsToAddBefore.push_front( aggr ); 354 } 355 } 356 357 void HoistTypeDecls::previsit( SizeofExpr * expr ) { 358 handleType( expr->type ); 359 } 360 361 void HoistTypeDecls::previsit( AlignofExpr * expr ) { 362 handleType( expr->type ); 363 } 364 365 void HoistTypeDecls::previsit( UntypedOffsetofExpr * expr ) { 366 handleType( expr->type ); 367 } 368 369 void HoistTypeDecls::previsit( CompoundLiteralExpr * expr ) { 370 handleType( expr->result ); 371 } 372 373 374 Type * FixQualifiedTypes::postmutate( QualifiedType * qualType ) { 375 Type * parent = qualType->parent; 376 Type * child = qualType->child; 377 if ( dynamic_cast< GlobalScopeType * >( qualType->parent ) ) { 378 // .T => lookup T at global scope 379 if ( TypeInstType * inst = dynamic_cast< TypeInstType * >( child ) ) { 380 auto td = indexer.globalLookupType( inst->name ); 381 if ( ! td ) { 382 SemanticError( qualType->location, toString("Use of undefined global type ", inst->name) ); 383 } 384 auto base = td->base; 385 assert( base ); 386 Type * ret = base->clone(); 387 ret->get_qualifiers() = qualType->get_qualifiers(); 388 return ret; 389 } else { 390 // .T => T is not a type name 391 assertf( false, "unhandled global qualified child type: %s", toCString(child) ); 392 } 393 } else { 394 // S.T => S must be an aggregate type, find the declaration for T in S. 395 AggregateDecl * aggr = nullptr; 396 if ( StructInstType * inst = dynamic_cast< StructInstType * >( parent ) ) { 397 aggr = inst->baseStruct; 398 } else if ( UnionInstType * inst = dynamic_cast< UnionInstType * > ( parent ) ) { 399 aggr = inst->baseUnion; 400 } else { 401 SemanticError( qualType->location, toString("Qualified type requires an aggregate on the left, but has: ", parent) ); 402 } 403 assert( aggr ); // TODO: need to handle forward declarations 404 for ( Declaration * member : aggr->members ) { 405 if ( StructInstType * inst = dynamic_cast< StructInstType * >( child ) ) { 406 if ( StructDecl * aggr = dynamic_cast< StructDecl * >( member ) ) { 407 if ( aggr->name == inst->name ) { 408 // TODO: is this case, and other non-TypeInstType cases, necessary? 409 return new StructInstType( qualType->get_qualifiers(), aggr ); 410 } 411 } 412 } else if ( UnionInstType * inst = dynamic_cast< UnionInstType * >( child ) ) { 413 if ( UnionDecl * aggr = dynamic_cast< UnionDecl * > ( member ) ) { 414 if ( aggr->name == inst->name ) { 415 return new UnionInstType( qualType->get_qualifiers(), aggr ); 416 } 417 } 418 } else if ( EnumInstType * inst = dynamic_cast< EnumInstType * >( child ) ) { 419 if ( EnumDecl * aggr = dynamic_cast< EnumDecl * > ( member ) ) { 420 if ( aggr->name == inst->name ) { 421 return new EnumInstType( qualType->get_qualifiers(), aggr ); 422 } 423 } 424 } else if ( TypeInstType * inst = dynamic_cast< TypeInstType * >( child ) ) { 425 // name on the right is a typedef 426 if ( NamedTypeDecl * aggr = dynamic_cast< NamedTypeDecl * > ( member ) ) { 427 if ( aggr->name == inst->name ) { 428 assert( aggr->base ); 429 Type * ret = aggr->base->clone(); 430 ret->get_qualifiers() = qualType->get_qualifiers(); 431 return ret; 432 } 433 } 434 } else { 435 // S.T - S is not an aggregate => error 436 assertf( false, "unhandled qualified child type: %s", toCString(qualType) ); 437 } 438 } 439 // failed to find a satisfying definition of type 440 SemanticError( qualType->location, toString("Undefined type in qualified type: ", qualType) ); 441 } 442 443 // ... may want to link canonical SUE definition to each forward decl so that it becomes easier to lookup? 444 } 445 446 294 447 void HoistStruct::hoistStruct( std::list< Declaration * > &translationUnit ) { 295 448 PassVisitor<HoistStruct> hoister; … … 297 450 } 298 451 299 bool isStructOrUnion( Declaration *decl ) { 300 return dynamic_cast< StructDecl * >( decl ) || dynamic_cast< UnionDecl * >( decl ); 452 bool shouldHoist( Declaration *decl ) { 453 return dynamic_cast< StructDecl * >( decl ) || dynamic_cast< UnionDecl * >( decl ) || dynamic_cast< StaticAssertDecl * >( decl ); 454 } 455 456 namespace { 457 void qualifiedName( AggregateDecl * aggr, std::ostringstream & ss ) { 458 if ( aggr->parent ) qualifiedName( aggr->parent, ss ); 459 ss << "__" << aggr->name; 460 } 461 462 // mangle nested type names using entire parent chain 463 std::string qualifiedName( AggregateDecl * aggr ) { 464 std::ostringstream ss; 465 qualifiedName( aggr, ss ); 466 return ss.str(); 467 } 301 468 } 302 469 303 470 template< typename AggDecl > 304 471 void HoistStruct::handleAggregate( AggDecl *aggregateDecl ) { 305 if ( inStruct ) { 472 if ( parentAggr ) { 473 aggregateDecl->parent = parentAggr; 474 aggregateDecl->name = qualifiedName( aggregateDecl ); 306 475 // Add elements in stack order corresponding to nesting structure. 307 476 declsToAddBefore.push_front( aggregateDecl ); 308 477 } else { 309 GuardValue( inStruct);310 inStruct = true;478 GuardValue( parentAggr ); 479 parentAggr = aggregateDecl; 311 480 } // if 312 481 // Always remove the hoisted aggregate from the inner structure. 313 GuardAction( [aggregateDecl]() { filter( aggregateDecl->members, isStructOrUnion, false ); } ); 314 } 315 316 void HoistStruct::previsit( EnumInstType * inst ) { 317 if ( inst->baseEnum ) { 318 declsToAddBefore.push_front( inst->baseEnum ); 319 } 320 } 321 322 void HoistStruct::previsit( StructInstType * inst ) { 323 if ( inst->baseStruct ) { 324 declsToAddBefore.push_front( inst->baseStruct ); 325 } 326 } 327 328 void HoistStruct::previsit( UnionInstType * inst ) { 329 if ( inst->baseUnion ) { 330 declsToAddBefore.push_front( inst->baseUnion ); 482 GuardAction( [aggregateDecl]() { filter( aggregateDecl->members, shouldHoist, false ); } ); 483 } 484 485 void HoistStruct::previsit( StaticAssertDecl * assertDecl ) { 486 if ( parentAggr ) { 487 declsToAddBefore.push_back( assertDecl ); 331 488 } 332 489 } … … 340 497 } 341 498 499 void HoistStruct::previsit( StructInstType * type ) { 500 // need to reset type name after expanding to qualified name 501 assert( type->baseStruct ); 502 type->name = type->baseStruct->name; 503 } 504 505 void HoistStruct::previsit( UnionInstType * type ) { 506 assert( type->baseUnion ); 507 type->name = type->baseUnion->name; 508 } 509 510 void HoistStruct::previsit( EnumInstType * type ) { 511 assert( type->baseEnum ); 512 type->name = type->baseEnum->name; 513 } 514 515 516 bool isTypedef( Declaration *decl ) { 517 return dynamic_cast< TypedefDecl * >( decl ); 518 } 519 520 void EliminateTypedef::eliminateTypedef( std::list< Declaration * > &translationUnit ) { 521 PassVisitor<EliminateTypedef> eliminator; 522 acceptAll( translationUnit, eliminator ); 523 filter( translationUnit, isTypedef, true ); 524 } 525 526 template< typename AggDecl > 527 void EliminateTypedef::handleAggregate( AggDecl *aggregateDecl ) { 528 filter( aggregateDecl->members, isTypedef, true ); 529 } 530 531 void EliminateTypedef::previsit( StructDecl * aggregateDecl ) { 532 handleAggregate( aggregateDecl ); 533 } 534 535 void EliminateTypedef::previsit( UnionDecl * aggregateDecl ) { 536 handleAggregate( aggregateDecl ); 537 } 538 539 void EliminateTypedef::previsit( CompoundStmt * compoundStmt ) { 540 // remove and delete decl stmts 541 filter( compoundStmt->kids, [](Statement * stmt) { 542 if ( DeclStmt *declStmt = dynamic_cast< DeclStmt * >( stmt ) ) { 543 if ( dynamic_cast< TypedefDecl * >( declStmt->decl ) ) { 544 return true; 545 } // if 546 } // if 547 return false; 548 }, true); 549 } 550 342 551 void EnumAndPointerDecay::previsit( EnumDecl *enumDecl ) { 343 552 // Set the type of each member of the enumeration to be EnumConstant 344 for ( std::list< Declaration * >::iterator i = enumDecl-> get_members().begin(); i != enumDecl->get_members().end(); ++i ) {553 for ( std::list< Declaration * >::iterator i = enumDecl->members.begin(); i != enumDecl->members.end(); ++i ) { 345 554 ObjectDecl * obj = dynamic_cast< ObjectDecl * >( *i ); 346 555 assert( obj ); 347 obj->set_type( new EnumInstType( Type::Qualifiers( Type::Const ), enumDecl-> get_name()) );556 obj->set_type( new EnumInstType( Type::Qualifiers( Type::Const ), enumDecl->name ) ); 348 557 } // for 349 558 } … … 351 560 namespace { 352 561 template< typename DWTList > 353 void fixFunctionList( DWTList & dwts, FunctionType * func ) { 354 // the only case in which "void" is valid is where it is the only one in the list; then it should be removed 355 // entirely. other fix ups are handled by the FixFunction class 356 typedef typename DWTList::iterator DWTIterator; 357 DWTIterator begin( dwts.begin() ), end( dwts.end() ); 358 if ( begin == end ) return; 359 PassVisitor<FixFunction> fixer; 360 DWTIterator i = begin; 361 *i = (*i)->acceptMutator( fixer ); 362 if ( fixer.pass.isVoid ) { 363 DWTIterator j = i; 364 ++i; 365 delete *j; 366 dwts.erase( j ); 367 if ( i != end ) { 368 throw SemanticError( "invalid type void in function type ", func ); 369 } // if 370 } else { 371 ++i; 372 for ( ; i != end; ++i ) { 373 PassVisitor<FixFunction> fixer; 374 *i = (*i)->acceptMutator( fixer ); 375 if ( fixer.pass.isVoid ) { 376 throw SemanticError( "invalid type void in function type ", func ); 377 } // if 378 } // for 379 } // if 562 void fixFunctionList( DWTList & dwts, bool isVarArgs, FunctionType * func ) { 563 auto nvals = dwts.size(); 564 bool containsVoid = false; 565 for ( auto & dwt : dwts ) { 566 // fix each DWT and record whether a void was found 567 containsVoid |= fixFunction( dwt ); 568 } 569 570 // the only case in which "void" is valid is where it is the only one in the list 571 if ( containsVoid && ( nvals > 1 || isVarArgs ) ) { 572 SemanticError( func, "invalid type void in function type " ); 573 } 574 575 // one void is the only thing in the list; remove it. 576 if ( containsVoid ) { 577 delete dwts.front(); 578 dwts.clear(); 579 } 380 580 } 381 581 } … … 383 583 void EnumAndPointerDecay::previsit( FunctionType *func ) { 384 584 // Fix up parameters and return types 385 fixFunctionList( func-> get_parameters(), func );386 fixFunctionList( func-> get_returnVals(), func );585 fixFunctionList( func->parameters, func->isVarArgs, func ); 586 fixFunctionList( func->returnVals, false, func ); 387 587 } 388 588 … … 396 596 397 597 void LinkReferenceToTypes::postvisit( EnumInstType *enumInst ) { 398 EnumDecl *st = local_indexer->lookupEnum( enumInst-> get_name());598 EnumDecl *st = local_indexer->lookupEnum( enumInst->name ); 399 599 // it's not a semantic error if the enum is not found, just an implicit forward declaration 400 600 if ( st ) { 401 //assert( ! enumInst->get_baseEnum() || enumInst->get_baseEnum()->get_members().empty() || ! st->get_members().empty() ); 402 enumInst->set_baseEnum( st ); 403 } // if 404 if ( ! st || st->get_members().empty() ) { 601 enumInst->baseEnum = st; 602 } // if 603 if ( ! st || ! st->body ) { 405 604 // use of forward declaration 406 forwardEnums[ enumInst-> get_name()].push_back( enumInst );605 forwardEnums[ enumInst->name ].push_back( enumInst ); 407 606 } // if 408 607 } … … 411 610 for ( Expression * param : inst->parameters ) { 412 611 if ( ! dynamic_cast< TypeExpr * >( param ) ) { 413 throw SemanticError( "Expression parameters for generic types are currently unsupported: ", inst);612 SemanticError( inst, "Expression parameters for generic types are currently unsupported: " ); 414 613 } 415 614 } … … 417 616 418 617 void LinkReferenceToTypes::postvisit( StructInstType *structInst ) { 419 StructDecl *st = local_indexer->lookupStruct( structInst-> get_name());618 StructDecl *st = local_indexer->lookupStruct( structInst->name ); 420 619 // it's not a semantic error if the struct is not found, just an implicit forward declaration 421 620 if ( st ) { 422 //assert( ! structInst->get_baseStruct() || structInst->get_baseStruct()->get_members().empty() || ! st->get_members().empty() ); 423 structInst->set_baseStruct( st ); 424 } // if 425 if ( ! st || st->get_members().empty() ) { 621 structInst->baseStruct = st; 622 } // if 623 if ( ! st || ! st->body ) { 426 624 // use of forward declaration 427 forwardStructs[ structInst-> get_name()].push_back( structInst );625 forwardStructs[ structInst->name ].push_back( structInst ); 428 626 } // if 429 627 checkGenericParameters( structInst ); … … 431 629 432 630 void LinkReferenceToTypes::postvisit( UnionInstType *unionInst ) { 433 UnionDecl *un = local_indexer->lookupUnion( unionInst-> get_name());631 UnionDecl *un = local_indexer->lookupUnion( unionInst->name ); 434 632 // it's not a semantic error if the union is not found, just an implicit forward declaration 435 633 if ( un ) { 436 unionInst-> set_baseUnion( un );437 } // if 438 if ( ! un || un->get_members().empty()) {634 unionInst->baseUnion = un; 635 } // if 636 if ( ! un || ! un->body ) { 439 637 // use of forward declaration 440 forwardUnions[ unionInst-> get_name()].push_back( unionInst );638 forwardUnions[ unionInst->name ].push_back( unionInst ); 441 639 } // if 442 640 checkGenericParameters( unionInst ); 641 } 642 643 void LinkReferenceToTypes::previsit( QualifiedType * ) { 644 visit_children = false; 645 } 646 647 void LinkReferenceToTypes::postvisit( QualifiedType * qualType ) { 648 // linking only makes sense for the 'oldest ancestor' of the qualified type 649 qualType->parent->accept( *visitor ); 443 650 } 444 651 … … 451 658 DeclarationWithType * dwt2 = dynamic_cast<DeclarationWithType *>( d2 ); 452 659 if ( dwt1 && dwt2 ) { 453 if ( dwt1-> get_name() == dwt2->get_name()&& ResolvExpr::typesCompatible( dwt1->get_type(), dwt2->get_type(), SymTab::Indexer() ) ) {660 if ( dwt1->name == dwt2->name && ResolvExpr::typesCompatible( dwt1->get_type(), dwt2->get_type(), SymTab::Indexer() ) ) { 454 661 // std::cerr << "=========== equal:" << std::endl; 455 662 // std::cerr << "d1: " << d1 << std::endl; … … 476 683 template< typename Iterator > 477 684 void expandAssertions( TraitInstType * inst, Iterator out ) { 478 assertf( inst->baseTrait, "Trait instance not linked to base trait: %s", to String( inst ).c_str() );685 assertf( inst->baseTrait, "Trait instance not linked to base trait: %s", toCString( inst ) ); 479 686 std::list< DeclarationWithType * > asserts; 480 687 for ( Declaration * decl : inst->baseTrait->members ) { … … 511 718 TraitDecl *traitDecl = local_indexer->lookupTrait( traitInst->name ); 512 719 if ( ! traitDecl ) { 513 throw SemanticError("use of undeclared trait " + traitInst->name );514 } // if 515 if ( traitDecl-> get_parameters().size() != traitInst->get_parameters().size() ) {516 throw SemanticError( "incorrect number of trait parameters: ", traitInst);720 SemanticError( traitInst->location, "use of undeclared trait " + traitInst->name ); 721 } // if 722 if ( traitDecl->parameters.size() != traitInst->parameters.size() ) { 723 SemanticError( traitInst, "incorrect number of trait parameters: " ); 517 724 } // if 518 725 traitInst->baseTrait = traitDecl; 519 726 520 727 // need to carry over the 'sized' status of each decl in the instance 521 for ( auto p : group_iterate( traitDecl-> get_parameters(), traitInst->get_parameters()) ) {728 for ( auto p : group_iterate( traitDecl->parameters, traitInst->parameters ) ) { 522 729 TypeExpr * expr = dynamic_cast< TypeExpr * >( std::get<1>(p) ); 523 730 if ( ! expr ) { 524 throw SemanticError( "Expression parameters for trait instances are currently unsupported: ", std::get<1>(p));731 SemanticError( std::get<1>(p), "Expression parameters for trait instances are currently unsupported: " ); 525 732 } 526 733 if ( TypeInstType * inst = dynamic_cast< TypeInstType * >( expr->get_type() ) ) { 527 734 TypeDecl * formalDecl = std::get<0>(p); 528 TypeDecl * instDecl = inst-> get_baseType();735 TypeDecl * instDecl = inst->baseType; 529 736 if ( formalDecl->get_sized() ) instDecl->set_sized( true ); 530 737 } … … 535 742 void LinkReferenceToTypes::postvisit( EnumDecl *enumDecl ) { 536 743 // visit enum members first so that the types of self-referencing members are updated properly 537 if ( ! enumDecl->get_members().empty()) {538 ForwardEnumsType::iterator fwds = forwardEnums.find( enumDecl-> get_name());744 if ( enumDecl->body ) { 745 ForwardEnumsType::iterator fwds = forwardEnums.find( enumDecl->name ); 539 746 if ( fwds != forwardEnums.end() ) { 540 747 for ( std::list< EnumInstType * >::iterator inst = fwds->second.begin(); inst != fwds->second.end(); ++inst ) { 541 (*inst )->set_baseEnum( enumDecl );748 (*inst)->baseEnum = enumDecl; 542 749 } // for 543 750 forwardEnums.erase( fwds ); 544 751 } // if 752 753 for ( Declaration * member : enumDecl->members ) { 754 ObjectDecl * field = strict_dynamic_cast<ObjectDecl *>( member ); 755 if ( field->init ) { 756 // need to resolve enumerator initializers early so that other passes that determine if an expression is constexpr have the appropriate information. 757 SingleInit * init = strict_dynamic_cast<SingleInit *>( field->init ); 758 ResolvExpr::findSingleExpression( init->value, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), indexer ); 759 } 760 } 545 761 } // if 546 762 } … … 575 791 // visit struct members first so that the types of self-referencing members are updated properly 576 792 // xxx - need to ensure that type parameters match up between forward declarations and definition (most importantly, number of type parameters and their defaults) 577 if ( ! structDecl->get_members().empty()) {578 ForwardStructsType::iterator fwds = forwardStructs.find( structDecl-> get_name());793 if ( structDecl->body ) { 794 ForwardStructsType::iterator fwds = forwardStructs.find( structDecl->name ); 579 795 if ( fwds != forwardStructs.end() ) { 580 796 for ( std::list< StructInstType * >::iterator inst = fwds->second.begin(); inst != fwds->second.end(); ++inst ) { 581 (*inst )->set_baseStruct( structDecl );797 (*inst)->baseStruct = structDecl; 582 798 } // for 583 799 forwardStructs.erase( fwds ); … … 587 803 588 804 void LinkReferenceToTypes::postvisit( UnionDecl *unionDecl ) { 589 if ( ! unionDecl->get_members().empty()) {590 ForwardUnionsType::iterator fwds = forwardUnions.find( unionDecl-> get_name());805 if ( unionDecl->body ) { 806 ForwardUnionsType::iterator fwds = forwardUnions.find( unionDecl->name ); 591 807 if ( fwds != forwardUnions.end() ) { 592 808 for ( std::list< UnionInstType * >::iterator inst = fwds->second.begin(); inst != fwds->second.end(); ++inst ) { 593 (*inst )->set_baseUnion( unionDecl );809 (*inst)->baseUnion = unionDecl; 594 810 } // for 595 811 forwardUnions.erase( fwds ); … … 601 817 // ensure generic parameter instances are renamed like the base type 602 818 if ( inGeneric && typeInst->baseType ) typeInst->name = typeInst->baseType->name; 603 if ( NamedTypeDecl *namedTypeDecl = local_indexer->lookupType( typeInst-> get_name()) ) {819 if ( NamedTypeDecl *namedTypeDecl = local_indexer->lookupType( typeInst->name ) ) { 604 820 if ( TypeDecl *typeDecl = dynamic_cast< TypeDecl * >( namedTypeDecl ) ) { 605 821 typeInst->set_isFtype( typeDecl->get_kind() == TypeDecl::Ftype ); … … 626 842 // apply FixFunction to every assertion to check for invalid void type 627 843 for ( DeclarationWithType *& assertion : type->assertions ) { 628 PassVisitor<FixFunction> fixer; 629 assertion = assertion->acceptMutator( fixer ); 630 if ( fixer.pass.isVoid ) { 631 throw SemanticError( "invalid type void in assertion of function ", node ); 844 bool isVoid = fixFunction( assertion ); 845 if ( isVoid ) { 846 SemanticError( node, "invalid type void in assertion of function " ); 632 847 } // if 633 848 } // for … … 637 852 638 853 void ForallPointerDecay::previsit( ObjectDecl *object ) { 639 forallFixer( object->type->forall, object );640 if ( PointerType *pointer = dynamic_cast< PointerType * >( object->type) ) {641 forallFixer( pointer->base->forall, object);642 } // if854 // ensure that operator names only apply to functions or function pointers 855 if ( CodeGen::isOperator( object->name ) && ! dynamic_cast< FunctionType * >( object->type->stripDeclarator() ) ) { 856 SemanticError( object->location, toCString( "operator ", object->name.c_str(), " is not a function or function pointer." ) ); 857 } 643 858 object->fixUniqueId(); 644 859 } 645 860 646 861 void ForallPointerDecay::previsit( FunctionDecl *func ) { 647 forallFixer( func->type->forall, func );648 862 func->fixUniqueId(); 863 } 864 865 void ForallPointerDecay::previsit( FunctionType * ftype ) { 866 forallFixer( ftype->forall, ftype ); 649 867 } 650 868 … … 673 891 // were cast to void. 674 892 if ( ! returnStmt->get_expr() && returnVals.size() != 0 ) { 675 throw SemanticError( "Non-void function returns no values: " , returnStmt ); 676 } 677 } 678 679 680 bool isTypedef( Declaration *decl ) { 681 return dynamic_cast< TypedefDecl * >( decl ); 682 } 683 684 void EliminateTypedef::eliminateTypedef( std::list< Declaration * > &translationUnit ) { 685 PassVisitor<EliminateTypedef> eliminator; 893 SemanticError( returnStmt, "Non-void function returns no values: " ); 894 } 895 } 896 897 898 void ReplaceTypedef::replaceTypedef( std::list< Declaration * > &translationUnit ) { 899 PassVisitor<ReplaceTypedef> eliminator; 686 900 mutateAll( translationUnit, eliminator ); 687 901 if ( eliminator.pass.typedefNames.count( "size_t" ) ) { 688 902 // grab and remember declaration of size_t 689 SizeType = eliminator.pass.typedefNames["size_t"].first-> get_base()->clone();903 SizeType = eliminator.pass.typedefNames["size_t"].first->base->clone(); 690 904 } else { 691 905 // xxx - missing global typedef for size_t - default to long unsigned int, even though that may be wrong … … 693 907 SizeType = new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ); 694 908 } 695 filter( translationUnit, isTypedef, true ); 696 } 697 698 Type * EliminateTypedef::postmutate( TypeInstType * typeInst ) { 909 } 910 911 void ReplaceTypedef::premutate( QualifiedType * ) { 912 visit_children = false; 913 } 914 915 Type * ReplaceTypedef::postmutate( QualifiedType * qualType ) { 916 // replacing typedefs only makes sense for the 'oldest ancestor' of the qualified type 917 qualType->parent = qualType->parent->acceptMutator( *visitor ); 918 return qualType; 919 } 920 921 Type * ReplaceTypedef::postmutate( TypeInstType * typeInst ) { 699 922 // instances of typedef types will come here. If it is an instance 700 923 // of a typdef type, link the instance to its actual type. 701 TypedefMap::const_iterator def = typedefNames.find( typeInst-> get_name());924 TypedefMap::const_iterator def = typedefNames.find( typeInst->name ); 702 925 if ( def != typedefNames.end() ) { 703 926 Type *ret = def->second.first->base->clone(); 927 ret->location = typeInst->location; 704 928 ret->get_qualifiers() |= typeInst->get_qualifiers(); 705 929 // attributes are not carried over from typedef to function parameters/return values … … 714 938 ReferenceToType *rtt = dynamic_cast<ReferenceToType*>(ret); 715 939 if ( ! rtt ) { 716 throw SemanticError("Cannot apply type parameters to base type of " + typeInst->name);940 SemanticError( typeInst->location, "Cannot apply type parameters to base type of " + typeInst->name ); 717 941 } 718 rtt-> get_parameters().clear();942 rtt->parameters.clear(); 719 943 cloneAll( typeInst->parameters, rtt->parameters ); 720 944 mutateAll( rtt->parameters, *visitor ); // recursively fix typedefs on parameters … … 723 947 return ret; 724 948 } else { 725 TypeDeclMap::const_iterator base = typedeclNames.find( typeInst->get_name() ); 726 assertf( base != typedeclNames.end(), "Cannot find typedecl name %s", typeInst->name.c_str() ); 949 TypeDeclMap::const_iterator base = typedeclNames.find( typeInst->name ); 950 if ( base == typedeclNames.end() ) { 951 SemanticError( typeInst->location, toString("Use of undefined type ", typeInst->name) ); 952 } 727 953 typeInst->set_baseType( base->second ); 728 } // if 729 return typeInst; 954 return typeInst; 955 } // if 956 assert( false ); 730 957 } 731 958 … … 744 971 } 745 972 746 Declaration * EliminateTypedef::postmutate( TypedefDecl * tyDecl ) {747 if ( typedefNames.count( tyDecl-> get_name() ) == 1 && typedefNames[ tyDecl->get_name()].second == scopeLevel ) {973 Declaration * ReplaceTypedef::postmutate( TypedefDecl * tyDecl ) { 974 if ( typedefNames.count( tyDecl->name ) == 1 && typedefNames[ tyDecl->name ].second == scopeLevel ) { 748 975 // typedef to the same name from the same scope 749 976 // must be from the same type 750 977 751 Type * t1 = tyDecl-> get_base();752 Type * t2 = typedefNames[ tyDecl-> get_name() ].first->get_base();978 Type * t1 = tyDecl->base; 979 Type * t2 = typedefNames[ tyDecl->name ].first->base; 753 980 if ( ! ResolvExpr::typesCompatible( t1, t2, Indexer() ) ) { 754 throw SemanticError( "Cannot redefine typedef: " + tyDecl->name ); 755 } 756 // cannot redefine VLA typedefs 981 SemanticError( tyDecl->location, "Cannot redefine typedef: " + tyDecl->name ); 982 } 983 // Cannot redefine VLA typedefs. Note: this is slightly incorrect, because our notion of VLAs 984 // at this point in the translator is imprecise. In particular, this will disallow redefining typedefs 985 // with arrays whose dimension is an enumerator or a cast of a constant/enumerator. The effort required 986 // to fix this corner case likely outweighs the utility of allowing it. 757 987 if ( isVariableLength( t1 ) || isVariableLength( t2 ) ) { 758 throw SemanticError("Cannot redefine typedef: " + tyDecl->name );988 SemanticError( tyDecl->location, "Cannot redefine typedef: " + tyDecl->name ); 759 989 } 760 990 } else { 761 typedefNames[ tyDecl-> get_name()] = std::make_pair( TypedefDeclPtr( tyDecl ), scopeLevel );991 typedefNames[ tyDecl->name ] = std::make_pair( TypedefDeclPtr( tyDecl ), scopeLevel ); 762 992 } // if 763 993 … … 771 1001 // Note, qualifiers on the typedef are superfluous for the forward declaration. 772 1002 773 Type *designatorType = tyDecl-> get_base()->stripDeclarator();1003 Type *designatorType = tyDecl->base->stripDeclarator(); 774 1004 if ( StructInstType *aggDecl = dynamic_cast< StructInstType * >( designatorType ) ) { 775 return new StructDecl( aggDecl->get_name(), DeclarationNode::Struct, noAttributes, tyDecl->get_linkage() );1005 declsToAddBefore.push_back( new StructDecl( aggDecl->name, DeclarationNode::Struct, noAttributes, tyDecl->linkage ) ); 776 1006 } else if ( UnionInstType *aggDecl = dynamic_cast< UnionInstType * >( designatorType ) ) { 777 return new UnionDecl( aggDecl->get_name(), noAttributes, tyDecl->get_linkage() );1007 declsToAddBefore.push_back( new UnionDecl( aggDecl->name, noAttributes, tyDecl->linkage ) ); 778 1008 } else if ( EnumInstType *enumDecl = dynamic_cast< EnumInstType * >( designatorType ) ) { 779 return new EnumDecl( enumDecl->get_name(), noAttributes, tyDecl->get_linkage() ); 780 } else { 781 return tyDecl->clone(); 782 } // if 783 } 784 785 void EliminateTypedef::premutate( TypeDecl * typeDecl ) { 786 TypedefMap::iterator i = typedefNames.find( typeDecl->get_name() ); 1009 declsToAddBefore.push_back( new EnumDecl( enumDecl->name, noAttributes, tyDecl->linkage ) ); 1010 } // if 1011 return tyDecl->clone(); 1012 } 1013 1014 void ReplaceTypedef::premutate( TypeDecl * typeDecl ) { 1015 TypedefMap::iterator i = typedefNames.find( typeDecl->name ); 787 1016 if ( i != typedefNames.end() ) { 788 1017 typedefNames.erase( i ) ; 789 1018 } // if 790 1019 791 typedeclNames [ typeDecl->get_name() ] = typeDecl;792 } 793 794 void EliminateTypedef::premutate( FunctionDecl * ) {1020 typedeclNames.insert( typeDecl->name, typeDecl ); 1021 } 1022 1023 void ReplaceTypedef::premutate( FunctionDecl * ) { 795 1024 GuardScope( typedefNames ); 796 } 797 798 void EliminateTypedef::premutate( ObjectDecl * ) { 1025 GuardScope( typedeclNames ); 1026 } 1027 1028 void ReplaceTypedef::premutate( ObjectDecl * ) { 799 1029 GuardScope( typedefNames ); 800 } 801 802 DeclarationWithType *EliminateTypedef::postmutate( ObjectDecl * objDecl ) { 803 if ( FunctionType *funtype = dynamic_cast<FunctionType *>( objDecl->get_type() ) ) { // function type? 1030 GuardScope( typedeclNames ); 1031 } 1032 1033 DeclarationWithType * ReplaceTypedef::postmutate( ObjectDecl * objDecl ) { 1034 if ( FunctionType *funtype = dynamic_cast<FunctionType *>( objDecl->type ) ) { // function type? 804 1035 // replace the current object declaration with a function declaration 805 FunctionDecl * newDecl = new FunctionDecl( objDecl-> get_name(), objDecl->get_storageClasses(), objDecl->get_linkage(), funtype, 0, objDecl->get_attributes(), objDecl->get_funcSpec() );806 objDecl-> get_attributes().clear();1036 FunctionDecl * newDecl = new FunctionDecl( objDecl->name, objDecl->get_storageClasses(), objDecl->linkage, funtype, 0, objDecl->attributes, objDecl->get_funcSpec() ); 1037 objDecl->attributes.clear(); 807 1038 objDecl->set_type( nullptr ); 808 1039 delete objDecl; … … 812 1043 } 813 1044 814 void EliminateTypedef::premutate( CastExpr * ) {1045 void ReplaceTypedef::premutate( CastExpr * ) { 815 1046 GuardScope( typedefNames ); 816 } 817 818 void EliminateTypedef::premutate( CompoundStmt * ) { 1047 GuardScope( typedeclNames ); 1048 } 1049 1050 void ReplaceTypedef::premutate( CompoundStmt * ) { 819 1051 GuardScope( typedefNames ); 1052 GuardScope( typedeclNames ); 820 1053 scopeLevel += 1; 821 1054 GuardAction( [this](){ scopeLevel -= 1; } ); 822 1055 } 823 1056 824 CompoundStmt *EliminateTypedef::postmutate( CompoundStmt * compoundStmt ) {825 // remove and delete decl stmts826 filter( compoundStmt->kids, [](Statement * stmt) {827 if ( DeclStmt *declStmt = dynamic_cast< DeclStmt * >( stmt ) ) {828 if ( dynamic_cast< TypedefDecl * >( declStmt->get_decl() ) ) {829 return true;830 } // if831 } // if832 return false;833 }, true);834 return compoundStmt;835 }836 837 // there may be typedefs nested within aggregates. in order for everything to work properly, these should be removed838 // as well839 1057 template<typename AggDecl> 840 AggDecl *EliminateTypedef::handleAggregate( AggDecl * aggDecl ) { 841 filter( aggDecl->members, isTypedef, true ); 842 return aggDecl; 843 } 844 845 template<typename AggDecl> 846 void EliminateTypedef::addImplicitTypedef( AggDecl * aggDecl ) { 1058 void ReplaceTypedef::addImplicitTypedef( AggDecl * aggDecl ) { 847 1059 if ( typedefNames.count( aggDecl->get_name() ) == 0 ) { 848 1060 Type *type = nullptr; … … 854 1066 type = new EnumInstType( Type::Qualifiers(), newDeclEnumDecl->get_name() ); 855 1067 } // if 856 TypedefDeclPtr tyDecl( new TypedefDecl( aggDecl->get_name(), Type::StorageClasses(), type, aggDecl->get_linkage() ) );1068 TypedefDeclPtr tyDecl( new TypedefDecl( aggDecl->get_name(), aggDecl->location, Type::StorageClasses(), type, aggDecl->get_linkage() ) ); 857 1069 typedefNames[ aggDecl->get_name() ] = std::make_pair( std::move( tyDecl ), scopeLevel ); 858 } // if 859 } 860 861 void EliminateTypedef::premutate( StructDecl * structDecl ) { 1070 // add the implicit typedef to the AST 1071 declsToAddBefore.push_back( new TypedefDecl( aggDecl->get_name(), aggDecl->location, Type::StorageClasses(), type->clone(), aggDecl->get_linkage() ) ); 1072 } // if 1073 } 1074 1075 template< typename AggDecl > 1076 void ReplaceTypedef::handleAggregate( AggDecl * aggr ) { 1077 SemanticErrorException errors; 1078 1079 ValueGuard< std::list<Declaration * > > oldBeforeDecls( declsToAddBefore ); 1080 ValueGuard< std::list<Declaration * > > oldAfterDecls ( declsToAddAfter ); 1081 declsToAddBefore.clear(); 1082 declsToAddAfter.clear(); 1083 1084 GuardScope( typedefNames ); 1085 GuardScope( typedeclNames ); 1086 mutateAll( aggr->parameters, *visitor ); 1087 1088 // unroll mutateAll for aggr->members so that implicit typedefs for nested types are added to the aggregate body. 1089 for ( std::list< Declaration * >::iterator i = aggr->members.begin(); i != aggr->members.end(); ++i ) { 1090 if ( !declsToAddAfter.empty() ) { aggr->members.splice( i, declsToAddAfter ); } 1091 1092 try { 1093 *i = maybeMutate( *i, *visitor ); 1094 } catch ( SemanticErrorException &e ) { 1095 errors.append( e ); 1096 } 1097 1098 if ( !declsToAddBefore.empty() ) { aggr->members.splice( i, declsToAddBefore ); } 1099 } 1100 1101 if ( !declsToAddAfter.empty() ) { aggr->members.splice( aggr->members.end(), declsToAddAfter ); } 1102 if ( !errors.isEmpty() ) { throw errors; } 1103 } 1104 1105 void ReplaceTypedef::premutate( StructDecl * structDecl ) { 1106 visit_children = false; 862 1107 addImplicitTypedef( structDecl ); 863 } 864 865 866 Declaration *EliminateTypedef::postmutate( StructDecl * structDecl ) { 867 return handleAggregate( structDecl ); 868 } 869 870 void EliminateTypedef::premutate( UnionDecl * unionDecl ) { 1108 handleAggregate( structDecl ); 1109 } 1110 1111 void ReplaceTypedef::premutate( UnionDecl * unionDecl ) { 1112 visit_children = false; 871 1113 addImplicitTypedef( unionDecl ); 872 } 873 874 Declaration *EliminateTypedef::postmutate( UnionDecl * unionDecl ) { 875 return handleAggregate( unionDecl ); 876 } 877 878 void EliminateTypedef::premutate( EnumDecl * enumDecl ) { 1114 handleAggregate( unionDecl ); 1115 } 1116 1117 void ReplaceTypedef::premutate( EnumDecl * enumDecl ) { 879 1118 addImplicitTypedef( enumDecl ); 880 1119 } 881 1120 882 Declaration *EliminateTypedef::postmutate( EnumDecl * enumDecl ) { 883 return handleAggregate( enumDecl ); 884 } 885 886 Declaration *EliminateTypedef::postmutate( TraitDecl * traitDecl ) { 887 return handleAggregate( traitDecl ); 888 } 889 890 void EliminateTypedef::premutate( FunctionType * ) { 1121 void ReplaceTypedef::premutate( FunctionType * ) { 891 1122 GuardValue( inFunctionType ); 892 1123 inFunctionType = true; 1124 } 1125 1126 void ReplaceTypedef::premutate( TraitDecl * ) { 1127 GuardScope( typedefNames ); 1128 GuardScope( typedeclNames); 893 1129 } 894 1130 … … 905 1141 if ( CodeGen::isCtorDtorAssign( funcDecl->get_name() ) ) { // TODO: also check /=, etc. 906 1142 if ( params.size() == 0 ) { 907 throw SemanticError( "Constructors, destructors, and assignment functions require at least one parameter ", funcDecl);1143 SemanticError( funcDecl, "Constructors, destructors, and assignment functions require at least one parameter " ); 908 1144 } 909 1145 ReferenceType * refType = dynamic_cast< ReferenceType * >( params.front()->get_type() ); 910 1146 if ( ! refType ) { 911 throw SemanticError( "First parameter of a constructor, destructor, or assignment function must be a reference ", funcDecl);1147 SemanticError( funcDecl, "First parameter of a constructor, destructor, or assignment function must be a reference " ); 912 1148 } 913 1149 if ( CodeGen::isCtorDtor( funcDecl->get_name() ) && returnVals.size() != 0 ) { 914 throw SemanticError( "Constructors and destructors cannot have explicit return values ", funcDecl);1150 SemanticError( funcDecl, "Constructors and destructors cannot have explicit return values " ); 915 1151 } 916 1152 } … … 947 1183 948 1184 sub.apply( inst ); 949 if ( args.size() < params->size() ) throw SemanticError( "Too few type arguments in generic type ", inst);950 if ( args.size() > params->size() ) throw SemanticError( "Too many type arguments in generic type ", inst);1185 if ( args.size() < params->size() ) SemanticError( inst, "Too few type arguments in generic type " ); 1186 if ( args.size() > params->size() ) SemanticError( inst, "Too many type arguments in generic type " ); 951 1187 } 952 1188 } … … 1014 1250 } 1015 1251 1252 void FixObjectType::fix( std::list< Declaration * > & translationUnit ) { 1253 PassVisitor<FixObjectType> fixer; 1254 acceptAll( translationUnit, fixer ); 1255 } 1256 1257 void FixObjectType::previsit( ObjectDecl * objDecl ) { 1258 Type *new_type = ResolvExpr::resolveTypeof( objDecl->get_type(), indexer ); 1259 new_type->get_qualifiers() -= Type::Lvalue; // even if typeof is lvalue, variable can never have lvalue-qualified type 1260 objDecl->set_type( new_type ); 1261 } 1262 1263 void FixObjectType::previsit( FunctionDecl * funcDecl ) { 1264 Type *new_type = ResolvExpr::resolveTypeof( funcDecl->type, indexer ); 1265 new_type->get_qualifiers() -= Type::Lvalue; // even if typeof is lvalue, variable can never have lvalue-qualified type 1266 funcDecl->set_type( new_type ); 1267 } 1268 1269 void FixObjectType::previsit( TypeDecl *typeDecl ) { 1270 if ( typeDecl->get_base() ) { 1271 Type *new_type = ResolvExpr::resolveTypeof( typeDecl->get_base(), indexer ); 1272 new_type->get_qualifiers() -= Type::Lvalue; // even if typeof is lvalue, variable can never have lvalue-qualified type 1273 typeDecl->set_base( new_type ); 1274 } // if 1275 } 1276 1016 1277 void ArrayLength::computeLength( std::list< Declaration * > & translationUnit ) { 1017 1278 PassVisitor<ArrayLength> len; … … 1020 1281 1021 1282 void ArrayLength::previsit( ObjectDecl * objDecl ) { 1022 if ( ArrayType * at = dynamic_cast< ArrayType * >( objDecl->get_type() ) ) { 1023 if ( at->get_dimension() ) return; 1024 if ( ListInit * init = dynamic_cast< ListInit * >( objDecl->get_init() ) ) { 1025 at->set_dimension( new ConstantExpr( Constant::from_ulong( init->get_initializers().size() ) ) ); 1026 } 1283 if ( ArrayType * at = dynamic_cast< ArrayType * >( objDecl->type ) ) { 1284 if ( at->dimension ) return; 1285 if ( ListInit * init = dynamic_cast< ListInit * >( objDecl->init ) ) { 1286 at->dimension = new ConstantExpr( Constant::from_ulong( init->initializers.size() ) ); 1287 } 1288 } 1289 } 1290 1291 void ArrayLength::previsit( ArrayType * type ) { 1292 if ( type->dimension ) { 1293 // need to resolve array dimensions early so that constructor code can correctly determine 1294 // if a type is a VLA (and hence whether its elements need to be constructed) 1295 ResolvExpr::findSingleExpression( type->dimension, SymTab::SizeType->clone(), indexer ); 1296 1297 // must re-evaluate whether a type is a VLA, now that more information is available 1298 // (e.g. the dimension may have been an enumerator, which was unknown prior to this step) 1299 type->isVarLen = ! InitTweak::isConstExpr( type->dimension ); 1027 1300 } 1028 1301 } -
src/SymTab/module.mk
rf9feab8 r90152a4 17 17 SRC += SymTab/Indexer.cc \ 18 18 SymTab/Mangler.cc \ 19 SymTab/ManglerCommon.cc \ 19 20 SymTab/Validate.cc \ 20 21 SymTab/FixFunction.cc \ -
src/SynTree/AggregateDecl.cc
rf9feab8 r90152a4 86 86 std::string TraitDecl::typeString() const { return "trait"; } 87 87 88 bool EnumDecl::valueOf( Declaration * enumerator, long long int & value ) { 89 if ( enumValues.empty() ) { 90 long long int currentValue = 0; 91 for ( Declaration * member : members ) { 92 ObjectDecl * field = strict_dynamic_cast< ObjectDecl * >( member ); 93 if ( field->init ) { 94 SingleInit * init = strict_dynamic_cast< SingleInit * >( field->init ); 95 auto result = eval( init->value ); 96 if ( ! result.second ) SemanticError( init->location, toString( "Non-constexpr in initialization of enumerator: ", field ) ); 97 currentValue = result.first; 98 } 99 assertf( enumValues.count( field->name ) == 0, "Enum %s has multiple members with the name %s", name.c_str(), field->name.c_str() ); 100 enumValues[ field->name ] = currentValue; 101 ++currentValue; 102 } 103 } 104 if ( enumValues.count( enumerator->name ) ) { 105 value = enumValues[ enumerator->name ]; 106 return true; 107 } 108 return false; 109 } 110 88 111 // Local Variables: // 89 112 // tab-width: 4 // -
src/SynTree/ApplicationExpr.cc
rf9feab8 r90152a4 49 49 } 50 50 51 ParamEntry::ParamEntry( ParamEntry && other ) : 52 decl( other.decl ), actualType( other.actualType ), formalType( other.formalType ), expr( other.expr ), inferParams( std::move( other.inferParams ) ) { 53 other.actualType = nullptr; 54 other.formalType = nullptr; 55 other.expr = nullptr; 56 } 57 58 ParamEntry & ParamEntry::operator=( ParamEntry && other ) { 59 if ( &other == this ) return *this; 60 delete actualType; 61 delete formalType; 62 delete expr; 63 decl = other.decl; 64 actualType = other.actualType; 65 formalType = other.formalType; 66 expr = other.expr; 67 other.actualType = nullptr; 68 other.formalType = nullptr; 69 other.expr = nullptr; 70 inferParams = std::move( other.inferParams ); 71 return *this; 72 } 73 51 74 ApplicationExpr::ApplicationExpr( Expression *funcExpr, const std::list<Expression *> & args ) : function( funcExpr ), args( args ) { 52 75 PointerType *pointer = strict_dynamic_cast< PointerType* >( funcExpr->get_result() ); -
src/SynTree/Attribute.cc
rf9feab8 r90152a4 15 15 16 16 #include <ostream> // for operator<<, ostream, basic_ostream, endl 17 #include <set> 17 18 18 19 #include "Attribute.h" … … 21 22 22 23 Attribute::Attribute( const Attribute &other ) : name( other.name ) { 23 24 cloneAll( other.parameters, parameters ); 24 25 } 25 26 26 27 Attribute::~Attribute() { 27 deleteAll( parameters ); 28 deleteAll( parameters ); 29 } 30 31 bool Attribute::isValidOnFuncParam() const { 32 // attributes such as aligned, cleanup, etc. produce GCC errors when they appear 33 // on function parameters. Maintain here a whitelist of attribute names that are 34 // allowed to appear on parameters. 35 static std::set< std::string > valid = { 36 "noreturn", "unused" 37 }; 38 return valid.count( normalizedName() ); 39 } 40 41 std::string Attribute::normalizedName() const { 42 // trim beginning/ending _, convert to lowercase 43 auto begin = name.find_first_not_of('_'); 44 auto end = name.find_last_not_of('_'); 45 if (begin == std::string::npos || end == std::string::npos) return ""; 46 std::string ret; 47 ret.reserve( end-begin+1 ); 48 std::transform( &name[begin], &name[end+1], back_inserter( ret ), tolower ); 49 return ret; 28 50 } 29 51 30 52 void Attribute::print( std::ostream &os, Indenter indent ) const { 31 32 53 using std::endl; 54 using std::string; 33 55 34 35 36 37 38 39 40 56 if ( ! empty() ) { 57 os << "Attribute with name: " << name; 58 if ( ! parameters.empty() ) { 59 os << " with parameters: " << endl; 60 printAll( parameters, os, indent+1 ); 61 } 62 } 41 63 } 42 64 -
src/SynTree/Attribute.h
rf9feab8 r90152a4 43 43 bool empty() const { return name == ""; } 44 44 45 std::string normalizedName() const; 46 47 /// true if this attribute is allowed to appear attached to a function parameter 48 bool isValidOnFuncParam() const; 49 45 50 Attribute * clone() const override { return new Attribute( *this ); } 46 51 virtual void accept( Visitor & v ) override { v.visit( this ); } -
src/SynTree/BasicType.cc
rf9feab8 r90152a4 55 55 case DoubleImaginary: 56 56 case LongDoubleImaginary: 57 case Float80: 58 case Float128: 57 59 return false; 58 60 case NUMBER_OF_BASIC_TYPES: -
src/SynTree/CompoundStmt.cc
rf9feab8 r90152a4 23 23 #include "Statement.h" // for CompoundStmt, Statement, DeclStmt 24 24 #include "SynTree/Label.h" // for Label 25 #include "SynTree/ VarExprReplacer.h" // for VarExprReplacer, VarExprReplace...25 #include "SynTree/DeclReplacer.h" // for DeclReplacer 26 26 27 27 using std::string; … … 49 49 // recursively execute this routine. There may be more efficient ways of doing 50 50 // this. 51 VarExprReplacer::DeclMap declMap;51 DeclReplacer::DeclMap declMap; 52 52 std::list< Statement * >::const_iterator origit = other.kids.begin(); 53 53 for ( Statement * s : kids ) { … … 59 59 DeclarationWithType * origdwt = strict_dynamic_cast< DeclarationWithType * > ( origDeclStmt->get_decl() ); 60 60 assert( dwt->get_name() == origdwt->get_name() ); 61 declMap[ origdwt ] = new VariableExpr( dwt );61 declMap[ origdwt ] = dwt; 62 62 } else assert( ! dynamic_cast< DeclarationWithType * > ( origDeclStmt->get_decl() ) ); 63 63 } else assert( ! dynamic_cast< DeclStmt * > ( s ) ); 64 64 } 65 65 if ( ! declMap.empty() ) { 66 VarExprReplacer replacer( declMap ); 67 acceptMutator( replacer ); 66 DeclReplacer::replace( this, declMap ); 68 67 } 69 68 } -
src/SynTree/Declaration.cc
rf9feab8 r90152a4 81 81 82 82 83 StaticAssertDecl::StaticAssertDecl( Expression * condition, ConstantExpr * message ) : Declaration( "", Type::StorageClasses(), LinkageSpec::C ), condition( condition ), message( message ) { 84 } 85 86 StaticAssertDecl::StaticAssertDecl( const StaticAssertDecl & other ) : Declaration( other ), condition( maybeClone( other.condition ) ), message( maybeClone( other.message ) ) { 87 } 88 89 StaticAssertDecl::~StaticAssertDecl() { 90 delete condition; 91 delete message; 92 } 93 94 void StaticAssertDecl::print( std::ostream &os, Indenter indent ) const { 95 os << "Static Assert with condition: "; 96 condition->print( os, indent+1 ); 97 os << std::endl << indent << "and message: "; 98 message->print( os, indent+1 ); 99 os << std::endl; 100 } 101 102 void StaticAssertDecl::printShort( std::ostream &os, Indenter indent ) const { 103 print( os, indent ); 104 } 105 106 83 107 // Local Variables: // 84 108 // tab-width: 4 // -
src/SynTree/Declaration.h
rf9feab8 r90152a4 84 84 Expression *asmName; 85 85 std::list< Attribute * > attributes; 86 bool isDeleted = false; 86 87 87 88 DeclarationWithType( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, Type::FuncSpecifiers fs ); … … 151 152 FunctionType *type; 152 153 CompoundStmt *statements; 154 std::list< Expression * > withExprs; 153 155 154 156 FunctionDecl( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements, … … 200 202 typedef NamedTypeDecl Parent; 201 203 public: 202 enum Kind { Dtype, Ftype, Ttype };204 enum Kind { Dtype, Ftype, Ttype, NUMBER_OF_KINDS }; 203 205 204 206 Type * init; … … 244 246 typedef NamedTypeDecl Parent; 245 247 public: 246 TypedefDecl( const std::string &name, Type::StorageClasses scs, Type *type, LinkageSpec::Spec spec = LinkageSpec::Cforall ) : Parent( name, scs, type ) { set_linkage( spec ); } 248 TypedefDecl( const std::string &name, CodeLocation location, Type::StorageClasses scs, Type *type, LinkageSpec::Spec spec = LinkageSpec::Cforall ) 249 : Parent( name, scs, type ) { set_linkage( spec ); this->location = location; } 250 247 251 TypedefDecl( const TypedefDecl &other ) : Parent( other ) {} 248 252 … … 262 266 bool body; 263 267 std::list< Attribute * > attributes; 268 AggregateDecl * parent = nullptr; 264 269 265 270 AggregateDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ); … … 319 324 EnumDecl( const EnumDecl &other ) : Parent( other ) {} 320 325 326 bool valueOf( Declaration * enumerator, long long int & value ); 327 321 328 virtual EnumDecl *clone() const override { return new EnumDecl( *this ); } 322 329 virtual void accept( Visitor &v ) override { v.visit( this ); } 323 330 virtual Declaration *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 324 331 private: 332 std::map< std::string, long long int > enumValues; 325 333 virtual std::string typeString() const override; 326 334 }; … … 355 363 virtual void accept( Visitor &v ) override { v.visit( this ); } 356 364 virtual AsmDecl *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 365 virtual void print( std::ostream &os, Indenter indent = {} ) const override; 366 virtual void printShort( std::ostream &os, Indenter indent = {} ) const override; 367 }; 368 369 class StaticAssertDecl : public Declaration { 370 public: 371 Expression * condition; 372 ConstantExpr * message; // string literal 373 374 StaticAssertDecl( Expression * condition, ConstantExpr * message ); 375 StaticAssertDecl( const StaticAssertDecl & other ); 376 virtual ~StaticAssertDecl(); 377 378 virtual StaticAssertDecl * clone() const override { return new StaticAssertDecl( *this ); } 379 virtual void accept( Visitor &v ) override { v.visit( this ); } 380 virtual StaticAssertDecl * acceptMutator( Mutator &m ) override { return m.mutate( this ); } 357 381 virtual void print( std::ostream &os, Indenter indent = {} ) const override; 358 382 virtual void printShort( std::ostream &os, Indenter indent = {} ) const override; -
src/SynTree/Expression.cc
rf9feab8 r90152a4 50 50 } 51 51 52 void Expression::spliceInferParams( Expression * other ) { 53 if ( ! other ) return; 54 for ( auto p : other->inferParams ) { 55 inferParams[p.first] = std::move( p.second ); 56 } 57 } 58 52 59 Expression::~Expression() { 53 60 delete env; … … 81 88 constant.print( os ); 82 89 Expression::print( os, indent ); 90 } 91 92 long long int ConstantExpr::intValue() const { 93 if ( BasicType * basicType = dynamic_cast< BasicType * >( result ) ) { 94 if ( basicType->isInteger() ) { 95 return get_constant()->get_ival(); 96 } 97 } else if ( dynamic_cast< OneType * >( result ) ) { 98 return 1; 99 } else if ( dynamic_cast< ZeroType * >( result ) ) { 100 return 0; 101 } 102 SemanticError( this, "Constant expression of non-integral type " ); 83 103 } 84 104 … … 95 115 // assert( inst->baseEnum ); 96 116 // EnumDecl * decl = inst->baseEnum; 97 // for ( Declaration * member : decl->members ) { 98 // if ( member == _var ) { 99 // type->set_lvalue( false ); 100 // } 117 // long long int value; 118 // if ( decl->valueOf( var, value ) ) { 119 // type->set_lvalue( false ); 101 120 // } 102 121 // } … … 259 278 } 260 279 261 CastExpr::CastExpr( Expression *arg _, Type *toType ) : Expression(), arg(arg_) {280 CastExpr::CastExpr( Expression *arg, Type *toType, bool isGenerated ) : Expression(), arg(arg), isGenerated( isGenerated ) { 262 281 set_result(toType); 263 282 } 264 283 265 CastExpr::CastExpr( Expression *arg _ ) : Expression(), arg(arg_) {284 CastExpr::CastExpr( Expression *arg, bool isGenerated ) : Expression(), arg(arg), isGenerated( isGenerated ) { 266 285 set_result( new VoidType( Type::Qualifiers() ) ); 267 286 } 268 287 269 CastExpr::CastExpr( const CastExpr &other ) : Expression( other ), arg( maybeClone( other.arg ) ) {288 CastExpr::CastExpr( const CastExpr &other ) : Expression( other ), arg( maybeClone( other.arg ) ), isGenerated( other.isGenerated ) { 270 289 } 271 290 … … 287 306 } 288 307 308 KeywordCastExpr::KeywordCastExpr( Expression *arg, Target target ) : Expression(), arg(arg), target( target ) { 309 } 310 311 KeywordCastExpr::KeywordCastExpr( const KeywordCastExpr &other ) : Expression( other ), arg( maybeClone( other.arg ) ), target( other.target ) { 312 } 313 314 KeywordCastExpr::~KeywordCastExpr() { 315 delete arg; 316 } 317 318 const std::string & KeywordCastExpr::targetString() const { 319 static const std::string targetStrs[] = { 320 "coroutine", "thread", "monitor" 321 }; 322 static_assert( 323 (sizeof(targetStrs) / sizeof(targetStrs[0])) == ((unsigned long)NUMBER_OF_TARGETS), 324 "Each KeywordCastExpr::Target should have a corresponding string representation" 325 ); 326 return targetStrs[(unsigned long)target]; 327 } 328 329 void KeywordCastExpr::print( std::ostream &os, Indenter indent ) const { 330 os << "Keyword Cast of:" << std::endl << indent+1; 331 arg->print(os, indent+1); 332 os << std::endl << indent << "... to: "; 333 os << targetString(); 334 Expression::print( os, indent ); 335 } 336 289 337 VirtualCastExpr::VirtualCastExpr( Expression *arg_, Type *toType ) : Expression(), arg(arg_) { 290 338 set_result(toType); … … 333 381 } 334 382 335 namespace {336 TypeSubstitution makeSub( Type * t ) {337 if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( t ) ) {338 return makeSub( refType->get_base() );339 } else if ( StructInstType * aggInst = dynamic_cast< StructInstType * >( t ) ) {340 return TypeSubstitution( aggInst->get_baseParameters()->begin(), aggInst->get_baseParameters()->end(), aggInst->parameters.begin() );341 } else if ( UnionInstType * aggInst = dynamic_cast< UnionInstType * >( t ) ) {342 return TypeSubstitution( aggInst->get_baseParameters()->begin(), aggInst->get_baseParameters()->end(), aggInst->parameters.begin() );343 } else {344 assertf( false, "makeSub expects struct or union type for aggregate, but got: %s", toString( t ).c_str() );345 }346 }347 }348 349 350 383 MemberExpr::MemberExpr( DeclarationWithType *member, Expression *aggregate ) : 351 384 Expression(), member(member), aggregate(aggregate) { 352 385 assert( member ); 353 386 assert( aggregate ); 354 355 TypeSubstitution sub( makeSub( aggregate->get_result() ) ); 387 assert( aggregate->result ); 388 389 TypeSubstitution sub = aggregate->result->genericSubstitution(); 356 390 Type * res = member->get_type()->clone(); 357 391 sub.apply( res ); … … 403 437 } else { 404 438 // references have been removed, in which case dereference returns an lvalue of the base type. 405 ret-> get_result()->set_lvalue( true );439 ret->result->set_lvalue( true ); 406 440 } 407 441 } … … 585 619 586 620 StmtExpr::StmtExpr( CompoundStmt *statements ) : statements( statements ) { 587 assert( statements ); 588 std::list< Statement * > & body = statements->get_kids(); 589 if ( ! body.empty() ) { 590 if ( ExprStmt * exprStmt = dynamic_cast< ExprStmt * >( body.back() ) ) { 591 set_result( maybeClone( exprStmt->get_expr()->get_result() ) ); 592 } 593 } 594 // ensure that StmtExpr has a result type 595 if ( ! result ) { 596 set_result( new VoidType( Type::Qualifiers() ) ); 597 } 621 computeResult(); 598 622 } 599 623 StmtExpr::StmtExpr( const StmtExpr &other ) : Expression( other ), statements( other.statements->clone() ) { … … 605 629 deleteAll( dtors ); 606 630 deleteAll( returnDecls ); 631 } 632 void StmtExpr::computeResult() { 633 assert( statements ); 634 std::list< Statement * > & body = statements->kids; 635 delete result; 636 result = nullptr; 637 if ( ! returnDecls.empty() ) { 638 // prioritize return decl for result type, since if a return decl exists, then 639 // the StmtExpr is currently in an intermediate state where the body will always 640 // give a void result type. 641 result = returnDecls.front()->get_type()->clone(); 642 } else if ( ! body.empty() ) { 643 if ( ExprStmt * exprStmt = dynamic_cast< ExprStmt * >( body.back() ) ) { 644 result = maybeClone( exprStmt->expr->result ); 645 } 646 } 647 // ensure that StmtExpr has a result type 648 if ( ! result ) { 649 result = new VoidType( Type::Qualifiers() ); 650 } 607 651 } 608 652 void StmtExpr::print( std::ostream &os, Indenter indent ) const { … … 688 732 } 689 733 734 DeletedExpr::DeletedExpr( Expression * expr, BaseSyntaxNode * deleteStmt ) : expr( expr ), deleteStmt( deleteStmt ) { 735 assert( expr->result ); 736 result = expr->result->clone(); 737 } 738 DeletedExpr::DeletedExpr( const DeletedExpr & other ) : Expression( other ), expr( maybeClone( other.expr ) ), deleteStmt( other.deleteStmt ) {} 739 DeletedExpr::~DeletedExpr() { 740 delete expr; 741 } 742 743 void DeletedExpr::print( std::ostream & os, Indenter indent ) const { 744 os << "Deleted Expression" << std::endl << indent+1; 745 expr->print( os, indent+1 ); 746 os << std::endl << indent+1 << "... deleted by: "; 747 deleteStmt->print( os, indent+1 ); 748 } 749 750 751 DefaultArgExpr::DefaultArgExpr( Expression * expr ) : expr( expr ) { 752 assert( expr->result ); 753 result = expr->result->clone(); 754 } 755 DefaultArgExpr::DefaultArgExpr( const DefaultArgExpr & other ) : Expression( other ), expr( maybeClone( other.expr ) ) {} 756 DefaultArgExpr::~DefaultArgExpr() { 757 delete expr; 758 } 759 760 void DefaultArgExpr::print( std::ostream & os, Indenter indent ) const { 761 os << "Default Argument Expression" << std::endl << indent+1; 762 expr->print( os, indent+1 ); 763 } 764 765 GenericExpr::Association::Association( Type * type, Expression * expr ) : type( type ), expr( expr ), isDefault( false ) {} 766 GenericExpr::Association::Association( Expression * expr ) : type( nullptr ), expr( expr ), isDefault( true ) {} 767 GenericExpr::Association::Association( const Association & other ) : type( maybeClone( other.type ) ), expr( maybeClone( other.expr ) ), isDefault( other.isDefault ) {} 768 GenericExpr::Association::~Association() { 769 delete type; 770 delete expr; 771 } 772 773 GenericExpr::GenericExpr( Expression * control, const std::list<Association> & assoc ) : Expression(), control( control ), associations( assoc ) {} 774 GenericExpr::GenericExpr( const GenericExpr & other ) : Expression(other), control( maybeClone( other.control ) ), associations( other.associations ) { 775 } 776 GenericExpr::~GenericExpr() { 777 delete control; 778 } 779 780 void GenericExpr::print( std::ostream & os, Indenter indent ) const { 781 os << "C11 _Generic Expression" << std::endl << indent+1; 782 control->print( os, indent+1 ); 783 os << std::endl << indent+1 << "... with associations: " << std::endl; 784 for ( const Association & assoc : associations ) { 785 os << indent+1; 786 if (assoc.isDefault) { 787 os << "... default: "; 788 assoc.expr->print( os, indent+1 ); 789 } else { 790 os << "... type: "; 791 assoc.type->print( os, indent+1 ); 792 os << std::endl << indent+1 << "... expression: "; 793 assoc.expr->print( os, indent+1 ); 794 os << std::endl; 795 } 796 os << std::endl; 797 } 798 } 799 690 800 // Local Variables: // 691 801 // tab-width: 4 // -
src/SynTree/Expression.h
rf9feab8 r90152a4 41 41 ParamEntry( UniqueId decl, Type * actualType, Type * formalType, Expression* expr ): decl( decl ), actualType( actualType ), formalType( formalType ), expr( expr ), inferParams( new InferredParams ) {} 42 42 ParamEntry( const ParamEntry & other ); 43 ParamEntry( ParamEntry && other ); 43 44 ~ParamEntry(); 44 45 ParamEntry & operator=( const ParamEntry & other ); 46 ParamEntry & operator=( ParamEntry && other ); 45 47 46 48 UniqueId decl; … … 74 76 InferredParams & get_inferParams() { return inferParams; } 75 77 78 // move other's inferParams to this 79 void spliceInferParams( Expression * other ); 80 76 81 virtual Expression * clone() const override = 0; 77 82 virtual void accept( Visitor & v ) override = 0; … … 188 193 public: 189 194 Expression * arg; 190 191 CastExpr( Expression * arg ); 192 CastExpr( Expression * arg, Type * toType ); 195 bool isGenerated = true; // whether this cast appeared in the source program 196 197 CastExpr( Expression * arg, bool isGenerated = true ); 198 CastExpr( Expression * arg, Type * toType, bool isGenerated = true ); 199 CastExpr( Expression * arg, void * ) = delete; // prevent accidentally passing pointers for isGenerated in the first constructor 193 200 CastExpr( const CastExpr & other ); 194 201 virtual ~CastExpr(); … … 198 205 199 206 virtual CastExpr * clone() const { return new CastExpr( * this ); } 207 virtual void accept( Visitor & v ) { v.visit( this ); } 208 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 209 virtual void print( std::ostream & os, Indenter indent = {} ) const; 210 }; 211 212 /// KeywordCastExpr represents a cast to 'keyword types', e.g. (thread &)t 213 class KeywordCastExpr : public Expression { 214 public: 215 Expression * arg; 216 enum Target { 217 Coroutine, Thread, Monitor, NUMBER_OF_TARGETS 218 } target; 219 220 KeywordCastExpr( Expression * arg, Target target ); 221 KeywordCastExpr( const KeywordCastExpr & other ); 222 virtual ~KeywordCastExpr(); 223 224 const std::string & targetString() const; 225 226 virtual KeywordCastExpr * clone() const { return new KeywordCastExpr( * this ); } 200 227 virtual void accept( Visitor & v ) { v.visit( this ); } 201 228 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } … … 295 322 296 323 Constant * get_constant() { return & constant; } 324 const Constant * get_constant() const { return & constant; } 297 325 void set_constant( const Constant & newValue ) { constant = newValue; } 326 327 long long int intValue() const; 298 328 299 329 virtual ConstantExpr * clone() const { return new ConstantExpr( * this ); } … … 725 755 StmtExpr * set_statements( CompoundStmt * newValue ) { statements = newValue; return this; } 726 756 757 // call to set the result type of this StmtExpr based on its body 758 void computeResult(); 759 727 760 std::list< ObjectDecl * > & get_returnDecls() { return returnDecls; } 728 761 std::list< Expression * > & get_dtors() { return dtors; } … … 816 849 }; 817 850 851 /// expression that contains a deleted identifier - should never make it past the resolver. 852 class DeletedExpr : public Expression { 853 public: 854 Expression * expr; 855 BaseSyntaxNode * deleteStmt; 856 857 DeletedExpr( Expression * expr, BaseSyntaxNode * deleteStmt ); 858 DeletedExpr( const DeletedExpr & other ); 859 ~DeletedExpr(); 860 861 virtual DeletedExpr * clone() const { return new DeletedExpr( * this ); } 862 virtual void accept( Visitor & v ) { v.visit( this ); } 863 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 864 virtual void print( std::ostream & os, Indenter indent = {} ) const; 865 }; 866 867 /// expression wrapping the use of a default argument - should never make it past the resolver. 868 class DefaultArgExpr : public Expression { 869 public: 870 Expression * expr; 871 872 DefaultArgExpr( Expression * expr ); 873 DefaultArgExpr( const DefaultArgExpr & other ); 874 ~DefaultArgExpr(); 875 876 virtual DefaultArgExpr * clone() const { return new DefaultArgExpr( * this ); } 877 virtual void accept( Visitor & v ) { v.visit( this ); } 878 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 879 virtual void print( std::ostream & os, Indenter indent = {} ) const; 880 }; 881 882 /// C11 _Generic expression 883 class GenericExpr : public Expression { 884 public: 885 struct Association { 886 Type * type = nullptr; 887 Expression * expr = nullptr; 888 bool isDefault = false; 889 890 Association( Type * type, Expression * expr ); 891 Association( Expression * expr ); 892 Association( const Association & other ); 893 Association & operator=( const Association & other ) = delete; // at the moment this isn't used, and I don't want to implement it 894 ~Association(); 895 }; 896 897 Expression * control; 898 std::list<Association> associations; 899 900 GenericExpr( Expression * control, const std::list<Association> & assoc ); 901 GenericExpr( const GenericExpr & other ); 902 virtual ~GenericExpr(); 903 904 virtual GenericExpr * clone() const { return new GenericExpr( * this ); } 905 virtual void accept( Visitor & v ) { v.visit( this ); } 906 virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); } 907 virtual void print( std::ostream & os, Indenter indent = {} ) const; 908 }; 909 818 910 // Local Variables: // 819 911 // tab-width: 4 // -
src/SynTree/FunctionDecl.cc
rf9feab8 r90152a4 26 26 #include "Statement.h" // for CompoundStmt 27 27 #include "Type.h" // for Type, FunctionType, Type::FuncSpecif... 28 #include " VarExprReplacer.h"28 #include "DeclReplacer.h" 29 29 30 30 extern bool translation_unit_nomain; … … 41 41 : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ) { 42 42 43 VarExprReplacer::DeclMap declMap;43 DeclReplacer::DeclMap declMap; 44 44 for ( auto p : group_iterate( other.type->parameters, type->parameters ) ) { 45 declMap[ std::get<0>(p) ] = new VariableExpr( std::get<1>(p));45 declMap[ std::get<0>(p) ] = std::get<1>(p); 46 46 } 47 47 for ( auto p : group_iterate( other.type->returnVals, type->returnVals ) ) { 48 declMap[ std::get<0>(p) ] = new VariableExpr( std::get<1>(p));48 declMap[ std::get<0>(p) ] = std::get<1>(p); 49 49 } 50 50 if ( ! declMap.empty() ) { 51 VarExprReplacer replacer( declMap ); 52 acceptMutator( replacer ); 51 DeclReplacer::replace( this, declMap ); 53 52 } 53 cloneAll( other.withExprs, withExprs ); 54 54 } 55 55 … … 57 57 delete type; 58 58 delete statements; 59 deleteAll( withExprs ); 59 60 } 60 61 -
src/SynTree/Label.h
rf9feab8 r90152a4 33 33 std::list< Attribute * >& get_attributes() { return attributes; } 34 34 35 operator std::string() { return name; }35 operator std::string() const { return name; } 36 36 bool empty() { return name.empty(); } 37 37 private: -
src/SynTree/Mutator.h
rf9feab8 r90152a4 22 22 class Mutator { 23 23 protected: 24 Mutator() ;25 virtual ~Mutator() ;24 Mutator() = default; 25 virtual ~Mutator() = default; 26 26 public: 27 virtual DeclarationWithType * mutate( ObjectDecl * objectDecl ); 28 virtual DeclarationWithType * mutate( FunctionDecl * functionDecl ); 29 virtual Declaration * mutate( StructDecl * aggregateDecl ); 30 virtual Declaration * mutate( UnionDecl * aggregateDecl ); 31 virtual Declaration * mutate( EnumDecl * aggregateDecl ); 32 virtual Declaration * mutate( TraitDecl * aggregateDecl ); 33 virtual Declaration * mutate( TypeDecl * typeDecl ); 34 virtual Declaration * mutate( TypedefDecl * typeDecl ); 35 virtual AsmDecl * mutate( AsmDecl * asmDecl ); 27 virtual DeclarationWithType * mutate( ObjectDecl * objectDecl ) = 0; 28 virtual DeclarationWithType * mutate( FunctionDecl * functionDecl ) = 0; 29 virtual Declaration * mutate( StructDecl * aggregateDecl ) = 0; 30 virtual Declaration * mutate( UnionDecl * aggregateDecl ) = 0; 31 virtual Declaration * mutate( EnumDecl * aggregateDecl ) = 0; 32 virtual Declaration * mutate( TraitDecl * aggregateDecl ) = 0; 33 virtual Declaration * mutate( TypeDecl * typeDecl ) = 0; 34 virtual Declaration * mutate( TypedefDecl * typeDecl ) = 0; 35 virtual AsmDecl * mutate( AsmDecl * asmDecl ) = 0; 36 virtual StaticAssertDecl * mutate( StaticAssertDecl * assertDecl ) = 0; 36 37 37 virtual CompoundStmt * mutate( CompoundStmt * compoundStmt ); 38 virtual Statement * mutate( ExprStmt * exprStmt ); 39 virtual Statement * mutate( AsmStmt * asmStmt ); 40 virtual Statement * mutate( IfStmt * ifStmt ); 41 virtual Statement * mutate( WhileStmt * whileStmt ); 42 virtual Statement * mutate( ForStmt * forStmt ); 43 virtual Statement * mutate( SwitchStmt * switchStmt ); 44 virtual Statement * mutate( CaseStmt * caseStmt ); 45 virtual Statement * mutate( BranchStmt * branchStmt ); 46 virtual Statement * mutate( ReturnStmt * returnStmt ); 47 virtual Statement * mutate( ThrowStmt * throwStmt ); 48 virtual Statement * mutate( TryStmt * tryStmt ); 49 virtual Statement * mutate( CatchStmt * catchStmt ); 50 virtual Statement * mutate( FinallyStmt * catchStmt ); 51 virtual Statement * mutate( WaitForStmt * waitforStmt ); 52 virtual Statement * mutate( WithStmt * withStmt ); 53 virtual NullStmt * mutate( NullStmt * nullStmt ); 54 virtual Statement * mutate( DeclStmt * declStmt ); 55 virtual Statement * mutate( ImplicitCtorDtorStmt * impCtorDtorStmt ); 38 virtual CompoundStmt * mutate( CompoundStmt * compoundStmt ) = 0; 39 virtual Statement * mutate( ExprStmt * exprStmt ) = 0; 40 virtual Statement * mutate( AsmStmt * asmStmt ) = 0; 41 virtual Statement * mutate( DirectiveStmt * dirStmt ) = 0; 42 virtual Statement * mutate( IfStmt * ifStmt ) = 0; 43 virtual Statement * mutate( WhileStmt * whileStmt ) = 0; 44 virtual Statement * mutate( ForStmt * forStmt ) = 0; 45 virtual Statement * mutate( SwitchStmt * switchStmt ) = 0; 46 virtual Statement * mutate( CaseStmt * caseStmt ) = 0; 47 virtual Statement * mutate( BranchStmt * branchStmt ) = 0; 48 virtual Statement * mutate( ReturnStmt * returnStmt ) = 0; 49 virtual Statement * mutate( ThrowStmt * throwStmt ) = 0; 50 virtual Statement * mutate( TryStmt * tryStmt ) = 0; 51 virtual Statement * mutate( CatchStmt * catchStmt ) = 0; 52 virtual Statement * mutate( FinallyStmt * catchStmt ) = 0; 53 virtual Statement * mutate( WaitForStmt * waitforStmt ) = 0; 54 virtual Statement * mutate( WithStmt * withStmt ) = 0; 55 virtual NullStmt * mutate( NullStmt * nullStmt ) = 0; 56 virtual Statement * mutate( DeclStmt * declStmt ) = 0; 57 virtual Statement * mutate( ImplicitCtorDtorStmt * impCtorDtorStmt ) = 0; 56 58 57 virtual Expression* mutate( ApplicationExpr * applicationExpr ); 58 virtual Expression* mutate( UntypedExpr * untypedExpr ); 59 virtual Expression* mutate( NameExpr * nameExpr ); 60 virtual Expression* mutate( AddressExpr * castExpr ); 61 virtual Expression* mutate( LabelAddressExpr * labAddressExpr ); 62 virtual Expression* mutate( CastExpr * castExpr ); 63 virtual Expression* mutate( VirtualCastExpr * castExpr ); 64 virtual Expression* mutate( UntypedMemberExpr * memberExpr ); 65 virtual Expression* mutate( MemberExpr * memberExpr ); 66 virtual Expression* mutate( VariableExpr * variableExpr ); 67 virtual Expression* mutate( ConstantExpr * constantExpr ); 68 virtual Expression* mutate( SizeofExpr * sizeofExpr ); 69 virtual Expression* mutate( AlignofExpr * alignofExpr ); 70 virtual Expression* mutate( UntypedOffsetofExpr * offsetofExpr ); 71 virtual Expression* mutate( OffsetofExpr * offsetofExpr ); 72 virtual Expression* mutate( OffsetPackExpr * offsetPackExpr ); 73 virtual Expression* mutate( AttrExpr * attrExpr ); 74 virtual Expression* mutate( LogicalExpr * logicalExpr ); 75 virtual Expression* mutate( ConditionalExpr * conditionalExpr ); 76 virtual Expression* mutate( CommaExpr * commaExpr ); 77 virtual Expression* mutate( TypeExpr * typeExpr ); 78 virtual Expression* mutate( AsmExpr * asmExpr ); 79 virtual Expression* mutate( ImplicitCopyCtorExpr * impCpCtorExpr ); 80 virtual Expression* mutate( ConstructorExpr * ctorExpr ); 81 virtual Expression* mutate( CompoundLiteralExpr * compLitExpr ); 82 virtual Expression* mutate( RangeExpr * rangeExpr ); 83 virtual Expression* mutate( UntypedTupleExpr * tupleExpr ); 84 virtual Expression* mutate( TupleExpr * tupleExpr ); 85 virtual Expression* mutate( TupleIndexExpr * tupleExpr ); 86 virtual Expression* mutate( TupleAssignExpr * assignExpr ); 87 virtual Expression* mutate( StmtExpr * stmtExpr ); 88 virtual Expression* mutate( UniqueExpr * uniqueExpr ); 89 virtual Expression* mutate( UntypedInitExpr * initExpr ); 90 virtual Expression* mutate( InitExpr * initExpr ); 59 virtual Expression * mutate( ApplicationExpr * applicationExpr ) = 0; 60 virtual Expression * mutate( UntypedExpr * untypedExpr ) = 0; 61 virtual Expression * mutate( NameExpr * nameExpr ) = 0; 62 virtual Expression * mutate( AddressExpr * addrExpr ) = 0; 63 virtual Expression * mutate( LabelAddressExpr * labAddressExpr ) = 0; 64 virtual Expression * mutate( CastExpr * castExpr ) = 0; 65 virtual Expression * mutate( KeywordCastExpr * castExpr ) = 0; 66 virtual Expression * mutate( VirtualCastExpr * castExpr ) = 0; 67 virtual Expression * mutate( UntypedMemberExpr * memberExpr ) = 0; 68 virtual Expression * mutate( MemberExpr * memberExpr ) = 0; 69 virtual Expression * mutate( VariableExpr * variableExpr ) = 0; 70 virtual Expression * mutate( ConstantExpr * constantExpr ) = 0; 71 virtual Expression * mutate( SizeofExpr * sizeofExpr ) = 0; 72 virtual Expression * mutate( AlignofExpr * alignofExpr ) = 0; 73 virtual Expression * mutate( UntypedOffsetofExpr * offsetofExpr ) = 0; 74 virtual Expression * mutate( OffsetofExpr * offsetofExpr ) = 0; 75 virtual Expression * mutate( OffsetPackExpr * offsetPackExpr ) = 0; 76 virtual Expression * mutate( AttrExpr * attrExpr ) = 0; 77 virtual Expression * mutate( LogicalExpr * logicalExpr ) = 0; 78 virtual Expression * mutate( ConditionalExpr * conditionalExpr ) = 0; 79 virtual Expression * mutate( CommaExpr * commaExpr ) = 0; 80 virtual Expression * mutate( TypeExpr * typeExpr ) = 0; 81 virtual Expression * mutate( AsmExpr * asmExpr ) = 0; 82 virtual Expression * mutate( ImplicitCopyCtorExpr * impCpCtorExpr ) = 0; 83 virtual Expression * mutate( ConstructorExpr * ctorExpr ) = 0; 84 virtual Expression * mutate( CompoundLiteralExpr * compLitExpr ) = 0; 85 virtual Expression * mutate( RangeExpr * rangeExpr ) = 0; 86 virtual Expression * mutate( UntypedTupleExpr * tupleExpr ) = 0; 87 virtual Expression * mutate( TupleExpr * tupleExpr ) = 0; 88 virtual Expression * mutate( TupleIndexExpr * tupleExpr ) = 0; 89 virtual Expression * mutate( TupleAssignExpr * assignExpr ) = 0; 90 virtual Expression * mutate( StmtExpr * stmtExpr ) = 0; 91 virtual Expression * mutate( UniqueExpr * uniqueExpr ) = 0; 92 virtual Expression * mutate( UntypedInitExpr * initExpr ) = 0; 93 virtual Expression * mutate( InitExpr * initExpr ) = 0; 94 virtual Expression * mutate( DeletedExpr * delExpr ) = 0; 95 virtual Expression * mutate( DefaultArgExpr * argExpr ) = 0; 96 virtual Expression * mutate( GenericExpr * genExpr ) = 0; 91 97 92 virtual Type * mutate( VoidType * basicType ); 93 virtual Type * mutate( BasicType * basicType ); 94 virtual Type * mutate( PointerType * pointerType ); 95 virtual Type * mutate( ArrayType * arrayType ); 96 virtual Type * mutate( ReferenceType * refType ); 97 virtual Type * mutate( FunctionType * functionType ); 98 virtual Type * mutate( StructInstType * aggregateUseType ); 99 virtual Type * mutate( UnionInstType * aggregateUseType ); 100 virtual Type * mutate( EnumInstType * aggregateUseType ); 101 virtual Type * mutate( TraitInstType * aggregateUseType ); 102 virtual Type * mutate( TypeInstType * aggregateUseType ); 103 virtual Type * mutate( TupleType * tupleType ); 104 virtual Type * mutate( TypeofType * typeofType ); 105 virtual Type * mutate( AttrType * attrType ); 106 virtual Type * mutate( VarArgsType * varArgsType ); 107 virtual Type * mutate( ZeroType * zeroType ); 108 virtual Type * mutate( OneType * oneType ); 98 virtual Type * mutate( VoidType * basicType ) = 0; 99 virtual Type * mutate( BasicType * basicType ) = 0; 100 virtual Type * mutate( PointerType * pointerType ) = 0; 101 virtual Type * mutate( ArrayType * arrayType ) = 0; 102 virtual Type * mutate( ReferenceType * refType ) = 0; 103 virtual Type * mutate( QualifiedType * qualType ) = 0; 104 virtual Type * mutate( FunctionType * functionType ) = 0; 105 virtual Type * mutate( StructInstType * aggregateUseType ) = 0; 106 virtual Type * mutate( UnionInstType * aggregateUseType ) = 0; 107 virtual Type * mutate( EnumInstType * aggregateUseType ) = 0; 108 virtual Type * mutate( TraitInstType * aggregateUseType ) = 0; 109 virtual Type * mutate( TypeInstType * aggregateUseType ) = 0; 110 virtual Type * mutate( TupleType * tupleType ) = 0; 111 virtual Type * mutate( TypeofType * typeofType ) = 0; 112 virtual Type * mutate( AttrType * attrType ) = 0; 113 virtual Type * mutate( VarArgsType * varArgsType ) = 0; 114 virtual Type * mutate( ZeroType * zeroType ) = 0; 115 virtual Type * mutate( OneType * oneType ) = 0; 116 virtual Type * mutate( GlobalScopeType * globalType ) = 0; 109 117 110 virtual Designation * mutate( Designation * designation ) ;111 virtual Initializer * mutate( SingleInit * singleInit ) ;112 virtual Initializer * mutate( ListInit * listInit ) ;113 virtual Initializer * mutate( ConstructorInit * ctorInit ) ;118 virtual Designation * mutate( Designation * designation ) = 0 ; 119 virtual Initializer * mutate( SingleInit * singleInit ) = 0 ; 120 virtual Initializer * mutate( ListInit * listInit ) = 0 ; 121 virtual Initializer * mutate( ConstructorInit * ctorInit ) = 0 ; 114 122 115 virtual Subrange * mutate( Subrange * subrange ) ;123 virtual Subrange * mutate( Subrange * subrange ) = 0; 116 124 117 virtual Constant * mutate( Constant * constant ) ;125 virtual Constant * mutate( Constant * constant ) = 0; 118 126 119 virtual Attribute * mutate( Attribute * attribute ) ;127 virtual Attribute * mutate( Attribute * attribute ) = 0; 120 128 121 virtual TypeSubstitution * mutate( TypeSubstitution * sub ); 122 123 private: 124 virtual Declaration * handleAggregateDecl(AggregateDecl * aggregateDecl ); 125 virtual Declaration * handleNamedTypeDecl(NamedTypeDecl * typeDecl ); 126 virtual Type * handleReferenceToType(ReferenceToType * aggregateUseType ); 129 virtual TypeSubstitution * mutate( TypeSubstitution * sub ) = 0; 127 130 }; 128 131 … … 140 143 template< typename Container, typename MutatorType > 141 144 inline void mutateAll( Container &container, MutatorType &mutator ) { 142 SemanticError errors;145 SemanticErrorException errors; 143 146 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) { 144 147 try { … … 148 151 assert( *i ); 149 152 } // if 150 } catch( SemanticError &e ) { 151 e.set_location( (*i)->location ); 153 } catch( SemanticErrorException &e ) { 152 154 errors.append( e ); 153 155 } // try -
src/SynTree/ReferenceToType.cc
rf9feab8 r90152a4 14 14 // 15 15 16 #include <cassert> // for assert 17 #include <list> // for list, _List_const_iterator, list<>::cons... 18 #include <ostream> // for operator<<, basic_ostream, ostream, endl 19 #include <string> // for string, operator<<, char_traits, operator== 20 21 #include "Common/utility.h" // for printAll, cloneAll, deleteAll 22 #include "Declaration.h" // for StructDecl, UnionDecl, EnumDecl, Declara... 23 #include "Expression.h" // for Expression 24 #include "Type.h" // for TypeInstType, StructInstType, UnionInstType 16 #include <cassert> // for assert 17 #include <list> // for list, _List_const_iterator, list<>::cons... 18 #include <ostream> // for operator<<, basic_ostream, ostream, endl 19 #include <string> // for string, operator<<, char_traits, operator== 20 21 #include "Common/utility.h" // for printAll, cloneAll, deleteAll 22 #include "Declaration.h" // for StructDecl, UnionDecl, EnumDecl, Declara... 23 #include "Expression.h" // for Expression 24 #include "Type.h" // for TypeInstType, StructInstType, UnionInstType 25 #include "TypeSubstitution.h" // for TypeSubstitution 25 26 26 27 class Attribute; … … 49 50 50 51 namespace { 51 void doLookup( const std::list< Declaration * > &members, const std::string &name, std::list< Declaration* > &foundDecls ) {52 for ( std::list< Declaration* >::const_iterator i = members.begin(); i != members.end(); ++i) {53 if ( (*i)->get_name()== name ) {54 foundDecls.push_back( *i);52 void doLookup( const std::list< Declaration * > & members, const std::string & name, std::list< Declaration* > & foundDecls ) { 53 for ( Declaration * decl : members ) { 54 if ( decl->name == name ) { 55 foundDecls.push_back( decl ); 55 56 } // if 56 57 } // for … … 59 60 60 61 StructInstType::StructInstType( const Type::Qualifiers & tq, StructDecl * baseStruct, const std::list< Attribute * > & attributes ) : 61 Parent( tq, baseStruct-> get_name(), attributes ), baseStruct( baseStruct ) {}62 Parent( tq, baseStruct->name, attributes ), baseStruct( baseStruct ) {} 62 63 63 64 std::string StructInstType::typeString() const { return "struct"; } 65 66 const std::list<TypeDecl*>* StructInstType::get_baseParameters() const { 67 if ( ! baseStruct ) return nullptr; 68 return &baseStruct->get_parameters(); 69 } 64 70 65 71 std::list<TypeDecl*>* StructInstType::get_baseParameters() { … … 70 76 bool StructInstType::isComplete() const { return baseStruct ? baseStruct->has_body() : false; } 71 77 72 AggregateDecl * StructInstType::getAggr() { return baseStruct; } 78 AggregateDecl * StructInstType::getAggr() const { return baseStruct; } 79 80 TypeSubstitution StructInstType::genericSubstitution() const { 81 return TypeSubstitution( get_baseParameters()->begin(), get_baseParameters()->end(), parameters.begin() ); 82 } 73 83 74 84 void StructInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const { 75 85 assert( baseStruct ); 76 doLookup( baseStruct-> get_members(), name, foundDecls );86 doLookup( baseStruct->members, name, foundDecls ); 77 87 } 78 88 … … 93 103 94 104 UnionInstType::UnionInstType( const Type::Qualifiers & tq, UnionDecl * baseUnion, const std::list< Attribute * > & attributes ) : 95 Parent( tq, baseUnion-> get_name(), attributes ), baseUnion( baseUnion ) {}105 Parent( tq, baseUnion->name, attributes ), baseUnion( baseUnion ) {} 96 106 97 107 std::string UnionInstType::typeString() const { return "union"; } … … 102 112 } 103 113 114 const std::list< TypeDecl * > * UnionInstType::get_baseParameters() const { 115 if ( ! baseUnion ) return nullptr; 116 return &baseUnion->get_parameters(); 117 } 118 104 119 bool UnionInstType::isComplete() const { return baseUnion ? baseUnion->has_body() : false; } 105 120 106 AggregateDecl * UnionInstType::getAggr() { return baseUnion; } 121 AggregateDecl * UnionInstType::getAggr() const { return baseUnion; } 122 123 TypeSubstitution UnionInstType::genericSubstitution() const { 124 return TypeSubstitution( get_baseParameters()->begin(), get_baseParameters()->end(), parameters.begin() ); 125 } 107 126 108 127 void UnionInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const { 109 128 assert( baseUnion ); 110 doLookup( baseUnion-> get_members(), name, foundDecls );129 doLookup( baseUnion->members, name, foundDecls ); 111 130 } 112 131 … … 133 152 bool EnumInstType::isComplete() const { return baseEnum ? baseEnum->has_body() : false; } 134 153 154 AggregateDecl * EnumInstType::getAggr() const { return baseEnum; } 155 135 156 void EnumInstType::print( std::ostream &os, Indenter indent ) const { 136 157 using std::endl; -
src/SynTree/ReferenceType.cc
rf9feab8 r90152a4 16 16 #include "Type.h" 17 17 #include "Expression.h" 18 #include "TypeSubstitution.h" 18 19 #include "Common/utility.h" 19 20 … … 35 36 } 36 37 38 TypeSubstitution ReferenceType::genericSubstitution() const { return base->genericSubstitution(); } 39 37 40 void ReferenceType::print( std::ostream &os, Indenter indent ) const { 38 41 Type::print( os, indent ); -
src/SynTree/Statement.cc
rf9feab8 r90152a4 34 34 Statement::Statement( const std::list<Label> & labels ) : labels( labels ) {} 35 35 36 void Statement::print( std::ostream & os, Indenter ) const {36 void Statement::print( std::ostream & os, Indenter indent ) const { 37 37 if ( ! labels.empty() ) { 38 os << "Labels: {";38 os << indent << "... Labels: {"; 39 39 for ( const Label & l : labels ) { 40 40 os << l << ","; … … 94 94 95 95 96 DirectiveStmt::DirectiveStmt( const std::string & directive ) : Statement(), directive( directive ) {} 97 98 void DirectiveStmt::print( std::ostream &os, Indenter ) const { 99 os << "GCC Directive:" << directive << endl; 100 } 101 102 96 103 const char *BranchStmt::brType[] = { "Goto", "Break", "Continue" }; 97 104 98 BranchStmt::BranchStmt( Label target, Type type ) throw ( SemanticError ) :105 BranchStmt::BranchStmt( Label target, Type type ) throw ( SemanticErrorException ) : 99 106 Statement(), originalTarget( target ), target( target ), computedTarget( nullptr ), type( type ) { 100 107 //actually this is a syntactic error signaled by the parser 101 108 if ( type == BranchStmt::Goto && target.empty() ) { 102 throw SemanticError("goto without target");103 } 104 } 105 106 BranchStmt::BranchStmt( Expression *computedTarget, Type type ) throw ( SemanticError ) :109 SemanticError( target.get_statement()->location, "goto without target"); 110 } 111 } 112 113 BranchStmt::BranchStmt( Expression *computedTarget, Type type ) throw ( SemanticErrorException ) : 107 114 Statement(), computedTarget( computedTarget ), type( type ) { 108 115 if ( type != BranchStmt::Goto || computedTarget == nullptr ) { 109 throw SemanticError("Computed target not valid in branch statement");116 SemanticError( computedTarget->location, "Computed target not valid in branch statement"); 110 117 } 111 118 } … … 201 208 } 202 209 203 CaseStmt::CaseStmt( Expression *condition, const std::list<Statement *> &statements, bool deflt ) throw ( SemanticError ) :210 CaseStmt::CaseStmt( Expression *condition, const std::list<Statement *> &statements, bool deflt ) throw ( SemanticErrorException ) : 204 211 Statement(), condition( condition ), stmts( statements ), _isDefault( deflt ) { 205 if ( isDefault() && condition != 0 ) throw SemanticError("default case with condition: ", condition);212 if ( isDefault() && condition != 0 ) SemanticError( condition, "default case with condition: " ); 206 213 } 207 214 … … 223 230 224 231 void CaseStmt::print( std::ostream &os, Indenter indent ) const { 225 if ( isDefault() ) os << "Default ";232 if ( isDefault() ) os << indent << "Default "; 226 233 else { 227 os << "Case ";234 os << indent << "Case "; 228 235 condition->print( os, indent ); 229 236 } // if … … 231 238 232 239 for ( Statement * stmt : stmts ) { 240 os << indent+1; 233 241 stmt->print( os, indent+1 ); 234 242 } 235 243 } 236 244 237 WhileStmt::WhileStmt( Expression *condition, Statement *body, bool isDoWhile ):238 Statement(), condition( condition), body( body), i sDoWhile( isDoWhile) {245 WhileStmt::WhileStmt( Expression *condition, Statement *body, std::list< Statement * > & initialization, bool isDoWhile ): 246 Statement(), condition( condition), body( body), initialization( initialization ), isDoWhile( isDoWhile) { 239 247 } 240 248 … … 452 460 void WaitForStmt::print( std::ostream &os, Indenter indent ) const { 453 461 os << "Waitfor Statement" << endl; 454 os << indent << "... with block:" << endl << indent+1; 455 // block->print( os, indent + 4 ); 462 indent += 1; 463 for( auto & clause : clauses ) { 464 os << indent << "target function :"; 465 if(clause.target.function) { clause.target.function->print(os, indent + 1); } 466 os << endl << indent << "with arguments :" << endl; 467 for( auto & thing : clause.target.arguments) { 468 if(thing) { thing->print(os, indent + 1); } 469 } 470 os << indent << " with statment :" << endl; 471 if(clause.statement) { clause.statement->print(os, indent + 1); } 472 473 os << indent << " with condition :" << endl; 474 if(clause.condition) { clause.condition->print(os, indent + 1); } 475 } 476 477 os << indent << " timeout of :" << endl; 478 if(timeout.time) { timeout.time->print(os, indent + 1); } 479 480 os << indent << " with statment :" << endl; 481 if(timeout.statement) { timeout.statement->print(os, indent + 1); } 482 483 os << indent << " with condition :" << endl; 484 if(timeout.condition) { timeout.condition->print(os, indent + 1); } 485 486 487 os << indent << " else :" << endl; 488 if(orelse.statement) { orelse.statement->print(os, indent + 1); } 489 490 os << indent << " with condition :" << endl; 491 if(orelse.condition) { orelse.condition->print(os, indent + 1); } 456 492 } 457 493 … … 468 504 void WithStmt::print( std::ostream & os, Indenter indent ) const { 469 505 os << "With statement" << endl; 506 os << indent << "... with expressions: " << endl; 507 printAll( exprs, os, indent+1 ); 470 508 os << indent << "... with statement:" << endl << indent+1; 471 509 stmt->print( os, indent+1 ); … … 476 514 } 477 515 478 void NullStmt::print( std::ostream &os, Indenter ) const {516 void NullStmt::print( std::ostream &os, Indenter indent ) const { 479 517 os << "Null Statement" << endl; 518 Statement::print( os, indent ); 480 519 } 481 520 -
src/SynTree/Statement.h
rf9feab8 r90152a4 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Sep 3 20:46:46 201713 // Update Count : 7 712 // Last Modified On : Thu Mar 8 14:53:02 2018 13 // Update Count : 78 14 14 // 15 15 … … 126 126 }; 127 127 128 class DirectiveStmt : public Statement { 129 public: 130 std::string directive; 131 132 DirectiveStmt( const std::string & ); 133 virtual ~DirectiveStmt(){} 134 135 virtual DirectiveStmt * clone() const { return new DirectiveStmt( *this ); } 136 virtual void accept( Visitor & v ) { v.visit( this ); } 137 virtual Statement * acceptMutator( Mutator & m ) { return m.mutate( this ); } 138 virtual void print( std::ostream & os, Indenter indent = {} ) const; 139 }; 140 128 141 class IfStmt : public Statement { 129 142 public: … … 179 192 std::list<Statement *> stmts; 180 193 181 CaseStmt( Expression *conditions, const std::list<Statement *> &stmts, bool isdef = false ) throw (SemanticError);194 CaseStmt( Expression *conditions, const std::list<Statement *> &stmts, bool isdef = false ) throw (SemanticErrorException); 182 195 CaseStmt( const CaseStmt &other ); 183 196 virtual ~CaseStmt(); … … 207 220 Expression *condition; 208 221 Statement *body; 222 std::list<Statement *> initialization; 209 223 bool isDoWhile; 210 224 211 225 WhileStmt( Expression *condition, 212 Statement *body, bool isDoWhile = false );226 Statement *body, std::list<Statement *> & initialization, bool isDoWhile = false ); 213 227 WhileStmt( const WhileStmt &other ); 214 228 virtual ~WhileStmt(); … … 255 269 class BranchStmt : public Statement { 256 270 public: 257 enum Type { Goto = 0, Break, Continue };271 enum Type { Goto = 0, Break, Continue, FallThrough, FallThroughDefault }; 258 272 259 273 // originalTarget kept for error messages. … … 263 277 Type type; 264 278 265 BranchStmt( Label target, Type ) throw (SemanticError );266 BranchStmt( Expression *computedTarget, Type ) throw (SemanticError );279 BranchStmt( Label target, Type ) throw (SemanticErrorException); 280 BranchStmt( Expression *computedTarget, Type ) throw (SemanticErrorException); 267 281 268 282 Label get_originalTarget() { return originalTarget; } -
src/SynTree/SynTree.h
rf9feab8 r90152a4 38 38 class TypedefDecl; 39 39 class AsmDecl; 40 class StaticAssertDecl; 40 41 41 42 class Statement; … … 43 44 class ExprStmt; 44 45 class AsmStmt; 46 class DirectiveStmt; 45 47 class IfStmt; 46 48 class WhileStmt; … … 68 70 class LabelAddressExpr; 69 71 class CastExpr; 72 class KeywordCastExpr; 70 73 class VirtualCastExpr; 71 74 class MemberExpr; … … 97 100 class UntypedInitExpr; 98 101 class InitExpr; 102 class DeletedExpr; 103 class DefaultArgExpr; 104 class GenericExpr; 99 105 100 106 class Type; … … 104 110 class ArrayType; 105 111 class ReferenceType; 112 class QualifiedType; 106 113 class FunctionType; 107 114 class ReferenceToType; … … 117 124 class ZeroType; 118 125 class OneType; 126 class GlobalScopeType; 119 127 120 128 class Designation; -
src/SynTree/Type.cc
rf9feab8 r90152a4 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 25 15:16:32 201713 // Update Count : 3 812 // Last Modified On : Fri Jun 22 10:17:19 2018 13 // Update Count : 39 14 14 // 15 15 #include "Type.h" 16 16 17 #include "Attribute.h" // for Attribute 18 #include "Common/utility.h" // for cloneAll, deleteAll, printAll 19 #include "InitTweak/InitTweak.h" // for getPointerBase 20 #include "SynTree/BaseSyntaxNode.h" // for BaseSyntaxNode 21 #include "SynTree/Declaration.h" // for TypeDecl 17 #include "Attribute.h" // for Attribute 18 #include "Common/utility.h" // for cloneAll, deleteAll, printAll 19 #include "InitTweak/InitTweak.h" // for getPointerBase 20 #include "SynTree/BaseSyntaxNode.h" // for BaseSyntaxNode 21 #include "SynTree/Declaration.h" // for TypeDecl 22 #include "SynTree/TypeSubstitution.h" // for TypeSubstitution 22 23 23 24 using namespace std; 24 25 25 const char *BasicType::typeNames[ BasicType::NUMBER_OF_BASIC_TYPES] = {26 const char *BasicType::typeNames[] = { 26 27 "_Bool", 27 28 "char", … … 47 48 "__int128", 48 49 "unsigned __int128", 50 "__float80", 51 "__float128" 49 52 }; 53 static_assert( 54 sizeof(BasicType::typeNames)/sizeof(BasicType::typeNames[0]) == BasicType::NUMBER_OF_BASIC_TYPES, 55 "Each basic type name should have a corresponding kind enum value" 56 ); 50 57 51 58 Type::Type( const Qualifiers &tq, const std::list< Attribute * > & attributes ) : tq( tq ), attributes( attributes ) {} … … 62 69 63 70 // These must remain in the same order as the corresponding bit fields. 64 const char * Type::FuncSpecifiersNames[] = { "inline", " fortran", "_Noreturn" };71 const char * Type::FuncSpecifiersNames[] = { "inline", "_Noreturn", "fortran" }; 65 72 const char * Type::StorageClassesNames[] = { "extern", "static", "auto", "register", "_Thread_local" }; 66 73 const char * Type::QualifiersNames[] = { "const", "restrict", "volatile", "lvalue", "mutex", "_Atomic" }; … … 81 88 int Type::referenceDepth() const { return 0; } 82 89 90 TypeSubstitution Type::genericSubstitution() const { assertf( false, "Non-aggregate type: %s", toCString( this ) ); } 91 83 92 void Type::print( std::ostream &os, Indenter indent ) const { 84 93 if ( ! forall.empty() ) { … … 96 105 } 97 106 107 108 QualifiedType::QualifiedType( const Type::Qualifiers & tq, Type * parent, Type * child ) : Type( tq, {} ), parent( parent ), child( child ) { 109 } 110 111 QualifiedType::QualifiedType( const QualifiedType & other ) : Type( other ), parent( maybeClone( other.parent ) ), child( maybeClone( other.child ) ) { 112 } 113 114 QualifiedType::~QualifiedType() { 115 delete parent; 116 delete child; 117 } 118 119 void QualifiedType::print( std::ostream & os, Indenter indent ) const { 120 os << "Qualified Type: " << endl; 121 os << indent+1; 122 parent->print( os, indent+1 ); 123 os << endl << indent+1; 124 child->print( os, indent+1 ); 125 os << endl; 126 Type::print( os, indent+1 ); 127 } 128 129 GlobalScopeType::GlobalScopeType() : Type( Type::Qualifiers(), {} ) {} 130 131 void GlobalScopeType::print( std::ostream & os, Indenter ) const { 132 os << "Global Scope Type" << endl; 133 } 134 135 98 136 // Empty Variable declarations: 99 137 const Type::FuncSpecifiers noFuncSpecifiers; -
src/SynTree/Type.h
rf9feab8 r90152a4 178 178 virtual bool isComplete() const { return true; } 179 179 180 virtual AggregateDecl * getAggr() { assertf( false, "Non-aggregate type: %s", toString( this ).c_str() ); } 180 virtual AggregateDecl * getAggr() const { assertf( false, "Non-aggregate type: %s", toCString( this ) ); } 181 182 virtual TypeSubstitution genericSubstitution() const; 181 183 182 184 virtual Type *clone() const = 0; … … 229 231 SignedInt128, 230 232 UnsignedInt128, 233 Float80, 234 Float128, 231 235 NUMBER_OF_BASIC_TYPES 232 236 } kind; … … 311 315 }; 312 316 317 class QualifiedType : public Type { 318 public: 319 Type * parent; 320 Type * child; 321 322 QualifiedType( const Type::Qualifiers & tq, Type * parent, Type * child ); 323 QualifiedType( const QualifiedType & tq ); 324 virtual ~QualifiedType(); 325 326 virtual QualifiedType *clone() const override { return new QualifiedType( *this ); } 327 virtual void accept( Visitor & v ) override { v.visit( this ); } 328 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 329 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 330 }; 331 313 332 class ReferenceType : public Type { 314 333 public: … … 328 347 // the number of values are disallowed. 329 348 virtual unsigned size() const override { return base->size(); } 349 350 virtual TypeSubstitution genericSubstitution() const override; 330 351 331 352 virtual ReferenceType *clone() const override { return new ReferenceType( *this ); } … … 356 377 bool isTtype() const; 357 378 379 bool isUnprototyped() const { return isVarArgs && parameters.size() == 0; } 380 358 381 virtual FunctionType *clone() const override { return new FunctionType( *this ); } 359 382 virtual void accept( Visitor & v ) override { v.visit( this ); } … … 404 427 /// Accesses generic parameters of base struct (NULL if none such) 405 428 std::list<TypeDecl*> * get_baseParameters(); 429 const std::list<TypeDecl*> * get_baseParameters() const; 406 430 407 431 virtual bool isComplete() const override; 408 432 409 virtual AggregateDecl * getAggr() override; 433 virtual AggregateDecl * getAggr() const override; 434 435 virtual TypeSubstitution genericSubstitution() const override; 410 436 411 437 /// Looks up the members of this struct named "name" and places them into "foundDecls". … … 437 463 438 464 /// Accesses generic parameters of base union (NULL if none such) 439 std::list< TypeDecl * > * get_baseParameters(); 465 std::list<TypeDecl*> * get_baseParameters(); 466 const std::list<TypeDecl*> * get_baseParameters() const; 440 467 441 468 virtual bool isComplete() const override; 442 469 443 virtual AggregateDecl * getAggr() override; 470 virtual AggregateDecl * getAggr() const override; 471 472 virtual TypeSubstitution genericSubstitution() const override; 444 473 445 474 /// looks up the members of this union named "name" and places them into "foundDecls" … … 471 500 472 501 virtual bool isComplete() const override; 502 503 virtual AggregateDecl * getAggr() const override; 473 504 474 505 virtual EnumInstType *clone() const override { return new EnumInstType( *this ); } … … 651 682 }; 652 683 684 class GlobalScopeType : public Type { 685 public: 686 GlobalScopeType(); 687 688 virtual GlobalScopeType *clone() const override { return new GlobalScopeType( *this ); } 689 virtual void accept( Visitor & v ) override { v.visit( this ); } 690 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 691 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 692 }; 693 653 694 // Local Variables: // 654 695 // tab-width: 4 // -
src/SynTree/TypeSubstitution.cc
rf9feab8 r90152a4 106 106 } 107 107 108 namespace { 109 struct EnvTrimmer { 110 TypeSubstitution * env, * newEnv; 111 EnvTrimmer( TypeSubstitution * env, TypeSubstitution * newEnv ) : env( env ), newEnv( newEnv ){} 112 void previsit( TypeDecl * tyDecl ) { 113 // transfer known bindings for seen type variables 114 if ( Type * t = env->lookup( tyDecl->name ) ) { 115 newEnv->add( tyDecl->name, t ); 116 } 117 } 118 }; 119 } // namespace 120 121 /// reduce environment to just the parts that are referenced in a given expression 122 TypeSubstitution * TypeSubstitution::newFromExpr( Expression * expr, TypeSubstitution * env ) { 123 if ( env ) { 124 TypeSubstitution * newEnv = new TypeSubstitution(); 125 PassVisitor<EnvTrimmer> trimmer( env, newEnv ); 126 expr->accept( trimmer ); 127 return newEnv; 128 } 129 return nullptr; 130 } 131 108 132 void TypeSubstitution::normalize() { 133 PassVisitor<Substituter> sub( *this, true ); 109 134 do { 110 sub Count = 0;111 freeOnly = true;135 sub.pass.subCount = 0; 136 sub.pass.freeOnly = true; 112 137 for ( TypeEnvType::iterator i = typeEnv.begin(); i != typeEnv.end(); ++i ) { 113 i->second = i->second->acceptMutator( *this);138 i->second = i->second->acceptMutator( sub ); 114 139 } 115 } while ( sub Count );116 } 117 118 Type * TypeSubstitution:: mutate( TypeInstType *inst ) {119 BoundVarsType::const_iterator bound = boundVars.find( inst-> get_name());140 } while ( sub.pass.subCount ); 141 } 142 143 Type * TypeSubstitution::Substituter::postmutate( TypeInstType *inst ) { 144 BoundVarsType::const_iterator bound = boundVars.find( inst->name ); 120 145 if ( bound != boundVars.end() ) return inst; 121 146 122 TypeEnvType::const_iterator i = typeEnv.find( inst->get_name() );123 if ( i == typeEnv.end() ) {147 TypeEnvType::const_iterator i = sub.typeEnv.find( inst->get_name() ); 148 if ( i == sub.typeEnv.end() ) { 124 149 return inst; 125 150 } else { 126 /// std::cout << "found " << inst->get_name() << ", replacing with "; 127 /// i->second->print( std::cout ); 128 /// std::cout << std::endl; 151 // cut off infinite loop for the case where a type is bound to itself. 152 // Note: this does not prevent cycles in the general case, so it may be necessary to do something more sophisticated here. 153 // TODO: investigate preventing type variables from being bound to themselves in the first place. 154 if ( TypeInstType * replacement = dynamic_cast< TypeInstType * >( i->second ) ) { 155 if ( inst->name == replacement->name ) { 156 return inst; 157 } 158 } 159 // std::cerr << "found " << inst->name << ", replacing with " << i->second << std::endl; 129 160 subCount++; 130 Type * newtype = i->second->clone();161 Type * newtype = i->second->clone(); 131 162 newtype->get_qualifiers() |= inst->get_qualifiers(); 132 163 delete inst; 133 return newtype; 134 } // if 135 } 136 137 Expression * TypeSubstitution::mutate( NameExpr *nameExpr ) { 138 VarEnvType::const_iterator i = varEnv.find( nameExpr->get_name() ); 139 if ( i == varEnv.end() ) { 164 // Note: need to recursively apply substitution to the new type because normalize does not substitute bound vars, but bound vars must be substituted when not in freeOnly mode. 165 return newtype->acceptMutator( *visitor ); 166 } // if 167 } 168 169 Expression * TypeSubstitution::Substituter::postmutate( NameExpr * nameExpr ) { 170 VarEnvType::const_iterator i = sub.varEnv.find( nameExpr->name ); 171 if ( i == sub.varEnv.end() ) { 140 172 return nameExpr; 141 173 } else { … … 146 178 } 147 179 148 template< typename TypeClass > 149 Type *TypeSubstitution::handleType( TypeClass *type ) { 150 ValueGuard<BoundVarsType> oldBoundVars( boundVars ); 180 void TypeSubstitution::Substituter::premutate( Type * type ) { 181 GuardValue( boundVars ); 151 182 // bind type variables from forall-qualifiers 152 183 if ( freeOnly ) { 153 for ( Type::ForallList::const_iterator tyvar = type-> get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {154 boundVars.insert( (*tyvar )->get_name());184 for ( Type::ForallList::const_iterator tyvar = type->forall.begin(); tyvar != type->forall.end(); ++tyvar ) { 185 boundVars.insert( (*tyvar)->name ); 155 186 } // for 156 187 } // if 157 Type *ret = Mutator::mutate( type );158 return ret;159 188 } 160 189 161 190 template< typename TypeClass > 162 Type *TypeSubstitution::handleAggregateType( TypeClass *type ) {163 ValueGuard<BoundVarsType> oldBoundVars( boundVars );191 void TypeSubstitution::Substituter::handleAggregateType( TypeClass * type ) { 192 GuardValue( boundVars ); 164 193 // bind type variables from forall-qualifiers 165 194 if ( freeOnly ) { 166 for ( Type::ForallList::const_iterator tyvar = type-> get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {167 boundVars.insert( (*tyvar )->get_name());195 for ( Type::ForallList::const_iterator tyvar = type->forall.begin(); tyvar != type->forall.end(); ++tyvar ) { 196 boundVars.insert( (*tyvar)->name ); 168 197 } // for 169 198 // bind type variables from generic type instantiations 170 199 std::list< TypeDecl* > *baseParameters = type->get_baseParameters(); 171 if ( baseParameters && ! type-> get_parameters().empty() ) {200 if ( baseParameters && ! type->parameters.empty() ) { 172 201 for ( std::list< TypeDecl* >::const_iterator tyvar = baseParameters->begin(); tyvar != baseParameters->end(); ++tyvar ) { 173 boundVars.insert( (*tyvar)-> get_name());202 boundVars.insert( (*tyvar)->name ); 174 203 } // for 175 204 } // if 176 205 } // if 177 Type *ret = Mutator::mutate( type ); 178 return ret; 179 } 180 181 Type * TypeSubstitution::mutate( VoidType *voidType ) { 182 return handleType( voidType ); 183 } 184 185 Type * TypeSubstitution::mutate( BasicType *basicType ) { 186 return handleType( basicType ); 187 } 188 189 Type * TypeSubstitution::mutate( PointerType *pointerType ) { 190 return handleType( pointerType ); 191 } 192 193 Type * TypeSubstitution::mutate( ArrayType *arrayType ) { 194 return handleType( arrayType ); 195 } 196 197 Type * TypeSubstitution::mutate( FunctionType *functionType ) { 198 return handleType( functionType ); 199 } 200 201 Type * TypeSubstitution::mutate( StructInstType *aggregateUseType ) { 202 return handleAggregateType( aggregateUseType ); 203 } 204 205 Type * TypeSubstitution::mutate( UnionInstType *aggregateUseType ) { 206 return handleAggregateType( aggregateUseType ); 207 } 208 209 Type * TypeSubstitution::mutate( EnumInstType *aggregateUseType ) { 210 return handleType( aggregateUseType ); 211 } 212 213 Type * TypeSubstitution::mutate( TraitInstType *aggregateUseType ) { 214 return handleType( aggregateUseType ); 215 } 216 217 Type * TypeSubstitution::mutate( TupleType *tupleType ) { 218 return handleType( tupleType ); 219 } 220 221 Type * TypeSubstitution::mutate( VarArgsType *varArgsType ) { 222 return handleType( varArgsType ); 223 } 224 225 Type * TypeSubstitution::mutate( ZeroType *zeroType ) { 226 return handleType( zeroType ); 227 } 228 229 Type * TypeSubstitution::mutate( OneType *oneType ) { 230 return handleType( oneType ); 206 } 207 208 void TypeSubstitution::Substituter::premutate( StructInstType * aggregateUseType ) { 209 handleAggregateType( aggregateUseType ); 210 } 211 212 void TypeSubstitution::Substituter::premutate( UnionInstType *aggregateUseType ) { 213 handleAggregateType( aggregateUseType ); 231 214 } 232 215 -
src/SynTree/TypeSubstitution.h
rf9feab8 r90152a4 27 27 #include "SynTree/Declaration.h" // for TypeDecl, Declaration (ptr only) 28 28 #include "SynTree/Expression.h" // for Expression (ptr only), NameExpr (p... 29 #include "SynTree/Mutator.h" // for Mutator30 29 #include "SynTree/Type.h" // for Type, ArrayType (ptr only), BasicT... 31 30 32 class TypeSubstitution : public Mutator { 33 typedef Mutator Parent; 31 class TypeSubstitution { 34 32 public: 35 33 TypeSubstitution(); … … 57 55 void extract( TypeInstListIterator begin, TypeInstListIterator end, TypeSubstitution &result ); 58 56 57 /// create a new TypeSubstitution using bindings from env containing all of the type variables in expr 58 static TypeSubstitution * newFromExpr( Expression * expr, TypeSubstitution * env ); 59 59 60 void normalize(); 60 61 … … 64 65 TypeSubstitution *clone() const { return new TypeSubstitution( *this ); } 65 66 private: 66 virtual Type* mutate(TypeInstType *aggregateUseType); 67 virtual Expression* mutate(NameExpr *nameExpr); 68 69 /// Records type variable bindings from forall-statements 70 template< typename TypeClass > Type *handleType( TypeClass *type ); 71 /// Records type variable bindings from forall-statements and instantiations of generic types 72 template< typename TypeClass > Type *handleAggregateType( TypeClass *type ); 73 74 virtual Type* mutate(VoidType *basicType); 75 virtual Type* mutate(BasicType *basicType); 76 virtual Type* mutate(PointerType *pointerType); 77 virtual Type* mutate(ArrayType *arrayType); 78 virtual Type* mutate(FunctionType *functionType); 79 virtual Type* mutate(StructInstType *aggregateUseType); 80 virtual Type* mutate(UnionInstType *aggregateUseType); 81 virtual Type* mutate(EnumInstType *aggregateUseType); 82 virtual Type* mutate(TraitInstType *aggregateUseType); 83 virtual Type* mutate(TupleType *tupleType); 84 virtual Type* mutate(VarArgsType *varArgsType); 85 virtual Type* mutate(ZeroType *zeroType); 86 virtual Type* mutate(OneType *oneType); 67 68 // Mutator that performs the substitution 69 struct Substituter; 87 70 88 71 // TODO: worry about traversing into a forall-qualified function type or type decl with assertions … … 97 80 typedef std::map< std::string, Type* > TypeEnvType; 98 81 typedef std::map< std::string, Expression* > VarEnvType; 99 typedef std::set< std::string > BoundVarsType;100 82 TypeEnvType typeEnv; 101 83 VarEnvType varEnv; 102 BoundVarsType boundVars; 103 int subCount; 104 bool freeOnly; 84 85 public: 86 // has to come after declaration of typeEnv 87 auto begin() -> decltype( typeEnv.begin() ) { return typeEnv.begin(); } 88 auto end() -> decltype( typeEnv. end() ) { return typeEnv. end(); } 89 auto begin() const -> decltype( typeEnv.begin() ) { return typeEnv.begin(); } 90 auto end() const -> decltype( typeEnv. end() ) { return typeEnv. end(); } 105 91 }; 106 92 … … 122 108 } // if 123 109 } else { 124 throw SemanticError( toString( "Attempt to provide non-type parameter: ", toString( *actualIt ).c_str(), " for type parameter " ), formal);110 SemanticError( formal, toString( "Attempt to provide non-type parameter: ", toString( *actualIt ).c_str(), " for type parameter " ) ); 125 111 } // if 126 112 } else { … … 134 120 135 121 template< typename FormalIterator, typename ActualIterator > 136 TypeSubstitution::TypeSubstitution( FormalIterator formalBegin, FormalIterator formalEnd, ActualIterator actualBegin ) 137 { 122 TypeSubstitution::TypeSubstitution( FormalIterator formalBegin, FormalIterator formalEnd, ActualIterator actualBegin ) { 138 123 add( formalBegin, formalEnd, actualBegin ); 139 124 } 125 126 // include needs to happen after TypeSubstitution is defined so that both TypeSubstitution and 127 // PassVisitor are defined before PassVisitor implementation accesses TypeSubstitution internals. 128 #include "Common/PassVisitor.h" 129 130 // definitition must happen after PassVisitor is included so that WithGuards can be used 131 struct TypeSubstitution::Substituter : public WithGuards, public WithVisitorRef<Substituter> { 132 Substituter( TypeSubstitution & sub, bool freeOnly ) : sub( sub ), freeOnly( freeOnly ) {} 133 134 Type * postmutate( TypeInstType * aggregateUseType ); 135 Expression * postmutate( NameExpr * nameExpr ); 136 137 /// Records type variable bindings from forall-statements 138 void premutate( Type * type ); 139 /// Records type variable bindings from forall-statements and instantiations of generic types 140 template< typename TypeClass > void handleAggregateType( TypeClass * type ); 141 142 void premutate( StructInstType * aggregateUseType ); 143 void premutate( UnionInstType * aggregateUseType ); 144 145 TypeSubstitution & sub; 146 int subCount = 0; 147 bool freeOnly; 148 typedef std::set< std::string > BoundVarsType; 149 BoundVarsType boundVars; 150 }; 140 151 141 152 template< typename SynTreeClass > 142 153 int TypeSubstitution::apply( SynTreeClass *&input ) { 143 154 assert( input ); 144 subCount = 0; 145 freeOnly = false; 146 input = dynamic_cast< SynTreeClass *>( input->acceptMutator( *this ) ); 147 assert( input ); 148 /// std::cout << "substitution result is: "; 149 /// newType->print( std::cout ); 150 /// std::cout << std::endl; 151 return subCount; 155 PassVisitor<Substituter> sub( *this, false ); 156 input = dynamic_cast< SynTreeClass * >( input->acceptMutator( sub ) ); 157 assert( input ); 158 /// std::cerr << "substitution result is: "; 159 /// newType->print( std::cerr ); 160 /// std::cerr << std::endl; 161 return sub.pass.subCount; 152 162 } 153 163 … … 155 165 int TypeSubstitution::applyFree( SynTreeClass *&input ) { 156 166 assert( input ); 157 subCount = 0; 158 freeOnly = true; 159 input = dynamic_cast< SynTreeClass *>( input->acceptMutator( *this ) ); 160 assert( input ); 161 /// std::cout << "substitution result is: "; 162 /// newType->print( std::cout ); 163 /// std::cout << std::endl; 164 return subCount; 167 PassVisitor<Substituter> sub( *this, true ); 168 input = dynamic_cast< SynTreeClass * >( input->acceptMutator( sub ) ); 169 assert( input ); 170 /// std::cerr << "substitution result is: "; 171 /// newType->print( std::cerr ); 172 /// std::cerr << std::endl; 173 return sub.pass.subCount; 165 174 } 166 175 -
src/SynTree/Visitor.h
rf9feab8 r90152a4 21 21 class Visitor { 22 22 protected: 23 Visitor() ;24 virtual ~Visitor() ;23 Visitor() = default; 24 virtual ~Visitor() = default; 25 25 public: 26 26 // visit: Default implementation of all functions visits the children 27 27 // of the given syntax node, but performs no other action. 28 28 29 virtual void visit( ObjectDecl * objectDecl ); 30 virtual void visit( FunctionDecl * functionDecl ); 31 virtual void visit( StructDecl * aggregateDecl ); 32 virtual void visit( UnionDecl * aggregateDecl ); 33 virtual void visit( EnumDecl * aggregateDecl ); 34 virtual void visit( TraitDecl * aggregateDecl ); 35 virtual void visit( TypeDecl * typeDecl ); 36 virtual void visit( TypedefDecl * typeDecl ); 37 virtual void visit( AsmDecl * asmDecl ); 29 virtual void visit( ObjectDecl * objectDecl ) = 0; 30 virtual void visit( FunctionDecl * functionDecl ) = 0; 31 virtual void visit( StructDecl * aggregateDecl ) = 0; 32 virtual void visit( UnionDecl * aggregateDecl ) = 0; 33 virtual void visit( EnumDecl * aggregateDecl ) = 0; 34 virtual void visit( TraitDecl * aggregateDecl ) = 0; 35 virtual void visit( TypeDecl * typeDecl ) = 0; 36 virtual void visit( TypedefDecl * typeDecl ) = 0; 37 virtual void visit( AsmDecl * asmDecl ) = 0; 38 virtual void visit( StaticAssertDecl * assertDecl ) = 0; 38 39 39 virtual void visit( CompoundStmt * compoundStmt ); 40 virtual void visit( ExprStmt * exprStmt ); 41 virtual void visit( AsmStmt * asmStmt ); 42 virtual void visit( IfStmt * ifStmt ); 43 virtual void visit( WhileStmt * whileStmt ); 44 virtual void visit( ForStmt * forStmt ); 45 virtual void visit( SwitchStmt * switchStmt ); 46 virtual void visit( CaseStmt * caseStmt ); 47 virtual void visit( BranchStmt * branchStmt ); 48 virtual void visit( ReturnStmt * returnStmt ); 49 virtual void visit( ThrowStmt * throwStmt ); 50 virtual void visit( TryStmt * tryStmt ); 51 virtual void visit( CatchStmt * catchStmt ); 52 virtual void visit( FinallyStmt * finallyStmt ); 53 virtual void visit( WaitForStmt * waitforStmt ); 54 virtual void visit( WithStmt * withStmt ); 55 virtual void visit( NullStmt * nullStmt ); 56 virtual void visit( DeclStmt * declStmt ); 57 virtual void visit( ImplicitCtorDtorStmt * impCtorDtorStmt ); 40 virtual void visit( CompoundStmt * compoundStmt ) = 0; 41 virtual void visit( ExprStmt * exprStmt ) = 0; 42 virtual void visit( AsmStmt * asmStmt ) = 0; 43 virtual void visit( DirectiveStmt * directiveStmt ) = 0; 44 virtual void visit( IfStmt * ifStmt ) = 0; 45 virtual void visit( WhileStmt * whileStmt ) = 0; 46 virtual void visit( ForStmt * forStmt ) = 0; 47 virtual void visit( SwitchStmt * switchStmt ) = 0; 48 virtual void visit( CaseStmt * caseStmt ) = 0; 49 virtual void visit( BranchStmt * branchStmt ) = 0; 50 virtual void visit( ReturnStmt * returnStmt ) = 0; 51 virtual void visit( ThrowStmt * throwStmt ) = 0; 52 virtual void visit( TryStmt * tryStmt ) = 0; 53 virtual void visit( CatchStmt * catchStmt ) = 0; 54 virtual void visit( FinallyStmt * finallyStmt ) = 0; 55 virtual void visit( WaitForStmt * waitforStmt ) = 0; 56 virtual void visit( WithStmt * withStmt ) = 0; 57 virtual void visit( NullStmt * nullStmt ) = 0; 58 virtual void visit( DeclStmt * declStmt ) = 0; 59 virtual void visit( ImplicitCtorDtorStmt * impCtorDtorStmt ) = 0; 58 60 59 virtual void visit( ApplicationExpr * applicationExpr ); 60 virtual void visit( UntypedExpr * untypedExpr ); 61 virtual void visit( NameExpr * nameExpr ); 62 virtual void visit( CastExpr * castExpr ); 63 virtual void visit( VirtualCastExpr * castExpr ); 64 virtual void visit( AddressExpr * addressExpr ); 65 virtual void visit( LabelAddressExpr * labAddressExpr ); 66 virtual void visit( UntypedMemberExpr * memberExpr ); 67 virtual void visit( MemberExpr * memberExpr ); 68 virtual void visit( VariableExpr * variableExpr ); 69 virtual void visit( ConstantExpr * constantExpr ); 70 virtual void visit( SizeofExpr * sizeofExpr ); 71 virtual void visit( AlignofExpr * alignofExpr ); 72 virtual void visit( UntypedOffsetofExpr * offsetofExpr ); 73 virtual void visit( OffsetofExpr * offsetofExpr ); 74 virtual void visit( OffsetPackExpr * offsetPackExpr ); 75 virtual void visit( AttrExpr * attrExpr ); 76 virtual void visit( LogicalExpr * logicalExpr ); 77 virtual void visit( ConditionalExpr * conditionalExpr ); 78 virtual void visit( CommaExpr * commaExpr ); 79 virtual void visit( TypeExpr * typeExpr ); 80 virtual void visit( AsmExpr * asmExpr ); 81 virtual void visit( ImplicitCopyCtorExpr * impCpCtorExpr ); 82 virtual void visit( ConstructorExpr * ctorExpr ); 83 virtual void visit( CompoundLiteralExpr * compLitExpr ); 84 virtual void visit( RangeExpr * rangeExpr ); 85 virtual void visit( UntypedTupleExpr * tupleExpr ); 86 virtual void visit( TupleExpr * tupleExpr ); 87 virtual void visit( TupleIndexExpr * tupleExpr ); 88 virtual void visit( TupleAssignExpr * assignExpr ); 89 virtual void visit( StmtExpr * stmtExpr ); 90 virtual void visit( UniqueExpr * uniqueExpr ); 91 virtual void visit( UntypedInitExpr * initExpr ); 92 virtual void visit( InitExpr * initExpr ); 61 virtual void visit( ApplicationExpr * applicationExpr ) = 0; 62 virtual void visit( UntypedExpr * untypedExpr ) = 0; 63 virtual void visit( NameExpr * nameExpr ) = 0; 64 virtual void visit( CastExpr * castExpr ) = 0; 65 virtual void visit( KeywordCastExpr * castExpr ) = 0; 66 virtual void visit( VirtualCastExpr * castExpr ) = 0; 67 virtual void visit( AddressExpr * addressExpr ) = 0; 68 virtual void visit( LabelAddressExpr * labAddressExpr ) = 0; 69 virtual void visit( UntypedMemberExpr * memberExpr ) = 0; 70 virtual void visit( MemberExpr * memberExpr ) = 0; 71 virtual void visit( VariableExpr * variableExpr ) = 0; 72 virtual void visit( ConstantExpr * constantExpr ) = 0; 73 virtual void visit( SizeofExpr * sizeofExpr ) = 0; 74 virtual void visit( AlignofExpr * alignofExpr ) = 0; 75 virtual void visit( UntypedOffsetofExpr * offsetofExpr ) = 0; 76 virtual void visit( OffsetofExpr * offsetofExpr ) = 0; 77 virtual void visit( OffsetPackExpr * offsetPackExpr ) = 0; 78 virtual void visit( AttrExpr * attrExpr ) = 0; 79 virtual void visit( LogicalExpr * logicalExpr ) = 0; 80 virtual void visit( ConditionalExpr * conditionalExpr ) = 0; 81 virtual void visit( CommaExpr * commaExpr ) = 0; 82 virtual void visit( TypeExpr * typeExpr ) = 0; 83 virtual void visit( AsmExpr * asmExpr ) = 0; 84 virtual void visit( ImplicitCopyCtorExpr * impCpCtorExpr ) = 0; 85 virtual void visit( ConstructorExpr * ctorExpr ) = 0; 86 virtual void visit( CompoundLiteralExpr * compLitExpr ) = 0; 87 virtual void visit( RangeExpr * rangeExpr ) = 0; 88 virtual void visit( UntypedTupleExpr * tupleExpr ) = 0; 89 virtual void visit( TupleExpr * tupleExpr ) = 0; 90 virtual void visit( TupleIndexExpr * tupleExpr ) = 0; 91 virtual void visit( TupleAssignExpr * assignExpr ) = 0; 92 virtual void visit( StmtExpr * stmtExpr ) = 0; 93 virtual void visit( UniqueExpr * uniqueExpr ) = 0; 94 virtual void visit( UntypedInitExpr * initExpr ) = 0; 95 virtual void visit( InitExpr * initExpr ) = 0; 96 virtual void visit( DeletedExpr * delExpr ) = 0; 97 virtual void visit( DefaultArgExpr * argExpr ) = 0; 98 virtual void visit( GenericExpr * genExpr ) = 0; 93 99 94 virtual void visit( VoidType * basicType ); 95 virtual void visit( BasicType * basicType ); 96 virtual void visit( PointerType * pointerType ); 97 virtual void visit( ArrayType * arrayType ); 98 virtual void visit( ReferenceType * refType ); 99 virtual void visit( FunctionType * functionType ); 100 virtual void visit( StructInstType * aggregateUseType ); 101 virtual void visit( UnionInstType * aggregateUseType ); 102 virtual void visit( EnumInstType * aggregateUseType ); 103 virtual void visit( TraitInstType * aggregateUseType ); 104 virtual void visit( TypeInstType * aggregateUseType ); 105 virtual void visit( TupleType * tupleType ); 106 virtual void visit( TypeofType * typeofType ); 107 virtual void visit( AttrType * attrType ); 108 virtual void visit( VarArgsType * varArgsType ); 109 virtual void visit( ZeroType * zeroType ); 110 virtual void visit( OneType * oneType ); 100 virtual void visit( VoidType * basicType ) = 0; 101 virtual void visit( BasicType * basicType ) = 0; 102 virtual void visit( PointerType * pointerType ) = 0; 103 virtual void visit( ArrayType * arrayType ) = 0; 104 virtual void visit( ReferenceType * refType ) = 0; 105 virtual void visit( QualifiedType * qualType ) = 0; 106 virtual void visit( FunctionType * functionType ) = 0; 107 virtual void visit( StructInstType * aggregateUseType ) = 0; 108 virtual void visit( UnionInstType * aggregateUseType ) = 0; 109 virtual void visit( EnumInstType * aggregateUseType ) = 0; 110 virtual void visit( TraitInstType * aggregateUseType ) = 0; 111 virtual void visit( TypeInstType * aggregateUseType ) = 0; 112 virtual void visit( TupleType * tupleType ) = 0; 113 virtual void visit( TypeofType * typeofType ) = 0; 114 virtual void visit( AttrType * attrType ) = 0; 115 virtual void visit( VarArgsType * varArgsType ) = 0; 116 virtual void visit( ZeroType * zeroType ) = 0; 117 virtual void visit( OneType * oneType ) = 0; 118 virtual void visit( GlobalScopeType * globalType ) = 0; 111 119 112 virtual void visit( Designation * designation ) ;113 virtual void visit( SingleInit * singleInit ) ;114 virtual void visit( ListInit * listInit ) ;115 virtual void visit( ConstructorInit * ctorInit ) ;120 virtual void visit( Designation * designation ) = 0; 121 virtual void visit( SingleInit * singleInit ) = 0; 122 virtual void visit( ListInit * listInit ) = 0; 123 virtual void visit( ConstructorInit * ctorInit ) = 0; 116 124 117 virtual void visit( Subrange * subrange ) ;125 virtual void visit( Subrange * subrange ) = 0; 118 126 119 virtual void visit( Constant * constant ) ;127 virtual void visit( Constant * constant ) = 0; 120 128 121 virtual void visit( Attribute * attribute ); 122 private: 123 virtual void handleAggregateDecl( AggregateDecl *aggregateDecl ); 124 virtual void handleNamedTypeDecl( NamedTypeDecl *typeDecl ); 125 virtual void handleReferenceToType( ReferenceToType *aggregateUseType ); 129 virtual void visit( Attribute * attribute ) = 0; 126 130 }; 127 131 … … 135 139 template< typename Container, typename VisitorType > 136 140 inline void acceptAll( Container &container, VisitorType &visitor ) { 137 SemanticError errors;141 SemanticErrorException errors; 138 142 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) { 139 143 try { … … 141 145 (*i)->accept( visitor ); 142 146 } 143 } catch( SemanticError &e ) { 144 e.set_location( (*i)->location ); 147 } catch( SemanticErrorException &e ) { 145 148 errors.append( e ); 146 149 } -
src/SynTree/module.mk
rf9feab8 r90152a4 46 46 SynTree/TypeDecl.cc \ 47 47 SynTree/Initializer.cc \ 48 SynTree/Visitor.cc \49 SynTree/Mutator.cc \50 48 SynTree/TypeSubstitution.cc \ 51 49 SynTree/Attribute.cc \ 52 SynTree/ VarExprReplacer.cc50 SynTree/DeclReplacer.cc 53 51 -
src/Tuples/Explode.h
rf9feab8 r90152a4 43 43 /// Append alternative to an OutputIterator of Alternatives 44 44 template<typename OutputIterator> 45 void append( OutputIterator out, Expression* expr, const ResolvExpr::TypeEnvironment& env, 45 void append( OutputIterator out, Expression* expr, const ResolvExpr::TypeEnvironment& env, 46 46 const ResolvExpr::Cost& cost, const ResolvExpr::Cost& cvtCost ) { 47 47 *out++ = ResolvExpr::Alternative{ expr, env, cost, cvtCost }; … … 49 49 50 50 /// Append alternative to an ExplodedActual 51 static inline void append( ResolvExpr::ExplodedActual& ea, Expression* expr, 51 static inline void append( ResolvExpr::ExplodedActual& ea, Expression* expr, 52 52 const ResolvExpr::TypeEnvironment&, const ResolvExpr::Cost&, const ResolvExpr::Cost& ) { 53 53 ea.exprs.emplace_back( expr ); … … 57 57 /// helper function used by explode 58 58 template< typename Output > 59 void explodeUnique( Expression * expr, const ResolvExpr::Alternative & alt, 59 void explodeUnique( Expression * expr, const ResolvExpr::Alternative & alt, 60 60 const SymTab::Indexer & indexer, Output&& out, bool isTupleAssign ) { 61 61 if ( isTupleAssign ) { … … 63 63 if ( CastExpr * castExpr = isReferenceCast( expr ) ) { 64 64 ResolvExpr::AltList alts; 65 explodeUnique( 65 explodeUnique( 66 66 castExpr->get_arg(), alt, indexer, back_inserter( alts ), isTupleAssign ); 67 67 for ( ResolvExpr::Alternative & alt : alts ) { 68 68 // distribute reference cast over all components 69 append( std::forward<Output>(out), distributeReference( alt.release_expr() ), 69 append( std::forward<Output>(out), distributeReference( alt.release_expr() ), 70 70 alt.env, alt.cost, alt.cvtCost ); 71 71 } … … 108 108 /// expands a tuple-valued alternative into multiple alternatives, each with a non-tuple-type 109 109 template< typename Output > 110 void explode( const ResolvExpr::Alternative &alt, const SymTab::Indexer & indexer, 110 void explode( const ResolvExpr::Alternative &alt, const SymTab::Indexer & indexer, 111 111 Output&& out, bool isTupleAssign = false ) { 112 112 explodeUnique( alt.expr, alt, indexer, std::forward<Output>(out), isTupleAssign ); … … 115 115 // explode list of alternatives 116 116 template< typename AltIterator, typename Output > 117 void explode( AltIterator altBegin, AltIterator altEnd, const SymTab::Indexer & indexer, 117 void explode( AltIterator altBegin, AltIterator altEnd, const SymTab::Indexer & indexer, 118 118 Output&& out, bool isTupleAssign = false ) { 119 119 for ( ; altBegin != altEnd; ++altBegin ) { … … 123 123 124 124 template< typename Output > 125 void explode( const ResolvExpr::AltList & alts, const SymTab::Indexer & indexer, Output&& out, 125 void explode( const ResolvExpr::AltList & alts, const SymTab::Indexer & indexer, Output&& out, 126 126 bool isTupleAssign = false ) { 127 127 explode( alts.begin(), alts.end(), indexer, std::forward<Output>(out), isTupleAssign ); -
src/Tuples/TupleAssignment.cc
rf9feab8 r90152a4 154 154 lhsAlt.expr = new CastExpr( lhsAlt.expr, 155 155 new ReferenceType( Type::Qualifiers(), 156 lhsAlt.expr-> get_result()->clone() ) );156 lhsAlt.expr->result->clone() ) ); 157 157 } 158 158 … … 231 231 232 232 ResolvExpr::AlternativeFinder finder{ currentFinder.get_indexer(), 233 currentFinder.get_environ() }; 233 matcher->compositeEnv }; 234 234 235 try { 235 236 finder.findWithAdjustment(*i); … … 272 273 // args.push_back( new AddressExpr( new VariableExpr( left ) ) ); 273 274 if ( right ) args.push_back( new VariableExpr( right ) ); 274 return new UntypedExpr( new NameExpr( fname ), args ); 275 } 276 277 // removes environments from subexpressions within statement exprs, which could throw off later passes like those in Box which rely on PolyMutator. 275 if ( left->type->referenceDepth() > 1 && CodeGen::isConstructor( fname ) ) { 276 args.front() = new AddressExpr( args.front() ); 277 if ( right ) args.back() = new AddressExpr( args.back() ); 278 return new UntypedExpr( new NameExpr( "?=?" ), args ); 279 } else { 280 return new UntypedExpr( new NameExpr( fname ), args ); 281 } 282 } 283 284 // removes environments from subexpressions within statement exprs, which could throw off later passes like those in Box which rely on PolyMutator, and adds the bindings to the compositeEnv 278 285 // xxx - maybe this should happen in alternative finder for every StmtExpr? 279 // xxx - it's possible that these environments could contain some useful information. Maybe the right thing to do is aggregate the environments and pass the aggregate back to be added into the compositeEnv280 286 struct EnvRemover { 281 287 void previsit( ExprStmt * stmt ) { 282 delete stmt->expr->env; 283 stmt->expr->env = nullptr; 284 } 288 assert( compositeEnv ); 289 if ( stmt->expr->env ) { 290 compositeEnv->add( *stmt->expr->env ); 291 delete stmt->expr->env; 292 stmt->expr->env = nullptr; 293 } 294 } 295 296 ResolvExpr::TypeEnvironment * compositeEnv = nullptr; 285 297 }; 286 298 287 299 ObjectDecl * TupleAssignSpotter::Matcher::newObject( UniqueName & namer, Expression * expr ) { 288 300 assert( expr->result && ! expr->get_result()->isVoid() ); 289 ObjectDecl * ret = new ObjectDecl( namer.newName(), Type::StorageClasses(), LinkageSpec::Cforall, nullptr, expr-> get_result()->clone(), new SingleInit( expr->clone() ) );301 ObjectDecl * ret = new ObjectDecl( namer.newName(), Type::StorageClasses(), LinkageSpec::Cforall, nullptr, expr->result->clone(), new SingleInit( expr->clone() ) ); 290 302 // if expression type is a reference, don't need to construct anything, a simple initializer is sufficient. 291 if ( ! dynamic_cast< ReferenceType * >( expr-> get_result()) ) {303 if ( ! dynamic_cast< ReferenceType * >( expr->result ) ) { 292 304 ConstructorInit * ctorInit = InitTweak::genCtorInit( ret ); 293 ret-> set_init( ctorInit );305 ret->init = ctorInit; 294 306 ResolvExpr::resolveCtorInit( ctorInit, spotter.currentFinder.get_indexer() ); // resolve ctor/dtors for the new object 295 307 PassVisitor<EnvRemover> rm; // remove environments from subexpressions of StmtExprs 308 rm.pass.compositeEnv = &compositeEnv; 296 309 ctorInit->accept( rm ); 297 310 } … … 306 319 assert( (! lhs.empty() && rhs.size() <= 1) || (lhs.empty() && rhs.empty()) ); 307 320 321 // xxx - may need to split this up into multiple declarations, because potential conversion to references 322 // probably should not reference local variable - see MultipleAssignMatcher::match 308 323 ObjectDecl * rtmp = rhs.size() == 1 ? newObject( rhsNamer, rhs.front().expr ) : nullptr; 309 324 for ( ResolvExpr::Alternative & lhsAlt : lhs ) { … … 324 339 std::list< ObjectDecl * > ltmp; 325 340 std::list< ObjectDecl * > rtmp; 326 std::transform( lhs.begin(), lhs.end(), back_inserter( ltmp ), [&]( ResolvExpr::Alternative & alt ){ 327 return newObject( lhsNamer, alt.expr ); 328 }); 329 std::transform( rhs.begin(), rhs.end(), back_inserter( rtmp ), [&]( ResolvExpr::Alternative & alt ){ 330 return newObject( rhsNamer, alt.expr ); 331 }); 332 zipWith( ltmp.begin(), ltmp.end(), rtmp.begin(), rtmp.end(), back_inserter(out), [&](ObjectDecl * obj1, ObjectDecl * obj2 ) { return createFunc(spotter.fname, obj1, obj2); } ); 341 for ( auto p : group_iterate( lhs, rhs ) ) { 342 ResolvExpr::Alternative & lhsAlt = std::get<0>(p); 343 ResolvExpr::Alternative & rhsAlt = std::get<1>(p); 344 // convert RHS to LHS type minus one reference -- important for the case where LHS is && and RHS is lvalue, etc. 345 ReferenceType * lhsType = strict_dynamic_cast<ReferenceType *>( lhsAlt.expr->result ); 346 rhsAlt.expr = new CastExpr( rhsAlt.expr, lhsType->base->clone() ); 347 ObjectDecl * lobj = newObject( lhsNamer, lhsAlt.expr ); 348 ObjectDecl * robj = newObject( rhsNamer, rhsAlt.expr ); 349 out.push_back( createFunc(spotter.fname, lobj, robj) ); 350 ltmp.push_back( lobj ); 351 rtmp.push_back( robj ); 352 353 // resolve the cast expression so that rhsAlt return type is bound by the cast type as needed, and transfer the resulting environment 354 ResolvExpr::AlternativeFinder finder{ spotter.currentFinder.get_indexer(), compositeEnv }; 355 finder.findWithAdjustment( rhsAlt.expr ); 356 assert( finder.get_alternatives().size() == 1 ); 357 compositeEnv = std::move( finder.get_alternatives().front().env ); 358 } 333 359 tmpDecls.splice( tmpDecls.end(), ltmp ); 334 360 tmpDecls.splice( tmpDecls.end(), rtmp ); -
src/Tuples/TupleExpansion.cc
rf9feab8 r90152a4 30 30 #include "SynTree/Type.h" // for Type, Type::Qualifiers, TupleType 31 31 #include "SynTree/Visitor.h" // for Visitor 32 #include "Tuples.h" 32 33 33 34 class CompoundStmt; … … 36 37 namespace Tuples { 37 38 namespace { 38 struct MemberTupleExpander final : public Mutator { 39 typedef Mutator Parent; 40 using Parent::mutate; 41 42 virtual Expression * mutate( UntypedMemberExpr * memberExpr ) override; 39 struct MemberTupleExpander final : public WithShortCircuiting, public WithVisitorRef<MemberTupleExpander> { 40 void premutate( UntypedMemberExpr * ) { visit_children = false; } 41 Expression * postmutate( UntypedMemberExpr * memberExpr ); 43 42 }; 44 43 … … 79 78 80 79 void expandMemberTuples( std::list< Declaration * > & translationUnit ) { 81 MemberTupleExpanderexpander;80 PassVisitor<MemberTupleExpander> expander; 82 81 mutateAll( translationUnit, expander ); 83 82 } … … 109 108 // construct a new UntypedMemberExpr with the correct structure , and recursively 110 109 // expand that member expression. 111 MemberTupleExpanderexpander;112 UntypedMemberExpr * inner = new UntypedMemberExpr( memberExpr-> get_aggregate(), aggr->clone() );113 UntypedMemberExpr * newMemberExpr = new UntypedMemberExpr( memberExpr-> get_member(), inner );110 PassVisitor<MemberTupleExpander> expander; 111 UntypedMemberExpr * inner = new UntypedMemberExpr( memberExpr->aggregate, aggr->clone() ); 112 UntypedMemberExpr * newMemberExpr = new UntypedMemberExpr( memberExpr->member, inner ); 114 113 inner->location = newMemberExpr->location = loc; 115 memberExpr-> set_member(nullptr);116 memberExpr-> set_aggregate(nullptr);114 memberExpr->member = nullptr; 115 memberExpr->aggregate = nullptr; 117 116 delete memberExpr; 118 117 return newMemberExpr->acceptMutator( expander ); … … 126 125 } 127 126 128 Expression * MemberTupleExpander:: mutate( UntypedMemberExpr * memberExpr ) {129 if ( UntypedTupleExpr * tupleExpr = dynamic_cast< UntypedTupleExpr * > ( memberExpr-> get_member()) ) {130 Expression * aggr = memberExpr-> get_aggregate()->clone()->acceptMutator( *this);127 Expression * MemberTupleExpander::postmutate( UntypedMemberExpr * memberExpr ) { 128 if ( UntypedTupleExpr * tupleExpr = dynamic_cast< UntypedTupleExpr * > ( memberExpr->member ) ) { 129 Expression * aggr = memberExpr->aggregate->clone()->acceptMutator( *visitor ); 131 130 // aggregate expressions which might be impure must be wrapped in unique expressions 132 // xxx - if there's a member-tuple expression nested in the aggregate, this currently generates the wrong code if a UniqueExpr is not used, and it's purely an optimization to remove the UniqueExpr 133 // if ( Tuples::maybeImpureIgnoreUnique( memberExpr->get_aggregate() ) ) aggr = new UniqueExpr( aggr ); 134 aggr = new UniqueExpr( aggr ); 135 for ( Expression *& expr : tupleExpr->get_exprs() ) { 131 if ( Tuples::maybeImpureIgnoreUnique( memberExpr->aggregate ) ) aggr = new UniqueExpr( aggr ); 132 for ( Expression *& expr : tupleExpr->exprs ) { 136 133 expr = reconstructMemberExpr( expr, aggr, memberExpr->location ); 137 134 expr->location = memberExpr->location; … … 143 140 // there may be a tuple expr buried in the aggregate 144 141 // xxx - this is a memory leak 145 UntypedMemberExpr * newMemberExpr = new UntypedMemberExpr( memberExpr-> get_member()->clone(), memberExpr->get_aggregate()->acceptMutator( *this) );142 UntypedMemberExpr * newMemberExpr = new UntypedMemberExpr( memberExpr->member->clone(), memberExpr->aggregate->acceptMutator( *visitor ) ); 146 143 newMemberExpr->location = memberExpr->location; 147 144 return newMemberExpr; … … 202 199 // generate struct type to replace tuple type based on the number of components in the tuple 203 200 StructDecl * decl = new StructDecl( toString( "_tuple", tupleSize, "_" ) ); 201 decl->location = tupleType->location; 204 202 decl->set_body( true ); 205 203 for ( size_t i = 0; i < tupleSize; ++i ) { … … 228 226 229 227 Expression * TupleIndexExpander::postmutate( TupleIndexExpr * tupleExpr ) { 230 Expression * tuple = tupleExpr-> get_tuple();228 Expression * tuple = tupleExpr->tuple; 231 229 assert( tuple ); 232 tupleExpr-> set_tuple( nullptr );233 unsigned int idx = tupleExpr-> get_index();234 TypeSubstitution * env = tupleExpr-> get_env();235 tupleExpr-> set_env( nullptr );230 tupleExpr->tuple = nullptr; 231 unsigned int idx = tupleExpr->index; 232 TypeSubstitution * env = tupleExpr->env; 233 tupleExpr->env = nullptr; 236 234 delete tupleExpr; 237 235 238 StructInstType * type = strict_dynamic_cast< StructInstType * >( tuple->get_result() ); 239 StructDecl * structDecl = type->get_baseStruct(); 240 assert( structDecl->get_members().size() > idx ); 241 Declaration * member = *std::next(structDecl->get_members().begin(), idx); 236 if ( TupleExpr * tupleExpr = dynamic_cast< TupleExpr * > ( tuple ) ) { 237 if ( ! maybeImpureIgnoreUnique( tupleExpr ) ) { 238 // optimization: definitely pure tuple expr => can reduce to the only relevant component. 239 assert( tupleExpr->exprs.size() > idx ); 240 Expression *& expr = *std::next(tupleExpr->exprs.begin(), idx); 241 Expression * ret = expr; 242 ret->env = env; 243 expr = nullptr; // remove from list so it can safely be deleted 244 delete tupleExpr; 245 return ret; 246 } 247 } 248 249 StructInstType * type = strict_dynamic_cast< StructInstType * >( tuple->result ); 250 StructDecl * structDecl = type->baseStruct; 251 assert( structDecl->members.size() > idx ); 252 Declaration * member = *std::next(structDecl->members.begin(), idx); 242 253 MemberExpr * memExpr = new MemberExpr( strict_dynamic_cast< DeclarationWithType * >( member ), tuple ); 243 memExpr-> set_env( env );254 memExpr->env = env; 244 255 return memExpr; 245 256 } -
src/config.h.in
rf9feab8 r90152a4 1 /* config.h.in. Generated from configure.ac by autoheader. */ 1 /* src/config.h.in. Generated from configure.ac by autoheader. */ 2 3 /* CPU to use if the -m32 flags is given. */ 4 #undef CFA_32_CPU 5 6 /* CPU to use if the -m64 flags is given. */ 7 #undef CFA_64_CPU 2 8 3 9 /* Location of include files. */ … … 6 12 /* Location of cfa command. */ 7 13 #undef CFA_BINDIR 14 15 /* Default cpu to use if neither -m32 or -m64 are defined. */ 16 #undef CFA_DEFAULT_CPU 8 17 9 18 /* compilation flags for cfa libraries and test programs. */ … … 152 161 /* Define to 1 if you have the ANSI C header files. */ 153 162 #undef STDC_HEADERS 163 164 /* Top build directory */ 165 #undef TOP_BUILDDIR 166 167 /* Top src directory */ 168 #undef TOP_SRCDIR 154 169 155 170 /* Version number of package */ -
src/main.cc
rf9feab8 r90152a4 1 2 1 // 3 2 // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo … … 11 10 // Created On : Fri May 15 23:12:02 2015 12 11 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Tue Oct 31 12:22:40 201714 // Update Count : 4 4512 // Last Modified On : Wed Jun 6 15:51:47 2018 13 // Update Count : 498 15 14 // 16 15 … … 29 28 #include <string> // for char_traits, operator<< 30 29 30 #include "CompilationState.h" 31 31 #include "../config.h" // for CFA_LIBDIR 32 32 #include "CodeGen/FixMain.h" // for FixMain … … 35 35 #include "CodeTools/DeclStats.h" // for printDeclStats 36 36 #include "CodeTools/TrackLoc.h" // for fillLocations 37 #include "Common/CompilerError.h" // for CompilerError 38 #include "Common/Heap.h" 37 39 #include "Common/PassVisitor.h" 38 #include "Common/CompilerError.h" // for CompilerError39 40 #include "Common/SemanticError.h" // for SemanticError 40 41 #include "Common/UnimplementedError.h" // for UnimplementedError … … 63 64 using namespace std; 64 65 65 #define OPTPRINT(x) if ( errorp ) cerr << x << endl; 66 66 #define PASS(name, pass) \ 67 if ( errorp ) { cerr << name << endl; } \ 68 HeapStats::newPass(name); \ 69 pass; 67 70 68 71 LinkageSpec::Spec linkage = LinkageSpec::Cforall; … … 70 73 DeclarationNode * parseTree = nullptr; // program parse tree 71 74 72 extern int yydebug; // set for -g flag (Grammar) 73 bool 74 astp = false, 75 bresolvep = false, 76 bboxp = false, 77 bcodegenp = false, 78 ctorinitp = false, 79 declstatsp = false, 80 exprp = false, 81 expraltp = false, 82 libcfap = false, 83 nopreludep = false, 84 noprotop = false, 85 nomainp = false, 86 parsep = false, 87 resolvep = false, // used in AlternativeFinder 88 symtabp = false, 89 treep = false, 90 tuplep = false, 91 validp = false, 92 errorp = false, 93 codegenp = false, 94 prettycodegenp = false, 95 linemarks = false; 75 std::string PreludeDirector = ""; 96 76 97 77 static void parse_cmdline( int argc, char *argv[], const char *& filename ); … … 154 134 << "." << endl; 155 135 backtrace( 2 ); // skip first 2 stack frames 156 exit( EXIT_FAILURE ); 136 //_exit( EXIT_FAILURE ); 137 abort(); 157 138 } // sigSegvBusHandler 158 139 … … 173 154 signal( SIGBUS, sigSegvBusHandler ); 174 155 signal( SIGABRT, sigAbortHandler ); 156 157 // std::cout << "main" << std::endl; 158 // for ( int i = 0; i < argc; i += 1 ) { 159 // std::cout << '\t' << argv[i] << std::endl; 160 // } // for 175 161 176 162 parse_cmdline( argc, argv, filename ); // process command-line arguments … … 198 184 // -l is for initial build ONLY and builtins.cf is not in the lib directory so access it here. 199 185 186 assertf( !PreludeDirector.empty(), "Can't find prelude without option --prelude-dir must be used." ); 187 200 188 // Read to gcc builtins, if not generating the cfa library 201 FILE * gcc_builtins = fopen( libcfap | treep ? "../prelude/gcc-builtins.cf" : CFA_LIBDIR "/gcc-builtins.cf", "r" );189 FILE * gcc_builtins = fopen( (PreludeDirector + "/gcc-builtins.cf").c_str(), "r" ); 202 190 assertf( gcc_builtins, "cannot open gcc-builtins.cf\n" ); 203 191 parse( gcc_builtins, LinkageSpec::Compiler ); 204 192 205 193 // read the extra prelude in, if not generating the cfa library 206 FILE * extras = fopen( libcfap | treep ? "../prelude/extras.cf" : CFA_LIBDIR "/extras.cf", "r" );194 FILE * extras = fopen( (PreludeDirector + "/extras.cf").c_str(), "r" ); 207 195 assertf( extras, "cannot open extras.cf\n" ); 208 196 parse( extras, LinkageSpec::BuiltinC ); … … 210 198 if ( ! libcfap ) { 211 199 // read the prelude in, if not generating the cfa library 212 FILE * prelude = fopen( treep ? "../prelude/prelude.cf" : CFA_LIBDIR "/prelude.cf", "r" );200 FILE * prelude = fopen( (PreludeDirector + "/prelude.cf").c_str(), "r" ); 213 201 assertf( prelude, "cannot open prelude.cf\n" ); 214 202 parse( prelude, LinkageSpec::Intrinsic ); 215 203 216 204 // Read to cfa builtins, if not generating the cfa library 217 FILE * builtins = fopen( libcfap | treep ? "../prelude/builtins.cf" : CFA_LIBDIR "/builtins.cf", "r" );205 FILE * builtins = fopen( (PreludeDirector + "/builtins.cf").c_str(), "r" ); 218 206 assertf( builtins, "cannot open builtins.cf\n" ); 219 207 parse( builtins, LinkageSpec::BuiltinCFA ); … … 238 226 } // if 239 227 228 // Temporary: fill locations after parsing so that every node has a location, for early error messages. 229 // Eventually we should pass the locations from the parser to every node, but this quick and dirty solution 230 // works okay for now. 231 CodeTools::fillLocations( translationUnit ); 232 240 233 // add the assignment statement after the initialization of a type parameter 241 OPTPRINT( "validate" ) 242 SymTab::validate( translationUnit, symtabp ); 234 PASS( "validate", SymTab::validate( translationUnit, symtabp ) ); 243 235 if ( symtabp ) { 244 236 deleteAll( translationUnit ); … … 257 249 } // if 258 250 259 OPTPRINT( "mutate" ) 260 ControlStruct::mutate( translationUnit ); 261 OPTPRINT( "fixNames" ) 262 CodeGen::fixNames( translationUnit ); 263 OPTPRINT( "genInit" ) 264 InitTweak::genInit( translationUnit ); 265 OPTPRINT( "expandMemberTuples" ); 266 Tuples::expandMemberTuples( translationUnit ); 251 PASS( "fixLabels", ControlStruct::fixLabels( translationUnit ) ); 252 PASS( "fixNames", CodeGen::fixNames( translationUnit ) ); 253 PASS( "genInit", InitTweak::genInit( translationUnit ) ); 254 PASS( "expandMemberTuples" , Tuples::expandMemberTuples( translationUnit ) ); 267 255 if ( libcfap ) { 268 256 // generate the bodies of cfa library functions … … 281 269 } // if 282 270 283 OPTPRINT( "resolve" ) 284 ResolvExpr::resolve( translationUnit ); 271 CodeTools::fillLocations( translationUnit ); 272 273 PASS( "resolve", ResolvExpr::resolve( translationUnit ) ); 285 274 if ( exprp ) { 286 275 dump( translationUnit ); … … 289 278 290 279 // fix ObjectDecl - replaces ConstructorInit nodes 291 OPTPRINT( "fixInit" ) 292 InitTweak::fix( translationUnit, filename, libcfap || treep ); 280 PASS( "fixInit", InitTweak::fix( translationUnit, buildingLibrary() ) ); 293 281 if ( ctorinitp ) { 294 282 dump ( translationUnit ); … … 296 284 } // if 297 285 298 OPTPRINT( "expandUniqueExpr" ); // xxx - is this the right place for this? want to expand ASAP so that subsequent passes don't need to worry about double-visiting a unique expr - needs to go after InitTweak::fix so that copy constructed return declarations are reused 299 Tuples::expandUniqueExpr( translationUnit ); 300 301 OPTPRINT( "translateEHM" ); 302 ControlStruct::translateEHM( translationUnit ); 303 304 OPTPRINT( "generateWaitfor" ); 305 Concurrency::generateWaitFor( translationUnit ); 306 307 OPTPRINT( "convertSpecializations" ) // needs to happen before tuple types are expanded 308 GenPoly::convertSpecializations( translationUnit ); 309 310 OPTPRINT( "expandTuples" ); // xxx - is this the right place for this? 311 Tuples::expandTuples( translationUnit ); 286 PASS( "expandUniqueExpr", Tuples::expandUniqueExpr( translationUnit ) ); // xxx - is this the right place for this? want to expand ASAP so tha, sequent passes don't need to worry about double-visiting a unique expr - needs to go after InitTweak::fix so that copy constructed return declarations are reused 287 288 PASS( "translateEHM" , ControlStruct::translateEHM( translationUnit ) ); 289 290 PASS( "generateWaitfor" , Concurrency::generateWaitFor( translationUnit ) ); 291 292 PASS( "convertSpecializations", GenPoly::convertSpecializations( translationUnit ) ); // needs to happen before tuple types are expanded 293 294 PASS( "expandTuples", Tuples::expandTuples( translationUnit ) ); // xxx - is this the right place for this? 295 312 296 if ( tuplep ) { 313 297 dump( translationUnit ); … … 315 299 } 316 300 317 OPTPRINT( "virtual expandCasts" ) // Must come after translateEHM 318 Virtual::expandCasts( translationUnit ); 319 320 OPTPRINT("instantiateGenerics") 321 GenPoly::instantiateGeneric( translationUnit ); 322 OPTPRINT( "convertLvalue" ) 323 GenPoly::convertLvalue( translationUnit ); 301 PASS( "virtual expandCasts", Virtual::expandCasts( translationUnit ) ); // Must come after translateEHM 302 303 PASS( "instantiateGenerics", GenPoly::instantiateGeneric( translationUnit ) ); 304 if ( genericsp ) { 305 dump( translationUnit ); 306 return 0; 307 } 308 PASS( "convertLvalue", GenPoly::convertLvalue( translationUnit ) ); 309 324 310 325 311 if ( bboxp ) { … … 327 313 return 0; 328 314 } // if 329 OPTPRINT( "box" ) 330 GenPoly::box( translationUnit ); 315 PASS( "box", GenPoly::box( translationUnit ) ); 331 316 332 317 if ( bcodegenp ) { … … 340 325 341 326 CodeTools::fillLocations( translationUnit ); 342 CodeGen::generate( translationUnit, *output, ! noprotop, prettycodegenp, true, linemarks ); 343 344 CodeGen::FixMain::fix( *output, treep ? "../prelude/bootloader.c" : CFA_LIBDIR "/bootloader.c" ); 345 327 PASS( "codegen", CodeGen::generate( translationUnit, *output, ! noprotop, prettycodegenp, true, linemarks ) ); 328 329 CodeGen::FixMain::fix( *output, (PreludeDirector + "/bootloader.c").c_str() ); 346 330 if ( output != &cout ) { 347 331 delete output; 348 332 } // if 349 } catch ( SemanticError &e ) {333 } catch ( SemanticErrorException &e ) { 350 334 if ( errorp ) { 351 335 cerr << "---AST at error:---" << endl; … … 353 337 cerr << endl << "---End of AST, begin error message:---\n" << endl; 354 338 } // if 355 e.print( cerr);339 e.print(); 356 340 if ( output != &cout ) { 357 341 delete output; … … 371 355 } // if 372 356 return 1; 373 } // try 357 } catch(...) { 358 std::exception_ptr eptr = std::current_exception(); 359 try { 360 if (eptr) { 361 std::rethrow_exception(eptr); 362 } 363 else { 364 std::cerr << "Exception Uncaught and Unkown" << std::endl; 365 } 366 } catch(const std::exception& e) { 367 std::cerr << "Unaught Exception \"" << e.what() << "\"\n"; 368 } 369 return 1; 370 }// try 374 371 375 372 deleteAll( translationUnit ); 373 if(!libcfap && !treep) HeapStats::printStats(); 376 374 return 0; 377 375 } // main 378 376 379 377 void parse_cmdline( int argc, char * argv[], const char *& filename ) { 380 enum { Ast, Bbox, Bresolver, CtorInitFix, DeclStats, Expr, ExprAlt, Grammar, LibCFA, Linemarks, Nolinemarks, Nopreamble, Parse, Pr ototypes, Resolver, Symbol, Tree, TupleExpansion, Validate, };378 enum { Ast, Bbox, Bresolver, CtorInitFix, DeclStats, Expr, ExprAlt, Grammar, LibCFA, Linemarks, Nolinemarks, Nopreamble, Parse, PreludeDir, Prototypes, Resolver, Symbol, Tree, TupleExpansion, Validate, }; 381 379 382 380 static struct option long_opts[] = { … … 394 392 { "no-preamble", no_argument, 0, Nopreamble }, 395 393 { "parse", no_argument, 0, Parse }, 394 { "prelude-dir", required_argument, 0, PreludeDir }, 396 395 { "no-prototypes", no_argument, 0, Prototypes }, 397 396 { "resolver", no_argument, 0, Resolver }, … … 406 405 opterr = 0; // (global) prevent getopt from printing error messages 407 406 407 bool Wsuppress = false, Werror = false; 408 408 int c; 409 while ( (c = getopt_long( argc, argv, "abBcCdefg lLmnNpqrstTvyzZD:F:", long_opts, &long_index )) != -1 ) {409 while ( (c = getopt_long( argc, argv, "abBcCdefgGlLmnNpqrstTvwW:yzZD:F:", long_opts, &long_index )) != -1 ) { 410 410 switch ( c ) { 411 411 case Ast: … … 443 443 yydebug = true; 444 444 break; 445 case 'G': // dump AST after instantiate generics 446 genericsp = true; 447 break; 445 448 case LibCFA: 446 449 case 'l': // generate libcfa.c … … 463 466 noprotop = true; 464 467 break; 468 case PreludeDir: 469 PreludeDirector = optarg; 470 break; 465 471 case 'm': // don't replace the main 466 472 nomainp = true; … … 488 494 case 'v': // dump AST after decl validation pass 489 495 validp = true; 496 break; 497 case 'w': 498 Wsuppress = true; 499 break; 500 case 'W': 501 if ( strcmp( optarg, "all" ) == 0 ) { 502 SemanticWarning_EnableAll(); 503 } else if ( strcmp( optarg, "error" ) == 0 ) { 504 Werror = true; 505 } else { 506 char * warning = optarg; 507 Severity s; 508 if ( strncmp( optarg, "no-", 3 ) == 0 ) { 509 warning += 3; 510 s = Severity::Suppress; 511 } else { 512 s = Severity::Warn; 513 } // if 514 SemanticWarning_Set( warning, s ); 515 } // if 490 516 break; 491 517 case 'y': // dump AST on error … … 509 535 assertf( false, "Unknown option: %s\n", argv[optind - 1] ); 510 536 } // if 511 #if __GNUC__ < 7 512 #else 537 #if defined(__GNUC__) && __GNUC__ >= 7 513 538 __attribute__((fallthrough)); 514 539 #endif … … 517 542 } // switch 518 543 } // while 544 545 if ( Werror ) { 546 SemanticWarning_WarningAsError(); 547 } // if 548 if ( Wsuppress ) { 549 SemanticWarning_SuppressAll(); 550 } // if 551 // for ( const auto w : WarningFormats ) { 552 // cout << w.name << ' ' << (int)w.severity << endl; 553 // } // for 519 554 } // parse_cmdline 520 555 … … 527 562 yyin = input; 528 563 yylineno = 1; 529 typedefTable.enterScope();530 564 int parseStatus = yyparse(); 531 565
Note:
See TracChangeset
for help on using the changeset viewer.