Changeset ed9a1ae for src/Parser


Ignore:
Timestamp:
Aug 31, 2022, 10:57:37 AM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master, pthread-emulation
Children:
64af7ac
Parents:
dc708c1
Message:

Cfa now distinguishes between thread and _Thread_local.

Location:
src/Parser
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/Parser/DeclarationNode.cc

    rdc708c1 red9a1ae  
    262262        newnode->type->enumeration.anon = name == nullptr;
    263263        if ( base && base->type)  {
    264                 newnode->type->base = base->type;       
     264                newnode->type->base = base->type;
    265265        } // if
    266266
     
    505505                        } // for
    506506                        // src is the new item being added and has a single bit
    507                 } else if ( ! src->storageClasses.is_threadlocal ) { // conflict ?
     507                } else if ( ! src->storageClasses.is_threadlocal_any() ) { // conflict ?
    508508                        appendError( error, string( "conflicting " ) + Type::StorageClassesNames[storageClasses.ffs()] +
    509509                                                 " & " + Type::StorageClassesNames[src->storageClasses.ffs()] );
  • TabularUnified src/Parser/lex.ll

    rdc708c1 red9a1ae  
    314314switch                  { KEYWORD_RETURN(SWITCH); }
    315315thread                  { KEYWORD_RETURN(THREAD); }                             // C11
    316 __thread                { KEYWORD_RETURN(THREADLOCAL); }                // GCC
    317 _Thread_local   { KEYWORD_RETURN(THREADLOCAL); }                // C11
     316__thread                { KEYWORD_RETURN(THREADLOCALGCC); }             // GCC
     317_Thread_local   { KEYWORD_RETURN(THREADLOCALC11); }             // C11
    318318throw                   { KEYWORD_RETURN(THROW); }                              // CFA
    319319throwResume             { KEYWORD_RETURN(THROWRESUME); }                // CFA
  • TabularUnified src/Parser/parser.yy

    rdc708c1 red9a1ae  
    293293%token TYPEDEF
    294294%token EXTERN STATIC AUTO REGISTER
    295 %token THREADLOCAL                                                                              // C11
     295%token THREADLOCALGCC THREADLOCALC11                                            // GCC, C11
    296296%token INLINE FORTRAN                                                                   // C99, extension ISO/IEC 9899:1999 Section J.5.9(1)
    297297%token NORETURN                                                                                 // C11
     
    13451345                {
    13461346                        if ( $2 == OperKinds::LThan || $2 == OperKinds::LEThan ) { SemanticError( yylloc, MISSING_ANON_FIELD ); $$ = nullptr; }
    1347                         else { SemanticError( yylloc, MISSING_HIGH ); $$ = nullptr; } 
     1347                        else { SemanticError( yylloc, MISSING_HIGH ); $$ = nullptr; }
    13481348                }
    13491349        | comma_expression updowneq comma_expression '~' comma_expression // CFA, anonymous loop-index
     
    13571357                {
    13581358                        if ( $2 == OperKinds::LThan || $2 == OperKinds::LEThan ) { SemanticError( yylloc, MISSING_ANON_FIELD ); $$ = nullptr; }
    1359                         else { SemanticError( yylloc, MISSING_HIGH ); $$ = nullptr; } 
     1359                        else { SemanticError( yylloc, MISSING_HIGH ); $$ = nullptr; }
    13601360                }
    13611361        | comma_expression updowneq comma_expression '~' '@' // CFA, error
     
    20822082        | REGISTER
    20832083                { $$ = DeclarationNode::newStorageClass( Type::Register ); }
    2084         | THREADLOCAL                                                                           // C11
    2085                 { $$ = DeclarationNode::newStorageClass( Type::Threadlocal ); }
     2084        | THREADLOCALGCC                                                                                // GCC
     2085                { $$ = DeclarationNode::newStorageClass( Type::ThreadlocalGcc ); }
     2086        | THREADLOCALC11                                                                                // C11
     2087                { $$ = DeclarationNode::newStorageClass( Type::ThreadlocalC11 ); }
    20862088                // Put function specifiers here to simplify parsing rules, but separate them semantically.
    20872089        | INLINE                                                                                        // C99
Note: See TracChangeset for help on using the changeset viewer.