Changes in / [7fca832:353aaba]


Ignore:
Files:
5 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/exception.hfa

    r7fca832 r353aaba  
    162162// Generate a new type-id value.
    163163#define _EHM_TYPE_ID_VALUE(exception_name, arguments) \
    164         __attribute__((cfa_linkonce)) \
     164        __attribute__(( section(".gnu.linkonce." "__cfatid_" #exception_name) )) \
    165165        _EHM_TYPE_ID_TYPE(exception_name) arguments const \
    166166                        _EHM_TYPE_ID_NAME(exception_name) = { \
  • src/CodeGen/module.mk

    r7fca832 r353aaba  
    2525        CodeGen/GenType.cc \
    2626        CodeGen/GenType.h \
    27         CodeGen/LinkOnce.cc \
    28         CodeGen/LinkOnce.h \
    2927        CodeGen/OperatorTable.cc \
    3028        CodeGen/OperatorTable.h \
  • src/InitTweak/InitTweak.cc

    r7fca832 r353aaba  
    12161216
    12171217        void addDataSectonAttribute( ObjectDecl * objDecl ) {
    1218                 objDecl->attributes.push_back(new Attribute("section", {
    1219                         new ConstantExpr( Constant::from_string(".data#") ),
    1220                 }));
     1218                Type *strLitT = new PointerType( Type::Qualifiers( ),
     1219                        new BasicType( Type::Qualifiers( ), BasicType::Char ) );
     1220                std::list< Expression * > attr_params;
     1221                attr_params.push_back(
     1222                        new ConstantExpr( Constant( strLitT, "\".data#\"", std::nullopt ) ) );
     1223                objDecl->attributes.push_back(new Attribute("section", attr_params));
    12211224        }
    12221225
    12231226        void addDataSectionAttribute( ast::ObjectDecl * objDecl ) {
    1224                 objDecl->attributes.push_back(new ast::Attribute("section", {
    1225                         ast::ConstantExpr::from_string(objDecl->location, ".data#"),
    1226                 }));
     1227                auto strLitT = new ast::PointerType(new ast::BasicType(ast::BasicType::Char));
     1228                objDecl->attributes.push_back(new ast::Attribute("section", {new ast::ConstantExpr(objDecl->location, strLitT, "\".data#\"", std::nullopt)}));
    12271229        }
    12281230
  • src/Virtual/Tables.cc

    r7fca832 r353aaba  
    172172}
    173173
     174Attribute * linkonce( const std::string & subsection ) {
     175        const std::string section = ".gnu.linkonce." + subsection;
     176        return new Attribute( "section", {
     177                new ConstantExpr( Constant::from_string( section ) ),
     178        } );
     179}
     180
    174181ObjectDecl * makeTypeIdInstance( StructInstType const * typeIdType ) {
    175182        assert( typeIdType );
     
    186193                        new AddressExpr( new NameExpr( "__cfatid_exception_t" ) )
    187194                        ) } ),
    188                 { new Attribute( "cfa_linkonce", {} ) },
     195                { linkonce( typeid_name ) },
    189196                noFuncSpecifiers
    190197        );
  • src/main.cc

    r7fca832 r353aaba  
    3737#include "CodeGen/FixNames.h"               // for fixNames
    3838#include "CodeGen/Generate.h"               // for generate
    39 #include "CodeGen/LinkOnce.h"               // for translateLinkOnce
    4039#include "CodeTools/DeclStats.h"            // for printDeclStats
    4140#include "CodeTools/ResolvProtoDump.h"      // for dumpAsResolvProto
     
    406405                PASS( "Box", GenPoly::box( translationUnit ) );
    407406
    408                 PASS( "Link-Once", CodeGen::translateLinkOnce( translationUnit ) );
    409 
    410                 // Code has been lowered to C, now we can start generation.
    411 
    412407                if ( bcodegenp ) {
    413408                        dump( translationUnit );
  • tests/Makefile.am

    r7fca832 r353aaba  
    6767.PHONY: list .validate
    6868.INTERMEDIATE: .validate .validate.cfa
    69 EXTRA_PROGRAMS = avl_test linkonce .dummy_hack # build but do not install
     69EXTRA_PROGRAMS = avl_test .dummy_hack # build but do not install
    7070EXTRA_DIST = test.py \
    7171        pybin/__init__.py \
     
    9494
    9595avl_test_SOURCES = avltree/avl_test.cfa avltree/avl0.cfa avltree/avl1.cfa avltree/avl2.cfa avltree/avl3.cfa avltree/avl4.cfa avltree/avl-private.cfa
    96 linkonce_SOURCES = link-once/main.cfa link-once/partner.cfa
    9796# automake doesn't know we still need C/CPP rules so pretend like we have a C program
    9897nodist__dummy_hack_SOURCES = .dummy_hack.c .dummy_hackxx.cpp
Note: See TracChangeset for help on using the changeset viewer.