Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/InitTweak.cpp

    r13481af0 ref05cf0  
    99// Author           : Rob Schluntz
    1010// Created On       : Fri May 13 11:26:36 2016
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul  2 16:47:11 2026
    13 // Update Count     : 44
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Sep 22  9:50:00 2022
     13// Update Count     : 21
    1414//
    1515
     
    428428}
    429429
     430#if defined( __x86_64 ) || defined( __i386 ) // assembler comment to prevent assembler warning message
     431        #define ASM_COMMENT "#"
     432#else // defined( __ARM_ARCH )
     433        #define ASM_COMMENT "//"
     434#endif
     435static const char * const data_section =  ".data" ASM_COMMENT;
     436static const char * const tlsd_section = ".tdata" ASM_COMMENT;
     437
     438void addDataSectionAttribute( ast::ObjectDecl * objDecl ) {
     439        const bool is_tls = objDecl->storage.is_threadlocal_any();
     440        const char * section = is_tls ? tlsd_section : data_section;
     441        objDecl->attributes.push_back(new ast::Attribute("section", {
     442                ast::ConstantExpr::from_string(objDecl->location, section)
     443        }));
     444}
     445
    430446InitExpander::InitExpander( const ast::Init * init )
    431447: expander( new InitImpl{ init } ), crnt(), indices() {}
Note: See TracChangeset for help on using the changeset viewer.