Ignore:
Timestamp:
Jul 2, 2026, 5:07:05 PM (2 days ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
7886a92f
Parents:
16d862d
Message:

remove addDataSectionAttribute hack and handle dynamic initialization of const definitions by removing the const after resolution

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/InitTweak.cpp

    r16d862d r13481af0  
    99// Author           : Rob Schluntz
    1010// Created On       : Fri May 13 11:26:36 2016
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Sep 22  9:50:00 2022
    13 // Update Count     : 21
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Jul  2 16:47:11 2026
     13// Update Count     : 44
    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
    435 static const char * const data_section =  ".data" ASM_COMMENT;
    436 static const char * const tlsd_section = ".tdata" ASM_COMMENT;
    437 
    438 void 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 
    446430InitExpander::InitExpander( const ast::Init * init )
    447431: expander( new InitImpl{ init } ), crnt(), indices() {}
Note: See TracChangeset for help on using the changeset viewer.