Changeset 3fe34ae for src/SynTree


Ignore:
Timestamp:
Jan 12, 2017, 2:05:03 PM (9 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
7cc2c8d, 981bdc6
Parents:
0270824
Message:

Added bootloader.cf which contains the main that wraps the user main

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/FunctionDecl.cc

    r0270824 r3fe34ae  
    2323#include "InitTweak/InitTweak.h"
    2424
     25extern bool translation_unit_nomain;
     26
    2527FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, std::list< Attribute * > attributes )
    2628                : Parent( name, sc, linkage, attributes ), type( type ), statements( statements ) {
     
    3032        // because we want to replace the main even if it is inside an extern
    3133        if ( name == "main" ) {
    32                 set_linkage( LinkageSpec::Cforall );
     34                set_linkage( translation_unit_nomain ? LinkageSpec::C : LinkageSpec::Cforall );
    3335        } // if
    3436}
Note: See TracChangeset for help on using the changeset viewer.