Changeset 0b18db7
- Timestamp:
 - Oct 14, 2020, 10:58:14 AM (5 years ago)
 - Branches:
 - ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
 - Children:
 - 223a633, d21dd3cb, f1791a4
 - Parents:
 - 290553a (diff), 8fd0ce3 (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. - Files:
 - 
      
- 1 added
 - 12 edited
 
- 
          
  libcfa/prelude/builtins.c (modified) (2 diffs)
 - 
          
  libcfa/src/concurrency/io.cfa (modified) (1 diff)
 - 
          
  src/Parser/DeclarationNode.cc (modified) (5 diffs)
 - 
          
  src/Parser/parser.yy (modified) (5 diffs)
 - 
          
  src/SynTree/TypeDecl.cc (modified) (2 diffs)
 - 
          
  src/main.cc (modified) (3 diffs)
 - 
          
  tests/.expect/init1-ERROR.txt (added)
 - 
          
  tests/.expect/init1.txt (modified) (1 diff)
 - 
          
  tests/Makefile.am (modified) (3 diffs)
 - 
          
  tests/alloc.cfa (modified) (2 diffs)
 - 
          
  tests/errors/.expect/completeType.x64.txt (modified) (1 diff)
 - 
          
  tests/errors/.expect/completeType.x86.txt (modified) (1 diff)
 - 
          
  tests/init1.cfa (modified) (5 diffs)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
libcfa/prelude/builtins.c
r290553a r0b18db7 10 10 // Created On : Fri Jul 21 16:21:03 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jul 13 21:10:02202013 // Update Count : 1 0912 // Last Modified On : Fri Oct 9 18:26:19 2020 13 // Update Count : 110 14 14 // 15 15 … … 94 94 // universal typed pointer constant 95 95 static inline forall( dtype DT ) DT * intptr( uintptr_t addr ) { return (DT *)addr; } 96 static inline forall( ftype FT ) FT * intptr( uintptr_t addr ) { return (FT *)addr; } 96 97 97 98 #if defined(__SIZEOF_INT128__)  - 
      
libcfa/src/concurrency/io.cfa
r290553a r0b18db7 134 134 int ret = 0; 135 135 if( need_sys_to_submit || need_sys_to_complete ) { 136 ret = syscall( __NR_io_uring_enter, ring.fd, to_submit, 0, flags, 0p, _NSIG / 8);136 ret = syscall( __NR_io_uring_enter, ring.fd, to_submit, 0, flags, (sigset_t *)0p, _NSIG / 8); 137 137 if( ret < 0 ) { 138 138 switch((int)errno) {  - 
      
src/Parser/DeclarationNode.cc
r290553a r0b18db7 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Jun 9 20:26:55202013 // Update Count : 113 412 // Last Modified On : Thu Oct 8 08:03:38 2020 13 // Update Count : 1135 14 14 // 15 15 … … 1016 1016 if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * >( decl ) ) { 1017 1017 dwt->location = cur->location; 1018 * out++ = dwt;1018 *out++ = dwt; 1019 1019 } else if ( StructDecl * agg = dynamic_cast< StructDecl * >( decl ) ) { 1020 1020 // e.g., int foo(struct S) {} … … 1022 1022 auto obj = new ObjectDecl( "", Type::StorageClasses(), linkage, nullptr, inst, nullptr ); 1023 1023 obj->location = cur->location; 1024 * out++ = obj;1024 *out++ = obj; 1025 1025 delete agg; 1026 1026 } else if ( UnionDecl * agg = dynamic_cast< UnionDecl * >( decl ) ) { … … 1029 1029 auto obj = new ObjectDecl( "", Type::StorageClasses(), linkage, nullptr, inst, nullptr ); 1030 1030 obj->location = cur->location; 1031 * out++ = obj;1031 *out++ = obj; 1032 1032 } else if ( EnumDecl * agg = dynamic_cast< EnumDecl * >( decl ) ) { 1033 1033 // e.g., int foo(enum E) {} … … 1035 1035 auto obj = new ObjectDecl( "", Type::StorageClasses(), linkage, nullptr, inst, nullptr ); 1036 1036 obj->location = cur->location; 1037 * out++ = obj;1037 *out++ = obj; 1038 1038 } // if 1039 1039 } catch( SemanticErrorException & e ) {  - 
      
src/Parser/parser.yy
r290553a r0b18db7 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Oct 6 18:24:18202013 // Update Count : 461 012 // Last Modified On : Fri Oct 9 18:09:09 2020 13 // Update Count : 4614 14 14 // 15 15 … … 204 204 return forCtrl( type, new string( identifier->name ), start, compop, comp, inc ); 205 205 } else { 206 SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed " ); return nullptr;206 SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed." ); return nullptr; 207 207 } // if 208 208 } else { 209 SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed " ); return nullptr;209 SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed." ); return nullptr; 210 210 } // if 211 211 } // forCtrl … … 2412 2412 // Overloading: function, data, and operator identifiers may be overloaded. 2413 2413 // 2414 // Type declarations: " type" is used to generate new types for declaring objects. Similarly, "dtype" is used for object2414 // Type declarations: "otype" is used to generate new types for declaring objects. Similarly, "dtype" is used for object 2415 2415 // and incomplete types, and "ftype" is used for function types. Type declarations with initializers provide 2416 2416 // definitions of new types. Type declarations with storage class "extern" provide opaque types. … … 2441 2441 type_class identifier_or_type_name 2442 2442 { typedefTable.addToScope( *$2, TYPEDEFname, "9" ); } 2443 type_initializer_opt assertion_list_opt2443 type_initializer_opt assertion_list_opt 2444 2444 { $$ = DeclarationNode::newTypeParam( $1, $2 )->addTypeInitializer( $4 )->addAssertions( $5 ); } 2445 2445 | type_specifier identifier_parameter_declarator … … 2468 2468 assertion 2469 2469 | assertion_list assertion 2470 { $$ = $1 ? $1->appendList( $2 ) : $2; }2470 { $$ = $1->appendList( $2 ); } 2471 2471 ; 2472 2472  - 
      
src/SynTree/TypeDecl.cc
r290553a r0b18db7 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Dec 13 15:26:14 201913 // Update Count : 2 112 // Last Modified On : Thu Oct 8 18:18:55 2020 13 // Update Count : 22 14 14 // 15 15 … … 21 21 #include "Type.h" // for Type, Type::StorageClasses 22 22 23 TypeDecl::TypeDecl( const std::string & name, Type::StorageClasses scs, Type * type, Kind kind, bool sized, Type * init ) : Parent( name, scs, type ), kind( kind ), sized( kind == Ttype || sized ), init( init ) { 23 TypeDecl::TypeDecl( const std::string & name, Type::StorageClasses scs, Type * type, Kind kind, bool sized, Type * init ) : 24 Parent( name, scs, type ), kind( kind ), sized( kind == Ttype || sized ), init( init ) { 24 25 } 25 26  - 
      
src/main.cc
r290553a r0b18db7 9 9 // Author : Peter Buhr and Rob Schluntz 10 10 // Created On : Fri May 15 23:12:02 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : T ue May 19 12:03:00202013 // Update Count : 63 411 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Oct 8 18:17:46 2020 13 // Update Count : 637 14 14 // 15 15 … … 451 451 452 452 453 static const char optstring[] = ":c:ghlLmNnpd P:S:twW:D:";453 static const char optstring[] = ":c:ghlLmNnpdOAP:S:twW:D:"; 454 454 455 455 enum { PreludeDir = 128 }; … … 478 478 479 479 static const char * description[] = { 480 "diagnostic color: never, always, or auto.", // -c481 "wait for gdb to attach", // -g482 "print help message", // -h483 "generate libcfa.c", // -l484 "generate line marks", // -L485 "do not replace main", // -m486 "do not generate line marks", // -N487 "do not read prelude", // -n480 "diagnostic color: never, always, or auto.", // -c 481 "wait for gdb to attach", // -g 482 "print help message", // -h 483 "generate libcfa.c", // -l 484 "generate line marks", // -L 485 "do not replace main", // -m 486 "do not generate line marks", // -N 487 "do not read prelude", // -n 488 488 "generate prototypes for prelude functions", // -p 489 " don't print output that isn't deterministic",// -d490 "Use the old-ast", // -O491 "Use the new-ast", // -A492 "print", // -P489 "only print deterministic output", // -d 490 "Use the old-ast", // -O 491 "Use the new-ast", // -A 492 "print", // -P 493 493 "<directory> prelude directory for debug/nodebug", // no flag 494 494 "<option-list> enable profiling information:\n counters,heap,time,all,none", // -S 495 "building cfa standard lib", // -t496 "", // -w497 "", // -W498 "", // -D495 "building cfa standard lib", // -t 496 "", // -w 497 "", // -W 498 "", // -D 499 499 }; // description 500 500  - 
      
tests/.expect/init1.txt
r290553a r0b18db7 1 error: No reasonable alternatives for expression Untyped Init Expression 2 Name: rx InitAlternative: reference to signed int 3 error: No reasonable alternatives for expression Untyped Init Expression 4 Name: px InitAlternative: pointer to signed int 5 error: No reasonable alternatives for expression Untyped Init Expression 6 Name: crx InitAlternative: reference to float 7 error: No reasonable alternatives for expression Untyped Init Expression 8 Name: cpx InitAlternative: pointer to float 9 init1.cfa:94:1 error: No reasonable alternatives for expression Generated Cast of: 10 Name: rx 11 ... to: 12 reference to signed int 13 init1.cfa:97:1 error: No reasonable alternatives for expression Applying untyped: 14 Name: ?{} 15 ...to: 16 Generated Cast of: 17 Variable Expression: _retval_f_py: pointer to signed int 18 ... to: 19 reference to pointer to signed int 20 Name: px 21 22 init1.cfa:104:1 error: No reasonable alternatives for expression Generated Cast of: 23 Name: crx 24 ... to: 25 reference to float 26 init1.cfa:107:1 error: No reasonable alternatives for expression Applying untyped: 27 Name: ?{} 28 ...to: 29 Generated Cast of: 30 Variable Expression: _retval_f_py2: pointer to float 31 ... to: 32 reference to pointer to float 33 Name: cpx 34 35 init1.cfa:114:1 error: No reasonable alternatives for expression Generated Cast of: 36 Name: s 37 ... to: 38 reference to instance of type T (not function type) 39 init1.cfa:118:1 error: No reasonable alternatives for expression Applying untyped: 40 Name: ?{} 41 ...to: 42 Generated Cast of: 43 Variable Expression: _retval_anycvt: pointer to instance of type T (not function type) 44 ... to: 45 reference to pointer to instance of type T (not function type) 46 Name: s 47 1 init1.cfa: In function '_X4mainFi___1': 2 init1.cfa:136:9: note: #pragma message: Compiled  - 
      
tests/Makefile.am
r290553a r0b18db7 11 11 ## Created On : Sun May 31 09:08:15 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Sun Sep 27 19:01:41202014 ## Update Count : 8 413 ## Last Modified On : Fri Oct 9 23:13:07 2020 14 ## Update Count : 86 15 15 ############################################################################### 16 16 … … 141 141 142 142 SYNTAX_ONLY_CODE = expression typedefRedef variableDeclarator switch numericConstants identFuncDeclarator forall \ 143 limits nested-types stdincludes cast labelledExit array builtins/sync warnings/self-assignment143 init1 limits nested-types stdincludes cast labelledExit array builtins/sync warnings/self-assignment 144 144 $(SYNTAX_ONLY_CODE): % : %.cfa $(CFACCBIN) 145 145 $(CFACOMPILE_SYNTAX) … … 149 149 # use custom target since they require a custom define *and* have a name that doesn't match the file 150 150 alloc-ERROR : alloc.cfa $(CFACCBIN) 151 $(CFACOMPILE_SYNTAX) -DERR1 152 -cp $(test) $(abspath ${@}) 153 154 init1-ERROR : init1.cfa $(CFACCBIN) 151 155 $(CFACOMPILE_SYNTAX) -DERR1 152 156 -cp $(test) $(abspath ${@})  - 
      
tests/alloc.cfa
r290553a r0b18db7 10 10 // Created On : Wed Feb 3 07:56:22 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Aug 14 16:59:59202013 // Update Count : 43 012 // Last Modified On : Fri Oct 9 23:03:11 2020 13 // Update Count : 431 14 14 // 15 15 … … 362 362 ip = memset( stp, 10 ); 363 363 ip = memcpy( &st1, &st ); 364 #endif 364 #endif // ERR1 365 365 } // main 366 366  - 
      
tests/errors/.expect/completeType.x64.txt
r290553a r0b18db7 132 132 ?=?: pointer to function 133 133 ... with parameters 134 reference to instance of type _1 09_0_T (not function type)135 instance of type _1 09_0_T (not function type)134 reference to instance of type _110_0_T (not function type) 135 instance of type _110_0_T (not function type) 136 136 ... returning 137 _retval__operator_assign: instance of type _1 09_0_T (not function type)137 _retval__operator_assign: instance of type _110_0_T (not function type) 138 138 ... with attributes: 139 139 Attribute with name: unused  - 
      
tests/errors/.expect/completeType.x86.txt
r290553a r0b18db7 132 132 ?=?: pointer to function 133 133 ... with parameters 134 reference to instance of type _10 8_0_T (not function type)135 instance of type _10 8_0_T (not function type)134 reference to instance of type _109_0_T (not function type) 135 instance of type _109_0_T (not function type) 136 136 ... returning 137 _retval__operator_assign: instance of type _10 8_0_T (not function type)137 _retval__operator_assign: instance of type _109_0_T (not function type) 138 138 ... with attributes: 139 139 Attribute with name: unused  - 
      
tests/init1.cfa
r290553a r0b18db7 9 9 // Author : Michael Brooks 10 10 // Created On : Thu Jul 16 22:00:00 2020 11 // Last Modified By : Michael Brooks12 // Last Modified On : Thu Jul 16 22:00:00 202013 // Update Count : 111 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Oct 11 10:26:50 2020 13 // Update Count : 8 14 14 // 15 15 … … 41 41 const float * cpx2 = cpx; 42 42 43 // FIX ME: Code gen not producing correct cast. 44 #pragma GCC diagnostic push 45 #pragma GCC diagnostic ignored "-Wincompatible-pointer-types" 46 int (* fp)( int ) = 0p; 47 fp = 0p; 48 #pragma GCC diagnostic pop 49 43 50 // 44 51 // unsound initializations 45 52 // 46 53 54 #ifdef ERR1 47 55 // mismatched referenced type 48 56 int & ry = rx; … … 52 60 float & ry2 = crx; 53 61 float * py2 = cpx; 62 #endif // ERR1 54 63 } 55 64 … … 90 99 // 91 100 101 #ifdef ERR1 92 102 int & f_ry() { 93 103 float & rx = *0p; … … 119 129 return s; // mismatched referenced type 120 130 } 131 #endif // ERR1 132 133 int main() { 134 #pragma message( "Compiled" ) // force non-empty .expect file 135 }  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.