Changeset 981bdc6 for src/SynTree


Ignore:
Timestamp:
Jan 12, 2017, 2:05:49 PM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
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, stuck-waitfor-destruct, with_gc
Children:
f3b0a07
Parents:
2298a7b8 (diff), 3fe34ae (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:/u/cforall/software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/FunctionDecl.cc

    r2298a7b8 r981bdc6  
    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 ) {
    2729        set_isInline( isInline );
    2830        set_isNoreturn( isNoreturn );
    29         // this is a brazen hack to force the function "main" to have C linkage
     31        // this is a brazen hack to force the function "main" to have Cforall linkage
     32        // because we want to replace the main even if it is inside an extern
    3033        if ( name == "main" ) {
    31                 set_linkage( LinkageSpec::C );
     34                set_linkage( translation_unit_nomain ? LinkageSpec::C : LinkageSpec::Cforall );
    3235        } // if
    3336}
Note: See TracChangeset for help on using the changeset viewer.