Changeset 4226eed for src/Validate


Ignore:
Timestamp:
Mar 27, 2026, 6:50:46 AM (5 days ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
00675ed4
Parents:
e426c6f
Message:

temporary fix for auto-gen destructors using linkonce

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Validate/Autogen.cpp

    re426c6f r4226eed  
    99// Author           : Andrew Beach
    1010// Created On       : Thu Dec  2 13:44:00 2021
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Tue Sep 20 16:00:00 2022
    13 // Update Count     : 2
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Fri Mar 27 06:44:33 2026
     13// Update Count     : 3
    1414//
    1515
     
    401401                add_qualifiers( dst->type, ast::CV::Qualifiers( ast::CV::Mutex ) );
    402402        }
    403         return genProto( "^?{}", { dst }, {} );
     403//      return genProto( "^?{}", { dst }, {} );
     404
     405        ast::FunctionDecl * decl = genProto( "^?{}", { dst }, {} );
     406        // For concurrent types, remove static storage and inline specifier, and add
     407        // cfa_linkonce attribute so the destructor has linkonce semantics.
     408        // This is required to share the same function pointer across TUs.
     409        if ( isConcurrentType() ) {
     410                auto mut = ast::mutate( decl );
     411                mut->storage = ast::Storage::Classes();
     412                mut->funcSpec = ast::Function::Specs();
     413                mut->attributes.push_back( new ast::Attribute( "cfa_linkonce" ) );
     414        }
     415        return decl;
    404416}
    405417
Note: See TracChangeset for help on using the changeset viewer.