Ignore:
Timestamp:
Jun 21, 2022, 1:39:24 PM (22 months ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
b62d1d6
Parents:
1df492a (diff), 1dbbef6 (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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/InitTweak.cc

    r1df492a reb5962a  
    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
Note: See TracChangeset for help on using the changeset viewer.