Changeset 981bdc6


Ignore:
Timestamp:
Jan 12, 2017, 2:05:49 PM (5 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, 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

Files:
1 added
26 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    r2298a7b8 r981bdc6  
    3131src/prelude/builtins.cf
    3232src/prelude/extras.cf
     33src/prelude/bootloader.c
    3334src/libcfa/libcfa-prelude.c
    3435
  • configure

    r2298a7b8 r981bdc6  
    32143214
    32153215if test "$includedir" = '${prefix}/include'; then
    3216         cfa_incdir="${cfa_prefix}/include"
     3216        cfa_incdir="${cfa_prefix}/include/cfa"
    32173217else
    32183218        cfa_incdir=${includedir}
  • configure.ac

    r2298a7b8 r981bdc6  
    122122
    123123if test "$includedir" = '${prefix}/include'; then
    124         cfa_incdir="${cfa_prefix}/include"
     124        cfa_incdir="${cfa_prefix}/include/cfa"
    125125else
    126126        cfa_incdir=${includedir}
  • src/CodeGen/FixNames.cc

    r2298a7b8 r981bdc6  
    1414//
    1515
     16#include <memory>
     17
    1618#include "FixNames.h"
    1719#include "SynTree/Declaration.h"
     
    2022#include "SymTab/Mangler.h"
    2123#include "OperatorTable.h"
     24
     25extern std::unique_ptr<FunctionDecl> translation_unit_main_signature;
    2226
    2327namespace CodeGen {
     
    2832
    2933                virtual void visit( CompoundStmt *compoundStmt );
    30 
    3134          private:
    3235                int scopeLevel = 1;
     
    3437                void fixDWT( DeclarationWithType *dwt );
    3538        };
     39
     40        std::string mangle_main() {
     41                FunctionType* main_type;
     42                std::unique_ptr<FunctionDecl> mainDecl { new FunctionDecl(
     43                        "main",
     44                        DeclarationNode::NoStorageClass,
     45                        LinkageSpec::Cforall,
     46                        main_type = new FunctionType( Type::Qualifiers(), true ),
     47                        nullptr, false, false
     48                ) };
     49                main_type->get_returnVals().push_back(
     50                        new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), nullptr )
     51                );
     52
     53                auto&& name = SymTab::Mangler::mangle( mainDecl.get() );
     54                // std::cerr << name << std::endl;
     55                return name;
     56        }
     57        std::string mangle_main_args() {
     58                FunctionType* main_type;
     59                std::unique_ptr<FunctionDecl> mainDecl { new FunctionDecl(
     60                        "main",
     61                        DeclarationNode::NoStorageClass,
     62                        LinkageSpec::Cforall,
     63                        main_type = new FunctionType( Type::Qualifiers(), false ),
     64                        nullptr, false, false
     65                ) };
     66                main_type->get_returnVals().push_back(
     67                        new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), nullptr )
     68                );
     69
     70                mainDecl->get_functionType()->get_parameters().push_back(
     71                        new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), nullptr )
     72                );
     73
     74                mainDecl->get_functionType()->get_parameters().push_back(
     75                        new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0,
     76                        new PointerType( Type::Qualifiers(), new PointerType( Type::Qualifiers(), new BasicType( Type::Qualifiers(), BasicType::Char ) ) ),
     77                        nullptr )
     78                );
     79
     80                auto&& name = SymTab::Mangler::mangle( mainDecl.get() );
     81                // std::cerr << name << std::endl;
     82                return name;
     83        }
     84
     85        bool is_main(const std::string& name) {
     86                static std::string mains[] = {
     87                        mangle_main(),
     88                        mangle_main_args()
     89                };
     90
     91                for(const auto& m : mains) {
     92                        if( name == m ) return true;
     93                }
     94                return false;
     95        }
    3696
    3797        void fixNames( std::list< Declaration* > translationUnit ) {
     
    57117                Visitor::visit( functionDecl );
    58118                fixDWT( functionDecl );
     119
     120                if(is_main( SymTab::Mangler::mangle(functionDecl, true, true) )) {
     121                        if(translation_unit_main_signature) {
     122                                throw SemanticError("Multiple definition of main routine\n", functionDecl);
     123                        }
     124
     125                        functionDecl->get_statements()->get_kids().push_back( new ReturnStmt( noLabels, new ConstantExpr( Constant( new BasicType( Type::Qualifiers(), BasicType::SignedInt ), "0") ) ) );
     126                        translation_unit_main_signature.reset( functionDecl->clone() );
     127                }
    59128        }
    60129
  • src/GenPoly/InstantiateGeneric.cc

    r2298a7b8 r981bdc6  
    152152        class EnvFinder final : public GenPoly::PolyMutator {
    153153        public:
     154                using GenPoly::PolyMutator::mutate;
    154155                virtual Type * mutate( TypeInstType * inst ) override {
    155156                        if ( env ) envMap[inst] = env;
  • src/SymTab/Mangler.h

    r2298a7b8 r981bdc6  
    2727                /// Mangle syntax tree object; primary interface to clients
    2828                template< typename SynTreeClass >
    29             static std::string mangle( SynTreeClass *decl, bool mangleOverridable = true );
     29            static std::string mangle( SynTreeClass *decl, bool mangleOverridable = true, bool typeMode = false );
    3030                /// Mangle a type name; secondary interface
    3131                static std::string mangleType( Type* ty );
     
    7070
    7171        template< typename SynTreeClass >
    72         std::string Mangler::mangle( SynTreeClass *decl, bool mangleOverridable ) {
    73                 Mangler mangler( mangleOverridable, false );
     72        std::string Mangler::mangle( SynTreeClass *decl, bool mangleOverridable, bool typeMode ) {
     73                Mangler mangler( mangleOverridable, typeMode );
    7474                maybeAccept( decl, mangler );
    7575                return mangler.get_mangleName();
  • 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}
  • src/driver/cfa.cc

    r2298a7b8 r981bdc6  
    246246        if ( link ) {
    247247                #if ! defined(HAVE_LIBCFA_RELEASE)
    248                         if( !debug ) { 
     248                        if( !debug ) {
    249249                                cerr << "error: Option -nodebug is not available, libcfa was not installed." << endl;
    250250                                exit( EXIT_FAILURE );
     
    252252                #endif
    253253                #if ! defined(HAVE_LIBCFA_DEBUG)
    254                         if( debug ) { 
     254                        if( debug ) {
    255255                                cerr << "error: Option -debug is not available, libcfa-d was not installed." << endl;
    256256                                exit( EXIT_FAILURE );
  • src/libcfa/Makefile.am

    r2298a7b8 r981bdc6  
    6565stdhdr = ${shell echo stdhdr/*}
    6666
    67 nobase_include_HEADERS = ${headers} ${stdhdr} concurrency/invoke.h
     67cfa_includedir = $(includedir)/cfa
     68nobase_cfa_include_HEADERS = ${headers} ${stdhdr} concurrency/invoke.h
    6869
    6970CLEANFILES = libcfa-prelude.c
  • src/libcfa/Makefile.in

    r2298a7b8 r981bdc6  
    4242@BUILD_DEBUG_TRUE@am__append_2 = libcfa-d.a
    4343subdir = src/libcfa
    44 DIST_COMMON = $(nobase_include_HEADERS) $(srcdir)/Makefile.am \
     44DIST_COMMON = $(nobase_cfa_include_HEADERS) $(srcdir)/Makefile.am \
    4545        $(srcdir)/Makefile.in
    4646ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
     
    7979         $(am__cd) "$$dir" && rm -f $$files; }; \
    8080  }
    81 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
     81am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(cfa_includedir)"
    8282LIBRARIES = $(lib_LIBRARIES)
    8383AR = ar
     
    144144SOURCES = $(libcfa_d_a_SOURCES) $(libcfa_a_SOURCES)
    145145DIST_SOURCES = $(libcfa_d_a_SOURCES) $(libcfa_a_SOURCES)
    146 HEADERS = $(nobase_include_HEADERS)
     146HEADERS = $(nobase_cfa_include_HEADERS)
    147147ETAGS = etags
    148148CTAGS = ctags
     
    281281libcfa_d_a_CFLAGS = -debug -O0
    282282stdhdr = ${shell echo stdhdr/*}
    283 nobase_include_HEADERS = ${headers} ${stdhdr} concurrency/invoke.h
     283cfa_includedir = $(includedir)/cfa
     284nobase_cfa_include_HEADERS = ${headers} ${stdhdr} concurrency/invoke.h
    284285CLEANFILES = libcfa-prelude.c
    285286all: all-am
     
    761762@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    762763@am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcfa_a_CFLAGS) $(CFLAGS) -c -o concurrency/libcfa_a-invoke.obj `if test -f 'concurrency/invoke.c'; then $(CYGPATH_W) 'concurrency/invoke.c'; else $(CYGPATH_W) '$(srcdir)/concurrency/invoke.c'; fi`
    763 install-nobase_includeHEADERS: $(nobase_include_HEADERS)
     764install-nobase_cfa_includeHEADERS: $(nobase_cfa_include_HEADERS)
    764765        @$(NORMAL_INSTALL)
    765         test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
    766         @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \
     766        test -z "$(cfa_includedir)" || $(MKDIR_P) "$(DESTDIR)$(cfa_includedir)"
     767        @list='$(nobase_cfa_include_HEADERS)'; test -n "$(cfa_includedir)" || list=; \
    767768        $(am__nobase_list) | while read dir files; do \
    768769          xfiles=; for file in $$files; do \
     
    771772          test -z "$$xfiles" || { \
    772773            test "x$$dir" = x. || { \
    773               echo "$(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \
    774               $(MKDIR_P) "$(DESTDIR)$(includedir)/$$dir"; }; \
    775             echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(includedir)/$$dir'"; \
    776             $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(includedir)/$$dir" || exit $$?; }; \
     774              echo "$(MKDIR_P) '$(DESTDIR)$(cfa_includedir)/$$dir'"; \
     775              $(MKDIR_P) "$(DESTDIR)$(cfa_includedir)/$$dir"; }; \
     776            echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(cfa_includedir)/$$dir'"; \
     777            $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(cfa_includedir)/$$dir" || exit $$?; }; \
    777778        done
    778779
    779 uninstall-nobase_includeHEADERS:
     780uninstall-nobase_cfa_includeHEADERS:
    780781        @$(NORMAL_UNINSTALL)
    781         @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \
     782        @list='$(nobase_cfa_include_HEADERS)'; test -n "$(cfa_includedir)" || list=; \
    782783        $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
    783         dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
     784        dir='$(DESTDIR)$(cfa_includedir)'; $(am__uninstall_files_from_dir)
    784785
    785786ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
     
    869870all-am: Makefile $(LIBRARIES) $(HEADERS)
    870871installdirs:
    871         for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \
     872        for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(cfa_includedir)"; do \
    872873          test -z "$$dir" || $(MKDIR_P) "$$dir"; \
    873874        done
     
    929930info-am:
    930931
    931 install-data-am: install-nobase_includeHEADERS
     932install-data-am: install-nobase_cfa_includeHEADERS
    932933
    933934install-dvi: install-dvi-am
     
    975976ps-am:
    976977
    977 uninstall-am: uninstall-libLIBRARIES uninstall-nobase_includeHEADERS
     978uninstall-am: uninstall-libLIBRARIES \
     979        uninstall-nobase_cfa_includeHEADERS
    978980
    979981.MAKE: install-am install-strip
     
    986988        install-exec-am install-html install-html-am install-info \
    987989        install-info-am install-libLIBRARIES install-man \
    988         install-nobase_includeHEADERS install-pdf install-pdf-am \
     990        install-nobase_cfa_includeHEADERS install-pdf install-pdf-am \
    989991        install-ps install-ps-am install-strip installcheck \
    990992        installcheck-am installdirs maintainer-clean \
     
    992994        mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
    993995        tags uninstall uninstall-am uninstall-libLIBRARIES \
    994         uninstall-nobase_includeHEADERS
     996        uninstall-nobase_cfa_includeHEADERS
    995997
    996998
  • src/libcfa/concurrency/threads

    r2298a7b8 r981bdc6  
    1414// Update Count     : 0
    1515//
    16 
    17 #ifdef __CFORALL__
    1816
    1917#ifndef THREADS_H
     
    7573      coroutine* src = this_coroutine();                // optimization
    7674
    77         assertf( src->last != 0, 
     75        assertf( src->last != 0,
    7876                "Attempt to suspend coroutine %.256s (%p) that has never been resumed.\n"
    7977                "Possible cause is a suspend executed in a member called by a coroutine user rather than by the coroutine main.",
    8078                src->name, src );
    81         assertf( src->last->notHalted, 
     79        assertf( src->last->notHalted,
    8280                "Attempt by coroutine %.256s (%p) to suspend back to terminated coroutine %.256s (%p).\n"
    8381                "Possible cause is terminated coroutine's main routine has already returned.",
     
    10098      // not resuming self ?
    10199        if ( src != dst ) {
    102                 assertf( dst->notHalted , 
     100                assertf( dst->notHalted ,
    103101                        "Attempt by coroutine %.256s (%p) to resume terminated coroutine %.256s (%p).\n"
    104102                        "Possible cause is terminated coroutine's main routine has already returned.",
     
    115113#endif //THREADS_H
    116114
    117 #else
    118 #include_next <thread>
    119 #endif //__CFORALL__
    120 
    121115// Local Variables: //
    122116// mode: c //
  • src/libcfa/containers/vector

    r2298a7b8 r981bdc6  
    1313// Update Count     : 2
    1414//
    15 
    16 #ifdef __CFORALL__
    1715
    1816#ifndef VECTOR_H
     
    170168#endif // VECTOR_H
    171169
    172 #else
    173 #include_next <vector>
    174 #endif //__CFORALL__
    175 
    176170// Local Variables: //
    177171// mode: c //
  • src/libcfa/fstream

    r2298a7b8 r981bdc6  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // fstream -- 
     7// fstream --
    88//
    99// Author           : Peter A. Buhr
     
    1313// Update Count     : 88
    1414//
    15 
    16 #ifdef __CFORALL__
    1715
    1816#ifndef __FSTREAM_H__
     
    6462#endif // __FSTREAM_H__
    6563
    66 #else
    67 #include_next <fstream>
    68 #endif //__CFORALL__
    69 
    7064// Local Variables: //
    7165// mode: c //
    7266// tab-width: 4 //
    7367// End: //
    74 
  • src/libcfa/iostream

    r2298a7b8 r981bdc6  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // iostream -- 
     7// iostream --
    88//
    99// Author           : Peter A. Buhr
     
    1313// Update Count     : 93
    1414//
    15 
    16 #ifdef __CFORALL__
    1715
    1816#ifndef __IOSTREAM_H__
     
    2826        void sepReset( ostype *, _Bool );                                       // set separator and default state
    2927        void sepSet( ostype *, const char * );                          // set separator to string (15 character maximum)
    30         const char * sepGet( ostype * );                                        // get separator string 
     28        const char * sepGet( ostype * );                                        // get separator string
    3129        _Bool sepDisable( ostype * );                                           // set default state to off, and return previous state
    3230        _Bool sepEnable( ostype * );                                            // set default state to on, and return previous state
     
    128126#endif // __IOSTREAM_H
    129127
    130 #else
    131 #include_next <iostream>
    132 #endif //__CFORALL__
    133 
    134128// Local Variables: //
    135129// mode: c //
  • src/libcfa/iterator

    r2298a7b8 r981bdc6  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // iterator -- 
     7// iterator --
    88//
    99// Author           : Richard C. Bilson
     
    1313// Update Count     : 9
    1414//
    15 
    16 #ifdef __CFORALL__
    1715
    1816#ifndef ITERATOR_H
     
    4846#endif // ITERATOR_H
    4947
    50 #else
    51 #include_next <iterator>
    52 #endif //__CFORALL__
    53 
    5448// Local Variables: //
    5549// mode: c //
  • src/libcfa/limits

    r2298a7b8 r981bdc6  
    1 // 
     1//
    22// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
    33//
    44// The contents of this file are covered under the licence agreement in the
    55// file "LICENCE" distributed with Cforall.
    6 // 
    7 // limits -- 
    8 // 
     6//
     7// limits --
     8//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed Apr  6 18:06:52 2016
     
    1212// Last Modified On : Wed Apr  6 21:08:16 2016
    1313// Update Count     : 6
    14 //
    15 
    16 #ifdef __CFORALL__
     14//
    1715
    1816#ifndef LIMITS_H
     
    114112#endif // LIMITS_H
    115113
    116 #else
    117 #include_next <limits>
    118 #endif //__CFORALL__
    119 
    120114// Local Variables: //
    121115// mode: c //
  • src/libcfa/math

    r2298a7b8 r981bdc6  
    1 // 
     1//
    22// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
    33//
     
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // math -- 
    8 // 
     7// math --
     8//
    99// Author           : Peter A. Buhr
    1010// Created On       : Mon Apr 18 23:37:04 2016
     
    1212// Last Modified On : Sun Apr 24 12:45:02 2016
    1313// Update Count     : 59
    14 //
    15 
    16 #ifdef __CFORALL__
     14//
    1715
    1816#ifndef MATH_H
     
    356354#endif // MATH_H
    357355
    358 #else
    359 #include_next <math>
    360 #endif //__CFORALL__
    361 
    362356// Local Variables: //
    363357// mode: c //
  • src/libcfa/rational

    r2298a7b8 r981bdc6  
    1 // 
     1//
    22// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
    33//
    44// The contents of this file are covered under the licence agreement in the
    55// file "LICENCE" distributed with Cforall.
    6 // 
     6//
    77// rational -- Rational numbers are numbers written as a ratio, i.e., as a fraction, where the numerator (top number)
    88//     and the denominator (bottom number) are whole numbers. When creating and computing with rational numbers, results
    99//     are constantly reduced to keep the numerator and denominator as small as possible.
    10 // 
     10//
    1111// Author           : Peter A. Buhr
    1212// Created On       : Wed Apr  6 17:56:25 2016
     
    1414// Last Modified On : Wed May  4 14:11:45 2016
    1515// Update Count     : 16
    16 //
    17 #ifdef __CFORALL__
    18 
     16//
    1917#ifndef RATIONAL_H
    2018#define RATIONAL_H
     
    6765#endif // RATIONAL_H
    6866
    69 #else
    70 #include_next <rational>
    71 #endif //__CFORALL__
    72 
    7367// Local Variables: //
    7468// mode: c //
  • src/libcfa/stdlib

    r2298a7b8 r981bdc6  
    1313// Update Count     : 99
    1414//
    15 
    16 #ifdef __CFORALL__
    1715
    1816#ifndef STDLIB_H
     
    138136#endif // STDLIB_H
    139137
    140 #else
    141 #include_next <stdlib>
    142 #endif //__CFORALL__
    143 
    144138// Local Variables: //
    145139// mode: c //
  • src/main.cc

    r2298a7b8 r981bdc6  
    1414//
    1515
     16#include <memory>
    1617#include <iostream>
    1718#include <fstream>
     
    6566        nopreludep = false,
    6667        noprotop = false,
     68        nomainp = false,
    6769        parsep = false,
    6870        resolvep = false,                                                                       // used in AlternativeFinder
     
    7779static void parse( FILE * input, LinkageSpec::Spec linkage, bool shouldExit = false );
    7880static void dump( list< Declaration * > & translationUnit, ostream & out = cout );
     81
     82bool translation_unit_nomain = true;
     83std::unique_ptr<FunctionDecl> translation_unit_main_signature = nullptr;
    7984
    8085static void backtrace( int start ) {                                    // skip first N stack frames
     
    154159
    155160        parse_cmdline( argc, argv, filename );                          // process command-line arguments
     161        translation_unit_nomain = nomainp;
    156162
    157163        try {
     
    299305
    300306                CodeGen::generate( translationUnit, *output, ! noprotop );
     307
     308                if( translation_unit_main_signature ) {
     309                        *output << "int main(int argc, char** argv) { return ";
     310
     311                        *output << translation_unit_main_signature->get_scopedMangleName() << "(";
     312                        if(translation_unit_main_signature->get_functionType()->get_parameters().size() != 0){
     313                                *output << "argc, argv";
     314                        }
     315                        *output << ");";
     316
     317                        *output << " }\n";
     318                }
    301319
    302320                if ( output != &cout ) {
     
    360378
    361379        int c;
    362         while ( (c = getopt_long( argc, argv, "abBcefglnpqrstTvyzD:F:", long_opts, &long_index )) != -1 ) {
     380        while ( (c = getopt_long( argc, argv, "abBcefglmnpqrstTvyzD:F:", long_opts, &long_index )) != -1 ) {
    363381                switch ( c ) {
    364382                  case Ast:
     
    400418                  case 'p':                                                                             // generate prototypes for preamble functions
    401419                        noprotop = true;
     420                        break;
     421                  case 'm':                                                                             // don't replace the main
     422                        nomainp = true;
    402423                        break;
    403424                  case Parse:
  • src/prelude/Makefile.am

    r2298a7b8 r981bdc6  
    2020# put into lib for now
    2121cfalibdir = ${libdir}
    22 cfalib_DATA = builtins.cf extras.cf prelude.cf
     22cfalib_DATA = builtins.cf extras.cf prelude.cf bootloader.c
    2323noinst_DATA = ../libcfa/libcfa-prelude.c
    2424
     
    4545        ${AM_V_GEN}${abs_top_srcdir}/src/driver/cfa-cpp -l prelude.cf $@  # use src/cfa-cpp as not in lib until after install
    4646
     47bootloader.c : bootloader.cf extras.cf builtins.cf ${abs_top_srcdir}/src/driver/cfa-cpp
     48        ${AM_V_GEN}${abs_top_srcdir}/src/driver/cfa-cpp -tpm bootloader.cf $@  # use src/cfa-cpp as not in lib until after install
    4749
    48 MAINTAINERCLEANFILES = builtins.c builtins.cf extras.cf ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}}
     50MAINTAINERCLEANFILES = builtins.c builtins.cf extras.cf bootloader.c ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}}
  • src/prelude/Makefile.in

    r2298a7b8 r981bdc6  
    210210# put into lib for now
    211211cfalibdir = ${libdir}
    212 cfalib_DATA = builtins.cf extras.cf prelude.cf
     212cfalib_DATA = builtins.cf extras.cf prelude.cf bootloader.c
    213213noinst_DATA = ../libcfa/libcfa-prelude.c
    214 MAINTAINERCLEANFILES = builtins.c builtins.cf extras.cf ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}}
     214MAINTAINERCLEANFILES = builtins.c builtins.cf extras.cf bootloader.c ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}}
    215215all: all-am
    216216
     
    441441        ${AM_V_GEN}${abs_top_srcdir}/src/driver/cfa-cpp -l prelude.cf $@  # use src/cfa-cpp as not in lib until after install
    442442
     443bootloader.c : bootloader.cf extras.cf builtins.cf ${abs_top_srcdir}/src/driver/cfa-cpp
     444        ${AM_V_GEN}${abs_top_srcdir}/src/driver/cfa-cpp -tpm bootloader.cf $@  # use src/cfa-cpp as not in lib until after install
     445
    443446# Tell versions [3.59,3.63) of GNU make to not export all variables.
    444447# Otherwise a system limit (for SysV at least) may be exceeded.
  • src/tests/.expect/32/declarationSpecifier.txt

    r2298a7b8 r981bdc6  
    621621static inline volatile const short __f47__FCVs___1();
    622622static inline volatile const short __f48__FCVs___1();
    623 int main(int __argc__i_1, const char **__argv__PPCc_1){
     623int __main__Fi_iPPCc__1(int __argc__i_1, const char **__argv__PPCc_1){
    624624    int ___retval_main__i_1;
    625625    ((void)(___retval_main__i_1=((int )0)) /* ?{} */);
    626626    return ((int )___retval_main__i_1);
    627 }
     627    ((void)(___retval_main__i_1=0) /* ?{} */);
     628    return ((int )___retval_main__i_1);
     629}
     630int main(int argc, char** argv) { return __main__Fi_iPPCc__1(argc, argv); }
     631
  • src/tests/.expect/32/gccExtensions.txt

    r2298a7b8 r981bdc6  
    66extern int printf(const char *__restrict __format, ...);
    77extern int __x__i_1 asm ( "xx" );
    8 int main(int __argc__i_1, const char **__argv__PPCc_1){
     8int __main__Fi_iPPCc__1(int __argc__i_1, const char **__argv__PPCc_1){
    99    int ___retval_main__i_1;
    1010    asm ( "nop" :  :  :  );
     
    162162    ((void)(___retval_main__i_1=((int )0)) /* ?{} */);
    163163    return ((int )___retval_main__i_1);
     164    ((void)(___retval_main__i_1=0) /* ?{} */);
     165    return ((int )___retval_main__i_1);
    164166}
     167int main(int argc, char** argv) { return __main__Fi_iPPCc__1(argc, argv); }
  • src/tests/.expect/64/declarationSpecifier.txt

    r2298a7b8 r981bdc6  
    621621static inline volatile const short __f47__FCVs___1();
    622622static inline volatile const short __f48__FCVs___1();
    623 int main(int __argc__i_1, const char **__argv__PPCc_1){
     623int __main__Fi_iPPCc__1(int __argc__i_1, const char **__argv__PPCc_1){
    624624    int ___retval_main__i_1;
    625625    ((void)(___retval_main__i_1=((int )0)) /* ?{} */);
    626626    return ((int )___retval_main__i_1);
    627 }
     627    ((void)(___retval_main__i_1=0) /* ?{} */);
     628    return ((int )___retval_main__i_1);
     629}
     630int main(int argc, char** argv) { return __main__Fi_iPPCc__1(argc, argv); }
  • src/tests/.expect/64/gccExtensions.txt

    r2298a7b8 r981bdc6  
    66extern int printf(const char *__restrict __format, ...);
    77extern int __x__i_1 asm ( "xx" );
    8 int main(int __argc__i_1, const char **__argv__PPCc_1){
     8int __main__Fi_iPPCc__1(int __argc__i_1, const char **__argv__PPCc_1){
    99    int ___retval_main__i_1;
    1010    asm ( "nop" :  :  :  );
     
    162162    ((void)(___retval_main__i_1=((int )0)) /* ?{} */);
    163163    return ((int )___retval_main__i_1);
     164    ((void)(___retval_main__i_1=0) /* ?{} */);
     165    return ((int )___retval_main__i_1);
    164166}
     167int main(int argc, char** argv) { return __main__Fi_iPPCc__1(argc, argv); }
Note: See TracChangeset for help on using the changeset viewer.