Changes in / [0b18db7:290553a]


Ignore:
Files:
1 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • libcfa/prelude/builtins.c

    r0b18db7 r290553a  
    1010// Created On       : Fri Jul 21 16:21:03 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Oct  9 18:26:19 2020
    13 // Update Count     : 110
     12// Last Modified On : Mon Jul 13 21:10:02 2020
     13// Update Count     : 109
    1414//
    1515
     
    9494// universal typed pointer constant
    9595static 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; }
    9796
    9897#if defined(__SIZEOF_INT128__)
  • libcfa/src/concurrency/io.cfa

    r0b18db7 r290553a  
    134134                int ret = 0;
    135135                if( need_sys_to_submit || need_sys_to_complete ) {
    136                         ret = syscall( __NR_io_uring_enter, ring.fd, to_submit, 0, flags, (sigset_t *)0p, _NSIG / 8);
     136                        ret = syscall( __NR_io_uring_enter, ring.fd, to_submit, 0, flags, 0p, _NSIG / 8);
    137137                        if( ret < 0 ) {
    138138                                switch((int)errno) {
  • src/Parser/DeclarationNode.cc

    r0b18db7 r290553a  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Oct  8 08:03:38 2020
    13 // Update Count     : 1135
     12// Last Modified On : Tue Jun  9 20:26:55 2020
     13// Update Count     : 1134
    1414//
    1515
     
    10161016                        if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * >( decl ) ) {
    10171017                                dwt->location = cur->location;
    1018                                 *out++ = dwt;
     1018                                * out++ = dwt;
    10191019                        } else if ( StructDecl * agg = dynamic_cast< StructDecl * >( decl ) ) {
    10201020                                // e.g., int foo(struct S) {}
     
    10221022                                auto obj = new ObjectDecl( "", Type::StorageClasses(), linkage, nullptr, inst, nullptr );
    10231023                                obj->location = cur->location;
    1024                                 *out++ = obj;
     1024                                * out++ = obj;
    10251025                                delete agg;
    10261026                        } else if ( UnionDecl * agg = dynamic_cast< UnionDecl * >( decl ) ) {
     
    10291029                                auto obj = new ObjectDecl( "", Type::StorageClasses(), linkage, nullptr, inst, nullptr );
    10301030                                obj->location = cur->location;
    1031                                 *out++ = obj;
     1031                                * out++ = obj;
    10321032                        } else if ( EnumDecl * agg = dynamic_cast< EnumDecl * >( decl ) ) {
    10331033                                // e.g., int foo(enum E) {}
     
    10351035                                auto obj = new ObjectDecl( "", Type::StorageClasses(), linkage, nullptr, inst, nullptr );
    10361036                                obj->location = cur->location;
    1037                                 *out++ = obj;
     1037                                * out++ = obj;
    10381038                        } // if
    10391039                } catch( SemanticErrorException & e ) {
  • src/Parser/parser.yy

    r0b18db7 r290553a  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Oct  9 18:09:09 2020
    13 // Update Count     : 4614
     12// Last Modified On : Tue Oct  6 18:24:18 2020
     13// Update Count     : 4610
    1414//
    1515
     
    204204                        return forCtrl( type, new string( identifier->name ), start, compop, comp, inc );
    205205                } 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;
    207207                } // if
    208208        } 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;
    210210        } // if
    211211} // forCtrl
     
    24122412// Overloading: function, data, and operator identifiers may be overloaded.
    24132413//
    2414 // Type declarations: "otype" is used to generate new types for declaring objects. Similarly, "dtype" is used for object
     2414// Type declarations: "type" is used to generate new types for declaring objects. Similarly, "dtype" is used for object
    24152415//     and incomplete types, and "ftype" is used for function types. Type declarations with initializers provide
    24162416//     definitions of new types. Type declarations with storage class "extern" provide opaque types.
     
    24412441        type_class identifier_or_type_name
    24422442                { typedefTable.addToScope( *$2, TYPEDEFname, "9" ); }
    2443         type_initializer_opt assertion_list_opt
     2443          type_initializer_opt assertion_list_opt
    24442444                { $$ = DeclarationNode::newTypeParam( $1, $2 )->addTypeInitializer( $4 )->addAssertions( $5 ); }
    24452445        | type_specifier identifier_parameter_declarator
     
    24682468        assertion
    24692469        | assertion_list assertion
    2470                 { $$ = $1->appendList( $2 ); }
     2470                { $$ = $1 ? $1->appendList( $2 ) : $2; }
    24712471        ;
    24722472
  • src/SynTree/TypeDecl.cc

    r0b18db7 r290553a  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Oct  8 18:18:55 2020
    13 // Update Count     : 22
     12// Last Modified On : Fri Dec 13 15:26:14 2019
     13// Update Count     : 21
    1414//
    1515
     
    2121#include "Type.h"            // for Type, Type::StorageClasses
    2222
    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 ) {
     23TypeDecl::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 ) {
    2524}
    2625
  • src/main.cc

    r0b18db7 r290553a  
    99// Author           : Peter Buhr and Rob Schluntz
    1010// Created On       : Fri May 15 23:12:02 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Oct  8 18:17:46 2020
    13 // Update Count     : 637
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Tue May 19 12:03:00 2020
     13// Update Count     : 634
    1414//
    1515
     
    451451
    452452
    453 static const char optstring[] = ":c:ghlLmNnpdOAP:S:twW:D:";
     453static const char optstring[] = ":c:ghlLmNnpdP:S:twW:D:";
    454454
    455455enum { PreludeDir = 128 };
     
    478478
    479479static const char * description[] = {
    480         "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
     480        "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
    488488        "generate prototypes for prelude functions",            // -p
    489         "only print deterministic output",                  // -d
    490         "Use the old-ast",                                                                      // -O
    491         "Use the new-ast",                                                                      // -A
    492         "print",                                                                                        // -P
     489        "don't print output that isn't deterministic",        // -d
     490        "Use the old-ast",                                    // -O
     491        "Use the new-ast",                                    // -A
     492        "print",                                              // -P
    493493        "<directory> prelude directory for debug/nodebug",      // no flag
    494494        "<option-list> enable profiling information:\n          counters,heap,time,all,none", // -S
    495         "building cfa standard lib",                                            // -t
    496         "",                                                                                                     // -w
    497         "",                                                                                                     // -W
    498         "",                                                                                                     // -D
     495        "building cfa standard lib",                          // -t
     496        "",                                                   // -w
     497        "",                                                   // -W
     498        "",                                                   // -D
    499499}; // description
    500500
  • tests/.expect/init1.txt

    r0b18db7 r290553a  
    1 init1.cfa: In function '_X4mainFi___1':
    2 init1.cfa:136:9: note: #pragma message: Compiled
     1error: No reasonable alternatives for expression Untyped Init Expression
     2  Name: rx  InitAlternative: reference to signed int
     3error: No reasonable alternatives for expression Untyped Init Expression
     4  Name: px  InitAlternative: pointer to signed int
     5error: No reasonable alternatives for expression Untyped Init Expression
     6  Name: crx  InitAlternative: reference to float
     7error: No reasonable alternatives for expression Untyped Init Expression
     8  Name: cpx  InitAlternative: pointer to float
     9init1.cfa:94:1 error: No reasonable alternatives for expression Generated Cast of:
     10  Name: rx
     11... to:
     12  reference to signed int
     13init1.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
     22init1.cfa:104:1 error: No reasonable alternatives for expression Generated Cast of:
     23  Name: crx
     24... to:
     25  reference to float
     26init1.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
     35init1.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)
     39init1.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
  • tests/Makefile.am

    r0b18db7 r290553a  
    1111## Created On       : Sun May 31 09:08:15 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Fri Oct  9 23:13:07 2020
    14 ## Update Count     : 86
     13## Last Modified On : Sun Sep 27 19:01:41 2020
     14## Update Count     : 84
    1515###############################################################################
    1616
     
    141141
    142142SYNTAX_ONLY_CODE = expression typedefRedef variableDeclarator switch numericConstants identFuncDeclarator forall \
    143         init1 limits nested-types stdincludes cast labelledExit array builtins/sync warnings/self-assignment
     143        limits nested-types stdincludes cast labelledExit array builtins/sync warnings/self-assignment
    144144$(SYNTAX_ONLY_CODE): % : %.cfa $(CFACCBIN)
    145145        $(CFACOMPILE_SYNTAX)
     
    149149# use custom target since they require a custom define *and* have a name that doesn't match the file
    150150alloc-ERROR : alloc.cfa $(CFACCBIN)
    151         $(CFACOMPILE_SYNTAX) -DERR1
    152         -cp $(test) $(abspath ${@})
    153 
    154 init1-ERROR : init1.cfa $(CFACCBIN)
    155151        $(CFACOMPILE_SYNTAX) -DERR1
    156152        -cp $(test) $(abspath ${@})
  • tests/alloc.cfa

    r0b18db7 r290553a  
    1010// Created On       : Wed Feb  3 07:56:22 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Oct  9 23:03:11 2020
    13 // Update Count     : 431
     12// Last Modified On : Fri Aug 14 16:59:59 2020
     13// Update Count     : 430
    1414//
    1515
     
    362362        ip = memset( stp, 10 );
    363363        ip = memcpy( &st1, &st );
    364 #endif // ERR1
     364#endif
    365365} // main
    366366
  • tests/errors/.expect/completeType.x64.txt

    r0b18db7 r290553a  
    132132?=?: pointer to function
    133133        ... with parameters
    134           reference to instance of type _110_0_T (not function type)
    135           instance of type _110_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)
    136136        ... returning
    137           _retval__operator_assign: instance of type _110_0_T (not function type)
     137          _retval__operator_assign: instance of type _109_0_T (not function type)
    138138          ... with attributes:
    139139            Attribute with name: unused
  • tests/errors/.expect/completeType.x86.txt

    r0b18db7 r290553a  
    132132?=?: pointer to function
    133133        ... with parameters
    134           reference to instance of type _109_0_T (not function type)
    135           instance of type _109_0_T (not function type)
     134          reference to instance of type _108_0_T (not function type)
     135          instance of type _108_0_T (not function type)
    136136        ... returning
    137           _retval__operator_assign: instance of type _109_0_T (not function type)
     137          _retval__operator_assign: instance of type _108_0_T (not function type)
    138138          ... with attributes:
    139139            Attribute with name: unused
  • tests/init1.cfa

    r0b18db7 r290553a  
    99// Author           : Michael Brooks
    1010// Created On       : Thu Jul 16 22:00:00 2020
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Oct 11 10:26:50 2020
    13 // Update Count     : 8
     11// Last Modified By : Michael Brooks
     12// Last Modified On : Thu Jul 16 22:00:00 2020
     13// Update Count     : 1
    1414//
    1515
     
    4141    const float * cpx2 = cpx;
    4242
    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 
    5043    //
    5144    // unsound initializations
    5245    //
    5346
    54     #ifdef ERR1
    5547    // mismatched referenced type
    5648    int & ry = rx;
     
    6052    float & ry2 = crx;
    6153    float * py2 = cpx;
    62     #endif // ERR1
    6354}
    6455
     
    9990//
    10091
    101 #ifdef ERR1
    10292int & f_ry() {
    10393    float & rx = *0p;
     
    129119    return s;               // mismatched referenced type
    130120}
    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.