Changeset 6e2b04e for src


Ignore:
Timestamp:
Jun 8, 2022, 4:23:41 PM (3 years ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
7f0ac12, db7a3ad
Parents:
55422cf (diff), 720f2fe2 (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 added
8 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/Waitfor.cc

    r55422cf r6e2b04e  
    5656                      |  |
    5757                      |  |
    58                             |  |
     58                      |  |
    5959                      |  |
    6060                      |  |
  • src/Concurrency/Waitfor.h

    r55422cf r6e2b04e  
    1919
    2020class Declaration;
     21namespace ast {
     22        class TranslationUnit;
     23}
    2124
    2225namespace Concurrency {
    2326        void generateWaitFor( std::list< Declaration * > & translationUnit );
     27
     28void generateWaitFor( ast::TranslationUnit & translationUnit );
    2429};
    2530
  • src/Concurrency/module.mk

    r55422cf r6e2b04e  
    1919        Concurrency/Keywords.cc \
    2020        Concurrency/Keywords.h \
     21        Concurrency/WaitforNew.cpp \
    2122        Concurrency/Waitfor.cc \
    2223        Concurrency/Waitfor.h
  • src/InitTweak/FixGlobalInit.cc

    r55422cf r6e2b04e  
    162162                        } // if
    163163                        if ( Statement * ctor = ctorInit->ctor ) {
    164                                 addDataSectonAttribute( objDecl );
     164                                addDataSectionAttribute( objDecl );
    165165                                initStatements.push_back( ctor );
    166166                                objDecl->init = nullptr;
  • src/InitTweak/FixInit.cc

    r55422cf r6e2b04e  
    806806                                                // The attribute works, and is meant to apply, both for leaving the static local alone,
    807807                                                // and for hoisting it out as a static global.
    808                                                 addDataSectonAttribute( objDecl );
     808                                                addDataSectionAttribute( objDecl );
    809809
    810810                                                // originally wanted to take advantage of gcc nested functions, but
  • src/InitTweak/InitTweak.cc

    r55422cf r6e2b04e  
    587587
    588588        bool isConstructable( const ast::Type * type ) {
    589                 return ! dynamic_cast< const ast::VarArgsType * >( type ) && ! dynamic_cast< const ast::ReferenceType * >( type ) 
     589                return ! dynamic_cast< const ast::VarArgsType * >( type ) && ! dynamic_cast< const ast::ReferenceType * >( type )
    590590                && ! dynamic_cast< const ast::FunctionType * >( type ) && ! Tuples::isTtype( type );
    591591        }
     
    10251025                if (!assign) {
    10261026                        auto td = new ast::TypeDecl({}, "T", {}, nullptr, ast::TypeDecl::Dtype, true);
    1027                         assign = new ast::FunctionDecl({}, "?=?", {}, 
     1027                        assign = new ast::FunctionDecl({}, "?=?", {},
    10281028                        { new ast::ObjectDecl({}, "_dst", new ast::ReferenceType(new ast::TypeInstType("T", td))),
    10291029                          new ast::ObjectDecl({}, "_src", new ast::TypeInstType("T", td))},
     
    10951095
    10961096                        // address of a variable or member expression is constexpr
    1097                         if ( ! dynamic_cast< const ast::NameExpr * >( arg ) 
    1098                         && ! dynamic_cast< const ast::VariableExpr * >( arg ) 
    1099                         && ! dynamic_cast< const ast::MemberExpr * >( arg ) 
     1097                        if ( ! dynamic_cast< const ast::NameExpr * >( arg )
     1098                        && ! dynamic_cast< const ast::VariableExpr * >( arg )
     1099                        && ! dynamic_cast< const ast::MemberExpr * >( arg )
    11001100                        && ! dynamic_cast< const ast::UntypedMemberExpr * >( arg ) ) result = false;
    11011101                }
     
    12411241        }
    12421242
    1243         void addDataSectonAttribute( ObjectDecl * objDecl ) {
     1243        #if defined( __x86_64 ) || defined( __i386 ) // assembler comment to prevent assembler warning message
     1244                #define ASM_COMMENT "#"
     1245        #else // defined( __ARM_ARCH )
     1246                #define ASM_COMMENT "//"
     1247        #endif
     1248        static const char * const data_section =  ".data" ASM_COMMENT;
     1249        static const char * const tlsd_section = ".tdata" ASM_COMMENT;
     1250        void addDataSectionAttribute( ObjectDecl * objDecl ) {
     1251                const bool is_tls = objDecl->get_storageClasses().is_threadlocal;
     1252                const char * section = is_tls ? tlsd_section : data_section;
    12441253                objDecl->attributes.push_back(new Attribute("section", {
    1245                         new ConstantExpr( Constant::from_string(".data"
    1246 #if defined( __x86_64 ) || defined( __i386 ) // assembler comment to prevent assembler warning message
    1247                                         "#"
    1248 #else // defined( __ARM_ARCH )
    1249                                         "//"
    1250 #endif
    1251                                 ))}));
     1254                        new ConstantExpr( Constant::from_string( section ) )
     1255                }));
    12521256        }
    12531257
    12541258        void addDataSectionAttribute( ast::ObjectDecl * objDecl ) {
     1259                const bool is_tls = objDecl->storage.is_threadlocal;
     1260                const char * section = is_tls ? tlsd_section : data_section;
    12551261                objDecl->attributes.push_back(new ast::Attribute("section", {
    1256                         ast::ConstantExpr::from_string(objDecl->location, ".data"
    1257 #if defined( __x86_64 ) || defined( __i386 ) // assembler comment to prevent assembler warning message
    1258                                         "#"
    1259 #else // defined( __ARM_ARCH )
    1260                                         "//"
    1261 #endif
    1262                                 )}));
     1262                        ast::ConstantExpr::from_string(objDecl->location, section)
     1263                }));
    12631264        }
    12641265
  • src/InitTweak/InitTweak.h

    r55422cf r6e2b04e  
    127127        ///    .section .data#,"a"
    128128        /// to avoid assembler warning "ignoring changed section attributes for .data"
    129         void addDataSectonAttribute( ObjectDecl * objDecl );
     129        void addDataSectionAttribute( ObjectDecl * objDecl );
    130130
    131131        void addDataSectionAttribute( ast::ObjectDecl * objDecl );
  • src/main.cc

    r55422cf r6e2b04e  
    1010// Created On       : Fri May 15 23:12:02 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Apr 29  9:52:00 2022
    13 // Update Count     : 673
     12// Last Modified On : Tue Jun  7 13:29:00 2022
     13// Update Count     : 674
    1414//
    1515
     
    447447                        PASS( "Expand Unique Expr", Tuples::expandUniqueExpr( transUnit ) ); // xxx - is this the right place for this? want to expand ASAP so tha, sequent passes don't need to worry about double-visiting a unique expr - needs to go after InitTweak::fix so that copy constructed return declarations are reused
    448448
    449                         PASS( "Translate Tries" , ControlStruct::translateTries( transUnit ) );
     449                        PASS( "Translate Tries", ControlStruct::translateTries( transUnit ) );
     450                        PASS( "Gen Waitfor", Concurrency::generateWaitFor( transUnit ) );
    450451
    451452                        translationUnit = convert( move( transUnit ) );
     
    517518
    518519                        PASS( "Expand Unique Expr", Tuples::expandUniqueExpr( translationUnit ) ); // xxx - is this the right place for this? want to expand ASAP so tha, sequent passes don't need to worry about double-visiting a unique expr - needs to go after InitTweak::fix so that copy constructed return declarations are reused
    519 
    520                         PASS( "Translate Tries" , ControlStruct::translateTries( translationUnit ) );
     520                        PASS( "Translate Tries", ControlStruct::translateTries( translationUnit ) );
     521                        PASS( "Gen Waitfor", Concurrency::generateWaitFor( translationUnit ) );
    521522                }
    522 
    523                 PASS( "Gen Waitfor" , Concurrency::generateWaitFor( translationUnit ) );
    524523
    525524                PASS( "Convert Specializations",  GenPoly::convertSpecializations( translationUnit ) ); // needs to happen before tuple types are expanded
Note: See TracChangeset for help on using the changeset viewer.