Changeset aff7e86 for src


Ignore:
Timestamp:
May 13, 2021, 5:49:44 PM (3 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
7fca832
Parents:
e2f601f
Message:

Added a new attribute 'cfa_linkonce'.

Location:
src
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/module.mk

    re2f601f raff7e86  
    2525        CodeGen/GenType.cc \
    2626        CodeGen/GenType.h \
     27        CodeGen/LinkOnce.cc \
     28        CodeGen/LinkOnce.h \
    2729        CodeGen/OperatorTable.cc \
    2830        CodeGen/OperatorTable.h \
  • src/InitTweak/InitTweak.cc

    re2f601f raff7e86  
    12161216
    12171217        void addDataSectonAttribute( ObjectDecl * objDecl ) {
    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));
     1218                objDecl->attributes.push_back(new Attribute("section", {
     1219                        new ConstantExpr( Constant::from_string(".data#") ),
     1220                }));
    12241221        }
    12251222
    12261223        void addDataSectionAttribute( ast::ObjectDecl * objDecl ) {
    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)}));
     1224                objDecl->attributes.push_back(new ast::Attribute("section", {
     1225                        ast::ConstantExpr::from_string(objDecl->location, ".data#"),
     1226                }));
    12291227        }
    12301228
  • src/Virtual/Tables.cc

    re2f601f raff7e86  
    172172}
    173173
    174 Attribute * 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 
    181174ObjectDecl * makeTypeIdInstance( StructInstType const * typeIdType ) {
    182175        assert( typeIdType );
     
    193186                        new AddressExpr( new NameExpr( "__cfatid_exception_t" ) )
    194187                        ) } ),
    195                 { linkonce( typeid_name ) },
     188                { new Attribute( "cfa_linkonce", {} ) },
    196189                noFuncSpecifiers
    197190        );
  • src/main.cc

    re2f601f raff7e86  
    3737#include "CodeGen/FixNames.h"               // for fixNames
    3838#include "CodeGen/Generate.h"               // for generate
     39#include "CodeGen/LinkOnce.h"               // for translateLinkOnce
    3940#include "CodeTools/DeclStats.h"            // for printDeclStats
    4041#include "CodeTools/ResolvProtoDump.h"      // for dumpAsResolvProto
     
    405406                PASS( "Box", GenPoly::box( translationUnit ) );
    406407
     408                PASS( "Link-Once", CodeGen::translateLinkOnce( translationUnit ) );
     409
     410                // Code has been lowered to C, now we can start generation.
     411
    407412                if ( bcodegenp ) {
    408413                        dump( translationUnit );
Note: See TracChangeset for help on using the changeset viewer.