Changeset 1633e04 for src


Ignore:
Timestamp:
Mar 24, 2023, 4:44:50 PM (2 years ago)
Author:
caparson <caparson@…>
Branches:
ADT, ast-experimental, master
Children:
75d874a
Parents:
d30e3eb (diff), 056bee8 (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
src
Files:
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Print.cpp

    rd30e3eb r1633e04  
    369369                                --indent;
    370370                        }
     371                }
     372
     373                if ( ! node->withExprs.empty() ) {
     374                        // Not with a clause, but the 'with clause'.
     375                        ++indent;
     376                        os << " with clause" << endl << indent;
     377                        printAll( node->withExprs );
     378                        --indent;
    371379                }
    372380
  • src/Common/module.mk

    rd30e3eb r1633e04  
    2020        Common/CodeLocationTools.hpp \
    2121        Common/CodeLocationTools.cpp \
    22         Common/Debug.h \
    2322        Common/DeclStats.hpp \
    2423        Common/DeclStats.cpp \
  • src/Common/utility.h

    rd30e3eb r1633e04  
    190190}
    191191
    192 template< typename... Params >
    193 void warn( const Params & ... params ) {
    194         std::cerr << "Warning: ";
    195         toString_single( std::cerr, params... );
    196         std::cerr << std::endl;
    197 }
    198 
    199192// determines if pref is a prefix of str
    200193static inline bool isPrefix( const std::string & str, const std::string & pref, unsigned int start = 0 ) {
  • src/InitTweak/FixInit.cc

    rd30e3eb r1633e04  
    12331233                }
    12341234
    1235                 template< typename Visitor, typename... Params >
    1236                 void error( Visitor & v, CodeLocation loc, const Params &... params ) {
    1237                         SemanticErrorException err( loc, toString( params... ) );
    1238                         v.errors.append( err );
    1239                 }
    1240 
    12411235                template< typename... Params >
    12421236                void GenStructMemberCalls::emit( CodeLocation loc, const Params &... params ) {
    1243                         // toggle warnings vs. errors here.
    1244                         // warn( params... );
    1245                         error( *this, loc, params... );
     1237                        SemanticErrorException err( loc, toString( params... ) );
     1238                        errors.append( err );
    12461239                }
    12471240
  • src/InitTweak/FixInitNew.cpp

    rd30e3eb r1633e04  
    13031303        }
    13041304
    1305         template< typename Visitor, typename... Params >
    1306         void error( Visitor & v, CodeLocation loc, const Params &... params ) {
    1307                 SemanticErrorException err( loc, toString( params... ) );
    1308                 v.errors.append( err );
    1309         }
    1310 
    13111305        template< typename... Params >
    13121306        void GenStructMemberCalls::emit( CodeLocation loc, const Params &... params ) {
    1313                 // toggle warnings vs. errors here.
    1314                 // warn( params... );
    1315                 error( *this, loc, params... );
     1307                SemanticErrorException err( loc, toString( params... ) );
     1308                errors.append( err );
    13161309        }
    13171310
  • src/Parser/parser.yy

    rd30e3eb r1633e04  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Mar 21 19:01:00 2023
    13 // Update Count     : 5990
     12// Last Modified On : Wed Mar 22 21:26:01 2023
     13// Update Count     : 6002
    1414//
    1515
     
    270270        SemanticError( yylloc, ::toString( "Identifier \"", identifier, "\" cannot appear before a ", kind, ".\n"
    271271                                   "Possible cause is misspelled storage/CV qualifier, misspelled typename, or missing generic parameter." ) );
     272} // IdentifierBeforeType
     273
     274static bool TypedefForall( DeclarationNode * decl ) {
     275        if ( decl->type->forall || (decl->type->kind == TypeData::Aggregate && decl->type->aggregate.params) ) {
     276                SemanticError( yylloc, "forall qualifier in typedef is currently unimplemented." );
     277                return true;
     278        } // if
     279        return false;
    272280} // IdentifierBeforeType
    273281
     
    19581966        TYPEDEF type_specifier declarator
    19591967                {
    1960                         // if type_specifier is an anon aggregate => name
    19611968                        typedefTable.addToEnclosingScope( *$3->name, TYPEDEFname, "4" );
    1962                         $$ = $3->addType( $2 )->addTypedef();           // watchout frees $2 and $3
     1969                        if ( TypedefForall( $2 ) ) $$ = nullptr;
     1970                        else $$ = $3->addType( $2 )->addTypedef();              // watchout frees $2 and $3
    19631971                }
    19641972        | typedef_declaration pop ',' push declarator
     
    19701978                {
    19711979                        typedefTable.addToEnclosingScope( *$4->name, TYPEDEFname, "6" );
    1972                         $$ = $4->addQualifiers( $1 )->addType( $3 )->addTypedef();
     1980                        if ( TypedefForall( $1 ) ) $$ = nullptr;
     1981                        else $$ = $4->addQualifiers( $1 )->addType( $3 )->addTypedef();
    19731982                }
    19741983        | type_specifier TYPEDEF declarator
    19751984                {
    19761985                        typedefTable.addToEnclosingScope( *$3->name, TYPEDEFname, "7" );
    1977                         $$ = $3->addType( $1 )->addTypedef();
     1986                        if ( TypedefForall( $1 ) ) $$ = nullptr;
     1987                        else $$ = $3->addType( $1 )->addTypedef();
    19781988                }
    19791989        | type_specifier TYPEDEF type_qualifier_list declarator
    19801990                {
    19811991                        typedefTable.addToEnclosingScope( *$4->name, TYPEDEFname, "8" );
    1982                         $$ = $4->addQualifiers( $1 )->addType( $1 )->addTypedef();
     1992                        if ( TypedefForall( $3 ) ) $$ = nullptr;
     1993                        else $$ = $4->addQualifiers( $1 )->addType( $1 )->addTypedef();
    19831994                }
    19841995        ;
  • src/SynTree/FunctionDecl.cc

    rd30e3eb r1633e04  
    8787        } // if
    8888
     89        if ( !withExprs.empty() ) {
     90                os << indent << "... with clause" << std::endl;
     91                os << indent + 1;
     92                printAll( withExprs, os, indent + 1 );
     93        }
     94
    8995        if ( statements ) {
    9096                os << indent << "... with body" << endl << indent+1;
Note: See TracChangeset for help on using the changeset viewer.