- Timestamp:
- Jul 17, 2017, 3:54:08 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 969b3fe
- Parents:
- e60e0dc (diff), 59e86eb (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:
-
- 4 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/OperatorTable.cc
re60e0dc r5bd0aad 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 13 14:33:05 201613 // Update Count : 1 012 // Last Modified On : Sat Jul 15 17:12:22 2017 13 // Update Count : 15 14 14 // 15 15 … … 35 35 { "++?", "++", "_operator_preincr", OT_PREFIXASSIGN }, 36 36 { "--?", "--", "_operator_predecr", OT_PREFIXASSIGN }, 37 { "?\\?", "\\", "_operator_exponential", OT_INFIX }, 37 38 { "?*?", "*", "_operator_multiply", OT_INFIX }, 38 39 { "?/?", "/", "_operator_divide", OT_INFIX }, … … 52 53 { "?|?", "|", "_operator_bitor", OT_INFIX }, 53 54 { "?=?", "=", "_operator_assign", OT_INFIXASSIGN }, 55 { "?\\=?", "\\=", "_operator_expassign", OT_INFIXASSIGN }, 54 56 { "?*=?", "*=", "_operator_multassign", OT_INFIXASSIGN }, 55 57 { "?/=?", "/=", "_operator_divassign", OT_INFIXASSIGN }, -
src/Makefile.in
re60e0dc r5bd0aad 216 216 SymTab/driver_cfa_cpp-TypeEquality.$(OBJEXT) \ 217 217 SymTab/driver_cfa_cpp-Autogen.$(OBJEXT) \ 218 SymTab/driver_cfa_cpp-TreeStruct.$(OBJEXT) \ 218 219 SynTree/driver_cfa_cpp-Type.$(OBJEXT) \ 219 220 SynTree/driver_cfa_cpp-VoidType.$(OBJEXT) \ … … 514 515 SymTab/Indexer.cc SymTab/Mangler.cc SymTab/Validate.cc \ 515 516 SymTab/FixFunction.cc SymTab/ImplementationType.cc \ 516 SymTab/TypeEquality.cc SymTab/Autogen.cc Sy nTree/Type.cc \517 SynTree/ VoidType.cc SynTree/BasicType.cc \517 SymTab/TypeEquality.cc SymTab/Autogen.cc SymTab/TreeStruct.cc \ 518 SynTree/Type.cc SynTree/VoidType.cc SynTree/BasicType.cc \ 518 519 SynTree/PointerType.cc SynTree/ArrayType.cc \ 519 520 SynTree/FunctionType.cc SynTree/ReferenceToType.cc \ … … 848 849 SymTab/driver_cfa_cpp-Autogen.$(OBJEXT): SymTab/$(am__dirstamp) \ 849 850 SymTab/$(DEPDIR)/$(am__dirstamp) 851 SymTab/driver_cfa_cpp-TreeStruct.$(OBJEXT): SymTab/$(am__dirstamp) \ 852 SymTab/$(DEPDIR)/$(am__dirstamp) 850 853 SynTree/$(am__dirstamp): 851 854 @$(MKDIR_P) SynTree … … 1033 1036 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-Indexer.Po@am__quote@ 1034 1037 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-Mangler.Po@am__quote@ 1038 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-TreeStruct.Po@am__quote@ 1035 1039 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-TypeEquality.Po@am__quote@ 1036 1040 @AMDEP_TRUE@@am__include@ @am__quote@SymTab/$(DEPDIR)/driver_cfa_cpp-Validate.Po@am__quote@ … … 2084 2088 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2085 2089 @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` 2090 2091 SymTab/driver_cfa_cpp-TreeStruct.o: SymTab/TreeStruct.cc 2092 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-TreeStruct.o -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-TreeStruct.Tpo -c -o SymTab/driver_cfa_cpp-TreeStruct.o `test -f 'SymTab/TreeStruct.cc' || echo '$(srcdir)/'`SymTab/TreeStruct.cc 2093 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-TreeStruct.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-TreeStruct.Po 2094 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/TreeStruct.cc' object='SymTab/driver_cfa_cpp-TreeStruct.o' libtool=no @AMDEPBACKSLASH@ 2095 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2096 @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-TreeStruct.o `test -f 'SymTab/TreeStruct.cc' || echo '$(srcdir)/'`SymTab/TreeStruct.cc 2097 2098 SymTab/driver_cfa_cpp-TreeStruct.obj: SymTab/TreeStruct.cc 2099 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SymTab/driver_cfa_cpp-TreeStruct.obj -MD -MP -MF SymTab/$(DEPDIR)/driver_cfa_cpp-TreeStruct.Tpo -c -o SymTab/driver_cfa_cpp-TreeStruct.obj `if test -f 'SymTab/TreeStruct.cc'; then $(CYGPATH_W) 'SymTab/TreeStruct.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/TreeStruct.cc'; fi` 2100 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SymTab/$(DEPDIR)/driver_cfa_cpp-TreeStruct.Tpo SymTab/$(DEPDIR)/driver_cfa_cpp-TreeStruct.Po 2101 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab/TreeStruct.cc' object='SymTab/driver_cfa_cpp-TreeStruct.obj' libtool=no @AMDEPBACKSLASH@ 2102 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2103 @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-TreeStruct.obj `if test -f 'SymTab/TreeStruct.cc'; then $(CYGPATH_W) 'SymTab/TreeStruct.cc'; else $(CYGPATH_W) '$(srcdir)/SymTab/TreeStruct.cc'; fi` 2086 2104 2087 2105 SynTree/driver_cfa_cpp-Type.o: SynTree/Type.cc -
src/Parser/DeclarationNode.cc
re60e0dc r5bd0aad 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Jun 28 15:27:00 201713 // Update Count : 10 1912 // Last Modified On : Fri Jul 14 16:55:00 2017 13 // Update Count : 1020 14 14 // 15 15 … … 253 253 newnode->type->aggregate.fields = fields; 254 254 newnode->type->aggregate.body = body; 255 newnode->type->aggregate.tagged = false; 256 newnode->type->aggregate.parent = nullptr; 255 257 return newnode; 256 258 } // DeclarationNode::newAggregate … … 273 275 return newnode; 274 276 } // DeclarationNode::newEnumConstant 277 278 DeclarationNode * DeclarationNode::newTreeStruct( Aggregate kind, const string * name, const string * parent, ExpressionNode * actuals, DeclarationNode * fields, bool body ) { 279 assert( name ); 280 DeclarationNode * newnode = new DeclarationNode; 281 newnode->type = new TypeData( TypeData::Aggregate ); 282 newnode->type->aggregate.kind = kind; 283 newnode->type->aggregate.name = name; 284 newnode->type->aggregate.actuals = actuals; 285 newnode->type->aggregate.fields = fields; 286 newnode->type->aggregate.body = body; 287 newnode->type->aggregate.tagged = true; 288 newnode->type->aggregate.parent = parent; 289 return newnode; 290 } // DeclarationNode::newTreeStruct 275 291 276 292 DeclarationNode * DeclarationNode::newName( string * name ) { -
src/Parser/ExpressionNode.cc
re60e0dc r5bd0aad 10 10 // Created On : Sat May 16 13:17:07 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jun 28 21:08:15201713 // Update Count : 54 212 // Last Modified On : Sat Jul 15 16:09:04 2017 13 // Update Count : 549 14 14 // 15 15 … … 231 231 } 232 232 233 // Must harmonize with OperKinds. 233 234 static const char *OperName[] = { 234 235 // diadic 235 "SizeOf", "AlignOf", "OffsetOf", "?+?", "?-?", "? *?", "?/?", "?%?", "||", "&&",236 "SizeOf", "AlignOf", "OffsetOf", "?+?", "?-?", "?\\?", "?*?", "?/?", "?%?", "||", "&&", 236 237 "?|?", "?&?", "?^?", "Cast", "?<<?", "?>>?", "?<?", "?>?", "?<=?", "?>=?", "?==?", "?!=?", 237 "?=?", "?@=?", "? *=?", "?/=?", "?%=?", "?+=?", "?-=?", "?<<=?", "?>>=?", "?&=?", "?^=?", "?|=?",238 "?=?", "?@=?", "?\\=?", "?*=?", "?/=?", "?%=?", "?+=?", "?-=?", "?<<=?", "?>>=?", "?&=?", "?^=?", "?|=?", 238 239 "?[?]", "...", 239 240 // monadic -
src/Parser/ParseNode.h
re60e0dc r5bd0aad 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 13:28:16 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Mon Jun 12 13:00:00201713 // Update Count : 7 7911 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 15 16:00:48 2017 13 // Update Count : 785 14 14 // 15 15 … … 141 141 }; 142 142 143 // Must harmonize with OperName. 143 144 enum class OperKinds { 144 145 // diadic 145 SizeOf, AlignOf, OffsetOf, Plus, Minus, Mul, Div, Mod, Or, And,146 SizeOf, AlignOf, OffsetOf, Plus, Minus, Exp, Mul, Div, Mod, Or, And, 146 147 BitOr, BitAnd, Xor, Cast, LShift, RShift, LThan, GThan, LEThan, GEThan, Eq, Neq, 147 Assign, AtAssn, MulAssn, DivAssn, ModAssn, PlusAssn, MinusAssn, LSAssn, RSAssn, AndAssn, ERAssn, OrAssn,148 Assign, AtAssn, ExpAssn, MulAssn, DivAssn, ModAssn, PlusAssn, MinusAssn, LSAssn, RSAssn, AndAssn, ERAssn, OrAssn, 148 149 Index, Range, 149 150 // monadic … … 248 249 static DeclarationNode * newAsmStmt( StatementNode * stmt ); // gcc external asm statement 249 250 251 // Perhaps this would best fold into newAggragate. 252 static DeclarationNode * newTreeStruct( Aggregate kind, const std::string * name, const std::string * parent, ExpressionNode * actuals, DeclarationNode * fields, bool body ); 253 250 254 DeclarationNode(); 251 255 ~DeclarationNode(); … … 332 336 333 337 static UniqueName anonymous; 338 339 // Temp to test TreeStruct 340 const std::string * parent_name; 334 341 }; // DeclarationNode 335 342 -
src/Parser/TypeData.cc
re60e0dc r5bd0aad 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Jun 28 15:28:00 201713 // Update Count : 56 412 // Last Modified On : Fri Jul 14 16:58:00 2017 13 // Update Count : 565 14 14 // 15 15 … … 63 63 aggregate.fields = nullptr; 64 64 aggregate.body = false; 65 aggregate.tagged = false; 66 aggregate.parent = nullptr; 65 67 break; 66 68 case AggregateInst: … … 121 123 delete aggregate.actuals; 122 124 delete aggregate.fields; 125 delete aggregate.parent; 123 126 // delete aggregate; 124 127 break; … … 192 195 newtype->aggregate.kind = aggregate.kind; 193 196 newtype->aggregate.body = aggregate.body; 197 newtype->aggregate.tagged = aggregate.tagged; 198 newtype->aggregate.parent = aggregate.parent ? new string( *aggregate.parent ) : nullptr; 194 199 break; 195 200 case AggregateInst: … … 619 624 switch ( td->aggregate.kind ) { 620 625 case DeclarationNode::Struct: 626 if ( td->aggregate.tagged ) { 627 at = new StructDecl( *td->aggregate.name, td->aggregate.parent, attributes, linkage ); 628 buildForall( td->aggregate.params, at->get_parameters() ); 629 break; 630 } 621 631 case DeclarationNode::Coroutine: 622 632 case DeclarationNode::Monitor: -
src/Parser/TypeData.h
re60e0dc r5bd0aad 10 10 // Created On : Sat May 16 15:18:36 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Jun 28 15:29:00 201713 // Update Count : 18 612 // Last Modified On : Fri Jul 14 16:57:00 2017 13 // Update Count : 187 14 14 // 15 15 … … 31 31 DeclarationNode * fields; 32 32 bool body; 33 34 bool tagged; 35 const std::string * parent; 33 36 }; 34 37 -
src/Parser/lex.ll
re60e0dc r5bd0aad 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Wed Jul 12 18:04:44 201713 * Update Count : 5 3512 * Last Modified On : Sat Jul 15 15:46:34 2017 13 * Update Count : 542 14 14 */ 15 15 … … 125 125 op_unary {op_unary_only}|{op_unary_binary}|{op_unary_pre_post} 126 126 127 op_binary_only "/"|"%"|" ^"|"&"|"|"|"<"|">"|"="|"=="|"!="|"<<"|">>"|"<="|">="|"+="|"-="|"*="|"/="|"%="|"&="|"|="|"^="|"<<="|">>="127 op_binary_only "/"|"%"|"\\"|"^"|"&"|"|"|"<"|">"|"="|"=="|"!="|"<<"|">>"|"<="|">="|"+="|"-="|"*="|"/="|"%="|"\\="|"&="|"|="|"^="|"<<="|">>=" 128 128 op_binary_over {op_unary_binary}|{op_binary_only} 129 129 // op_binary_not_over "?"|"->"|"."|"&&"|"||"|"@=" … … 136 136 137 137 %% 138 138 /* line directives */ 139 139 ^{h_white}*"#"{h_white}*[0-9]+{h_white}*["][^"\n]+["].*"\n" { 140 140 /* " stop highlighting */ … … 337 337 "-" { ASCIIOP_RETURN(); } 338 338 "*" { ASCIIOP_RETURN(); } 339 "\\" { ASCIIOP_RETURN(); } // CFA, exponentiation 339 340 "/" { ASCIIOP_RETURN(); } 340 341 "%" { ASCIIOP_RETURN(); } … … 361 362 "+=" { NAMEDOP_RETURN(PLUSassign); } 362 363 "-=" { NAMEDOP_RETURN(MINUSassign); } 364 "\\=" { NAMEDOP_RETURN(EXPassign); } // CFA, exponentiation 363 365 "*=" { NAMEDOP_RETURN(MULTassign); } 364 366 "/=" { NAMEDOP_RETURN(DIVassign); } -
src/Parser/parser.yy
re60e0dc r5bd0aad 9 9 // Author : Peter A. Buhr 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Thu Jul 13 14:38:54201713 // Update Count : 24 3111 // Last Modified By : Andrew Beach 12 // Last Modified On : Mon Jul 17 12:17:00 2017 13 // Update Count : 2455 14 14 // 15 15 … … 151 151 %token ELLIPSIS // ... 152 152 153 %token MULTassign DIVassign MODassign // *= /= %=/153 %token EXPassign MULTassign DIVassign MODassign // \= *= /= %= 154 154 %token PLUSassign MINUSassign // += -= 155 155 %token LSassign RSassign // <<= >>= … … 168 168 %type<op> ptrref_operator unary_operator assignment_operator 169 169 %type<en> primary_expression postfix_expression unary_expression 170 %type<en> cast_expression multiplicative_expression additive_expression shift_expression 171 %type<en> relational_expression equality_expression AND_expression exclusive_OR_expression 172 %type<en> inclusive_OR_expression logical_AND_expression logical_OR_expression conditional_expression 173 %type<en> constant_expression assignment_expression assignment_expression_opt 170 %type<en> cast_expression exponential_expression multiplicative_expression additive_expression 171 %type<en> shift_expression relational_expression equality_expression 172 %type<en> AND_expression exclusive_OR_expression inclusive_OR_expression 173 %type<en> logical_AND_expression logical_OR_expression 174 %type<en> conditional_expression constant_expression assignment_expression assignment_expression_opt 174 175 %type<en> comma_expression comma_expression_opt 175 %type<en> argument_expression_list argument_expression assignment_opt176 %type<en> argument_expression_list argument_expression default_initialize_opt 176 177 %type<fctl> for_control_expression 177 178 %type<en> subrange … … 573 574 ; 574 575 576 exponential_expression: 577 cast_expression 578 | exponential_expression '\\' cast_expression 579 { $$ = new ExpressionNode( build_binary_val( OperKinds::Exp, $1, $3 ) ); } 580 ; 581 575 582 multiplicative_expression: 576 cast_expression577 | multiplicative_expression '*' cast_expression583 exponential_expression 584 | multiplicative_expression '*' exponential_expression 578 585 { $$ = new ExpressionNode( build_binary_val( OperKinds::Mul, $1, $3 ) ); } 579 | multiplicative_expression '/' cast_expression586 | multiplicative_expression '/' exponential_expression 580 587 { $$ = new ExpressionNode( build_binary_val( OperKinds::Div, $1, $3 ) ); } 581 | multiplicative_expression '%' cast_expression588 | multiplicative_expression '%' exponential_expression 582 589 { $$ = new ExpressionNode( build_binary_val( OperKinds::Mod, $1, $3 ) ); } 583 590 ; … … 678 685 '=' { $$ = OperKinds::Assign; } 679 686 | ATassign { $$ = OperKinds::AtAssn; } 687 | EXPassign { $$ = OperKinds::ExpAssn; } 680 688 | MULTassign { $$ = OperKinds::MulAssn; } 681 689 | DIVassign { $$ = OperKinds::DivAssn; } … … 972 980 { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( $2, nullptr, new ExpressionNode( build_constantInteger( *$6 ) ), $9 ) ) ); } 973 981 974 | handler_key '(' push push exception_declaration pop ')' compound_statement pop 975 { $$ = new StatementNode( build_catch( $1, $5, nullptr, $8 ) ); } 976 | handler_clause handler_key '(' push push exception_declaration pop ')' compound_statement pop 977 { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( $2, $6, nullptr, $9 ) ) ); } 982 | handler_key '(' push push exception_declaration pop handler_predicate_opt ')' compound_statement pop 983 { $$ = new StatementNode( build_catch( $1, $5, nullptr, $9 ) ); } 984 | handler_clause handler_key '(' push push exception_declaration pop handler_predicate_opt ')' compound_statement pop 985 { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( $2, $6, nullptr, $10 ) ) ); } 986 ; 987 988 handler_predicate_opt: 989 //empty 990 | ';' conditional_expression 978 991 ; 979 992 … … 1667 1680 | aggregate_key attribute_list_opt typegen_name // CFA 1668 1681 { $$ = $3->addQualifiers( $2 ); } 1682 1683 // Temp, testing TreeStruct 1684 | STRUCT TRY attribute_list_opt no_attr_identifier_or_type_name 1685 { 1686 typedefTable.makeTypedef( *$4 ); // create typedef 1687 if ( forall ) typedefTable.changeKind( *$4, TypedefTable::TG ); // $ 1688 forall = false; // reset 1689 } 1690 '{' field_declaration_list '}' 1691 { 1692 $$ = DeclarationNode::newTreeStruct( DeclarationNode::Struct, 1693 $4, nullptr, nullptr, $7, true )->addQualifiers( $3 ); 1694 } 1695 | STRUCT TRY attribute_list_opt no_attr_identifier_or_type_name TYPEDEFname 1696 { 1697 typedefTable.makeTypedef( *$4 ); // create typedef 1698 if ( forall ) typedefTable.changeKind( *$4, TypedefTable::TG ); // $ 1699 forall = false; // reset 1700 } 1701 '{' field_declaration_list '}' 1702 { 1703 $$ = DeclarationNode::newTreeStruct( DeclarationNode::Struct, 1704 $4, $5, nullptr, $8, true )->addQualifiers( $3 ); 1705 } 1669 1706 ; 1670 1707 … … 1845 1882 cfa_parameter_declaration: // CFA, new & old style parameter declaration 1846 1883 parameter_declaration 1847 | cfa_identifier_parameter_declarator_no_tuple identifier_or_type_name assignment_opt1884 | cfa_identifier_parameter_declarator_no_tuple identifier_or_type_name default_initialize_opt 1848 1885 { $$ = $1->addName( $2 ); } 1849 | cfa_abstract_tuple identifier_or_type_name assignment_opt1886 | cfa_abstract_tuple identifier_or_type_name default_initialize_opt 1850 1887 // To obtain LR(1), these rules must be duplicated here (see cfa_abstract_declarator). 1851 1888 { $$ = $1->addName( $2 ); } 1852 | type_qualifier_list cfa_abstract_tuple identifier_or_type_name assignment_opt1889 | type_qualifier_list cfa_abstract_tuple identifier_or_type_name default_initialize_opt 1853 1890 { $$ = $2->addName( $3 )->addQualifiers( $1 ); } 1854 1891 | cfa_function_specifier … … 1867 1904 parameter_declaration: 1868 1905 // No SUE declaration in parameter list. 1869 declaration_specifier_nobody identifier_parameter_declarator assignment_opt1906 declaration_specifier_nobody identifier_parameter_declarator default_initialize_opt 1870 1907 { 1871 1908 typedefTable.addToEnclosingScope( TypedefTable::ID ); 1872 1909 $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); 1873 1910 } 1874 | declaration_specifier_nobody type_parameter_redeclarator assignment_opt1911 | declaration_specifier_nobody type_parameter_redeclarator default_initialize_opt 1875 1912 { 1876 1913 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 1880 1917 1881 1918 abstract_parameter_declaration: 1882 declaration_specifier_nobody assignment_opt1919 declaration_specifier_nobody default_initialize_opt 1883 1920 { $$ = $1->addInitializer( $2 ? new InitializerNode( $2 ) : nullptr ); } 1884 | declaration_specifier_nobody abstract_parameter_declarator assignment_opt1921 | declaration_specifier_nobody abstract_parameter_declarator default_initialize_opt 1885 1922 { $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); } 1886 1923 ; … … 3045 3082 ; 3046 3083 3047 assignment_opt:3084 default_initialize_opt: 3048 3085 // empty 3049 3086 { $$ = nullptr; } -
src/SymTab/Autogen.cc
re60e0dc r5bd0aad 10 10 // Created On : Thu Mar 03 15:45:56 2016 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Jun 28 15:30:00 201713 // Update Count : 6 112 // Last Modified On : Fri Jul 14 16:41:00 2017 13 // Update Count : 62 14 14 // 15 15 … … 401 401 void makeStructFunctions( StructDecl *aggregateDecl, StructInstType *refType, unsigned int functionNesting, std::list< Declaration * > & declsToAdd, const std::vector< FuncData > & data ) { 402 402 // Builtins do not use autogeneration. 403 if ( aggregateDecl->get_linkage() == LinkageSpec::Builtin ||403 if ( aggregateDecl->get_linkage() == LinkageSpec::BuiltinCFA || 404 404 aggregateDecl->get_linkage() == LinkageSpec::BuiltinC ) { 405 405 return; -
src/SymTab/module.mk
re60e0dc r5bd0aad 10 10 ## Author : Richard C. Bilson 11 11 ## Created On : Mon Jun 1 17:49:17 2015 12 ## Last Modified By : Rob Schluntz13 ## Last Modified On : Tue Jul 07 16:22:23 201514 ## Update Count : 212 ## Last Modified By : Andrew Beach 13 ## Last Modified On : Wed Jul 12 13:06:00 2017 14 ## Update Count : 3 15 15 ############################################################################### 16 16 … … 21 21 SymTab/ImplementationType.cc \ 22 22 SymTab/TypeEquality.cc \ 23 SymTab/Autogen.cc 23 SymTab/Autogen.cc \ 24 SymTab/TreeStruct.cc -
src/SynTree/Constant.cc
re60e0dc r5bd0aad 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Thr Jun 22 10:11:00 201713 // Update Count : 2 812 // Last Modified On : Fri Jul 14 14:50:00 2017 13 // Update Count : 29 14 14 // 15 15 … … 46 46 } 47 47 48 Constant Constant::null( Type * ptrtype ) { 49 if ( nullptr == ptrtype ) { 50 ptrtype = new PointerType( 51 Type::Qualifiers(), 52 new VoidType( Type::Qualifiers() ) 53 ); 54 } 55 56 return Constant( ptrtype, "0", (unsigned long long int)0 ); 57 } 58 48 59 unsigned long long Constant::get_ival() const { 49 60 assertf( safe_dynamic_cast<BasicType*>(type)->isInteger(), "Attempt to retrieve ival from non-integer constant." ); -
src/SynTree/Constant.h
re60e0dc r5bd0aad 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Thr Jun 22 10:13:00 201713 // Update Count : 1 512 // Last Modified On : Fri Jul 14 13:33:00 2017 13 // Update Count : 16 14 14 // 15 15 … … 44 44 static Constant from_double( double d ); 45 45 46 /// generates a null pointer value for the given type. void * if omitted. 47 static Constant null( Type * ptrtype = nullptr ); 48 46 49 virtual void accept( Visitor & v ) { v.visit( this ); } 47 50 virtual Constant * acceptMutator( Mutator & m ) { return m.mutate( this ); } -
src/SynTree/Declaration.h
re60e0dc r5bd0aad 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Tus Jun 27 15:31:00 201713 // Update Count : 12 212 // Last Modified On : Fri Jul 14 16:59:00 2017 13 // Update Count : 123 14 14 // 15 15 … … 266 266 typedef AggregateDecl Parent; 267 267 public: 268 StructDecl( const std::string &name, DeclarationNode::Aggregate kind = DeclarationNode::Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( kind ) {} 268 StructDecl( const std::string &name, DeclarationNode::Aggregate kind = DeclarationNode::Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( kind ), tagged( false ), parent_name( "" ) {} 269 StructDecl( const std::string &name, const std::string *parent, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( DeclarationNode::Struct ), tagged( true ), parent_name( parent ? *parent : "" ) {} 269 270 StructDecl( const StructDecl &other ) : Parent( other ) {} 270 271 … … 273 274 bool is_thread() { return kind == DeclarationNode::Thread; } 274 275 276 // Tagged/Tree Structure Excetion 277 bool get_tagged() { return tagged; } 278 void set_tagged( bool newValue ) { tagged = newValue; } 279 bool has_parent() { return parent_name != ""; } 280 std::string get_parentName() { return parent_name; } 281 275 282 virtual StructDecl *clone() const { return new StructDecl( *this ); } 276 283 virtual void accept( Visitor &v ) { v.visit( this ); } … … 279 286 DeclarationNode::Aggregate kind; 280 287 virtual std::string typeString() const; 288 289 bool tagged; 290 std::string parent_name; 281 291 }; 282 292 -
src/libcfa/Makefile.am
re60e0dc r5bd0aad 11 11 ## Created On : Sun May 31 08:54:01 2015 12 12 ## Last Modified By : Andrew Beach 13 ## Last Modified On : Wed Jun 28 15:36:00 201714 ## Update Count : 21 513 ## Last Modified On : Fri Jun 14 17:00:00 2017 14 ## Update Count : 216 15 15 ############################################################################### 16 16 … … 51 51 52 52 libobjs = ${headers:=.o} 53 libsrc = libcfa-prelude.c interpose.c libhdr/libdebug.c ${headers:=.c} exception.c 53 libsrc = libcfa-prelude.c interpose.c libhdr/libdebug.c ${headers:=.c} \ 54 exception.c typeobject.c 54 55 55 56 # not all platforms support concurrency, add option do disable it … … 68 69 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $< 69 70 71 libcfa_a-typeobject.o : typeobject.c 72 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $< 73 70 74 concurrency/libcfa_d_a-invoke.o : concurrency/invoke.c 71 75 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $< 72 76 73 77 libcfa_d_a-exception.o : exception.c 78 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $< 79 80 libcfa_d_a-typeobject.o : typeobject.c 74 81 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $< 75 82 -
src/libcfa/Makefile.in
re60e0dc r5bd0aad 154 154 concurrency/coroutine.c concurrency/thread.c \ 155 155 concurrency/kernel.c concurrency/monitor.c exception.c \ 156 concurrency/CtxSwitch-@MACHINE_TYPE@.S concurrency/alarm.c \ 157 concurrency/invoke.c concurrency/preemption.c 156 typeobject.c concurrency/CtxSwitch-@MACHINE_TYPE@.S \ 157 concurrency/alarm.c concurrency/invoke.c \ 158 concurrency/preemption.c 158 159 am__dirstamp = $(am__leading_dot)dirstamp 159 160 @BUILD_CONCURRENCY_TRUE@am__objects_1 = concurrency/libcfa_d_a-coroutine.$(OBJEXT) \ … … 177 178 libcfa_d_a-interpose.$(OBJEXT) \ 178 179 libhdr/libcfa_d_a-libdebug.$(OBJEXT) $(am__objects_2) \ 179 libcfa_d_a-exception.$(OBJEXT) $(am__objects_3) 180 libcfa_d_a-exception.$(OBJEXT) libcfa_d_a-typeobject.$(OBJEXT) \ 181 $(am__objects_3) 180 182 am_libcfa_d_a_OBJECTS = $(am__objects_4) 181 183 libcfa_d_a_OBJECTS = $(am_libcfa_d_a_OBJECTS) … … 188 190 concurrency/coroutine.c concurrency/thread.c \ 189 191 concurrency/kernel.c concurrency/monitor.c exception.c \ 190 concurrency/CtxSwitch-@MACHINE_TYPE@.S concurrency/alarm.c \ 191 concurrency/invoke.c concurrency/preemption.c 192 typeobject.c concurrency/CtxSwitch-@MACHINE_TYPE@.S \ 193 concurrency/alarm.c concurrency/invoke.c \ 194 concurrency/preemption.c 192 195 @BUILD_CONCURRENCY_TRUE@am__objects_5 = concurrency/libcfa_a-coroutine.$(OBJEXT) \ 193 196 @BUILD_CONCURRENCY_TRUE@ concurrency/libcfa_a-thread.$(OBJEXT) \ … … 209 212 libcfa_a-interpose.$(OBJEXT) \ 210 213 libhdr/libcfa_a-libdebug.$(OBJEXT) $(am__objects_6) \ 211 libcfa_a-exception.$(OBJEXT) $(am__objects_7) 214 libcfa_a-exception.$(OBJEXT) libcfa_a-typeobject.$(OBJEXT) \ 215 $(am__objects_7) 212 216 am_libcfa_a_OBJECTS = $(am__objects_8) 213 217 libcfa_a_OBJECTS = $(am_libcfa_a_OBJECTS) … … 417 421 libobjs = ${headers:=.o} 418 422 libsrc = libcfa-prelude.c interpose.c libhdr/libdebug.c ${headers:=.c} \ 419 exception.c $(am__append_4)423 exception.c typeobject.c $(am__append_4) 420 424 libcfa_a_SOURCES = ${libsrc} 421 425 libcfa_a_CFLAGS = -nodebug -O2 … … 593 597 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_a-rational.Po@am__quote@ 594 598 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_a-stdlib.Po@am__quote@ 599 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_a-typeobject.Po@am__quote@ 595 600 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-assert.Po@am__quote@ 596 601 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-exception.Po@am__quote@ … … 604 609 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-rational.Po@am__quote@ 605 610 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-stdlib.Po@am__quote@ 611 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa_d_a-typeobject.Po@am__quote@ 606 612 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/CtxSwitch-@MACHINE_TYPE@.Po@am__quote@ 607 613 @AMDEP_TRUE@@am__include@ @am__quote@concurrency/$(DEPDIR)/libcfa_a-alarm.Po@am__quote@ … … 928 934 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o libcfa_d_a-exception.obj `if test -f 'exception.c'; then $(CYGPATH_W) 'exception.c'; else $(CYGPATH_W) '$(srcdir)/exception.c'; fi` 929 935 936 libcfa_d_a-typeobject.obj: typeobject.c 937 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT libcfa_d_a-typeobject.obj -MD -MP -MF $(DEPDIR)/libcfa_d_a-typeobject.Tpo -c -o libcfa_d_a-typeobject.obj `if test -f 'typeobject.c'; then $(CYGPATH_W) 'typeobject.c'; else $(CYGPATH_W) '$(srcdir)/typeobject.c'; fi` 938 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcfa_d_a-typeobject.Tpo $(DEPDIR)/libcfa_d_a-typeobject.Po 939 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='typeobject.c' object='libcfa_d_a-typeobject.obj' libtool=no @AMDEPBACKSLASH@ 940 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 941 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -c -o libcfa_d_a-typeobject.obj `if test -f 'typeobject.c'; then $(CYGPATH_W) 'typeobject.c'; else $(CYGPATH_W) '$(srcdir)/typeobject.c'; fi` 942 930 943 concurrency/libcfa_d_a-alarm.o: concurrency/alarm.c 931 944 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_d_a_CFLAGS) $(CFLAGS) -MT concurrency/libcfa_d_a-alarm.o -MD -MP -MF concurrency/$(DEPDIR)/libcfa_d_a-alarm.Tpo -c -o concurrency/libcfa_d_a-alarm.o `test -f 'concurrency/alarm.c' || echo '$(srcdir)/'`concurrency/alarm.c … … 1228 1241 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1229 1242 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o libcfa_a-exception.obj `if test -f 'exception.c'; then $(CYGPATH_W) 'exception.c'; else $(CYGPATH_W) '$(srcdir)/exception.c'; fi` 1243 1244 libcfa_a-typeobject.obj: typeobject.c 1245 @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -MT libcfa_a-typeobject.obj -MD -MP -MF $(DEPDIR)/libcfa_a-typeobject.Tpo -c -o libcfa_a-typeobject.obj `if test -f 'typeobject.c'; then $(CYGPATH_W) 'typeobject.c'; else $(CYGPATH_W) '$(srcdir)/typeobject.c'; fi` 1246 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcfa_a-typeobject.Tpo $(DEPDIR)/libcfa_a-typeobject.Po 1247 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='typeobject.c' object='libcfa_a-typeobject.obj' libtool=no @AMDEPBACKSLASH@ 1248 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1249 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o libcfa_a-typeobject.obj `if test -f 'typeobject.c'; then $(CYGPATH_W) 'typeobject.c'; else $(CYGPATH_W) '$(srcdir)/typeobject.c'; fi` 1230 1250 1231 1251 concurrency/libcfa_a-alarm.o: concurrency/alarm.c … … 1521 1541 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $< 1522 1542 1543 libcfa_a-typeobject.o : typeobject.c 1544 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $< 1545 1523 1546 concurrency/libcfa_d_a-invoke.o : concurrency/invoke.c 1524 1547 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $< 1525 1548 1526 1549 libcfa_d_a-exception.o : exception.c 1550 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $< 1551 1552 libcfa_d_a-typeobject.o : typeobject.c 1527 1553 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $< 1528 1554 -
src/libcfa/iostream.c
re60e0dc r5bd0aad 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 6 18:14:17201713 // Update Count : 39 612 // Last Modified On : Sun Jul 16 21:12:03 2017 13 // Update Count : 398 14 14 // 15 15 … … 125 125 forall( dtype ostype | ostream( ostype ) ) 126 126 ostype * ?|?( ostype * os, float _Complex fc ) { 127 os | crealf( fc ); 128 _Bool temp = sepDisable( os ); // disable separators within complex value 129 if ( cimagf( fc ) >= 0 ) os | '+'; // negative value prints '-' 130 os | cimagf( fc ) | 'i'; 131 sepReset( os, temp ); // reset separator 127 if ( sepPrt( os ) ) fmt( os, "%s", sepGetCur( os ) ); 128 fmt( os, "%g%+gi", crealf( fc ), cimagf( fc ) ); 132 129 return os; 133 130 } // ?|? … … 135 132 forall( dtype ostype | ostream( ostype ) ) 136 133 ostype * ?|?( ostype * os, double _Complex dc ) { 137 os | creal( dc ); 138 _Bool temp = sepDisable( os ); // disable separators within complex value 139 if ( cimag( dc ) >= 0 ) os | '+'; // negative value prints '-' 140 os | cimag( dc ) | 'i'; 141 sepReset( os, temp ); // reset separator 134 if ( sepPrt( os ) ) fmt( os, "%s", sepGetCur( os ) ); 135 fmt( os, "%.*lg%+.*lgi", DBL_DIG, creal( dc ), DBL_DIG, cimag( dc ) ); 142 136 return os; 143 137 } // ?|? … … 145 139 forall( dtype ostype | ostream( ostype ) ) 146 140 ostype * ?|?( ostype * os, long double _Complex ldc ) { 147 os | creall( ldc ); 148 _Bool temp = sepDisable( os ); // disable separators within complex value 149 if ( cimagl( ldc ) >= 0 ) os | '+'; // negative value prints '-' 150 os | cimagl( ldc ) | 'i'; 151 sepReset( os, temp ); // reset separator 141 if ( sepPrt( os ) ) fmt( os, "%s", sepGetCur( os ) ); 142 fmt( os, "%.*Lg%+.*Lgi", LDBL_DIG, creall( ldc ), LDBL_DIG, cimagl( ldc ) ); 152 143 return os; 153 144 } // ?|? -
src/tests/gmp.c
re60e0dc r5bd0aad 10 10 // Created On : Tue Apr 19 08:55:51 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed May 24 22:05:38201713 // Update Count : 54 012 // Last Modified On : Thu Jul 13 16:35:01 2017 13 // Update Count : 541 14 14 // 15 15 … … 95 95 // Local Variables: // 96 96 // tab-width: 4 // 97 // compile-command: "cfa gmp.c -l 97 // compile-command: "cfa gmp.c -lgmp" // 98 98 // End: //
Note:
See TracChangeset
for help on using the changeset viewer.