Changeset 1ee048fd


Ignore:
Timestamp:
Aug 13, 2019, 3:25:57 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
d65f92c
Parents:
ef46abb
Message:

All tests pass with distributed compilation

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • driver/cfa.cc

    ref46abb r1ee048fd  
    3838
    3939
    40 bool prefix( string arg, string pre ) {
     40bool prefix( const string & arg, const string & pre ) {
    4141        return arg.substr( 0, pre.size() ) == pre;
    4242} // prefix
    4343
    44 bool suffix( string arg ) {
    45         enum { NumSuffixes = 3 };
    46         static const string suffixes[NumSuffixes] = { "cfa", "hfa", "ifa" };
    47         //std::cerr << arg << std::endl;
    48         size_t dot = arg.find_last_of( "." );
    49         //std::cerr << dot << " " << (dot != string::npos ? arg.substr( dot + 1 ) : "fred" ) << std::endl;
    50         if ( dot == string::npos ) return false;
    51         const string * end = suffixes + NumSuffixes;
    52         return std::find( suffixes, end, arg.substr( dot + 1 ) ) != end;
     44inline bool ends_with(const string & str, const string & sfix) {
     45        if (sfix.size() > str.size()) return false;
     46        return std::equal(str.rbegin(), str.rbegin() + sfix.size(), sfix.rbegin(), sfix.rend());
     47}
     48
     49bool suffix( const string & arg ) {
     50        static const string suffixes[] = { ".cfa", ".hfa", ".cfa.ii" };
     51        for(const auto sfix : suffixes) {
     52                if(arg.size() <= sfix.size()) continue;
     53                size_t pos = arg.find_last_of(sfix);
     54                size_t exp = (arg.size() - 1);
     55                if(pos == exp) return true;
     56        }
     57        return false;
    5358} // suffix
    5459
     
    116121        bool m64 = false;                                                                       // -m64 flag
    117122        bool intree = false;
     123        bool compiling_libs = false;
    118124        bool disttree = false;
    119125
     
    133139
    134140        // process command-line arguments
    135 
    136         args[nargs] = "-x";                                                                     // turn off language
    137         nargs += 1;
    138         args[nargs] = "c";
    139         nargs += 1;
    140141
    141142        for ( int i = 1; i < argc; i += 1 ) {
     
    183184                        } else if ( arg == "-dist-tree" ) {
    184185                                disttree = true;
     186                        } else if ( arg == "-cfalib") {
     187                                compiling_libs = true;
    185188                        } else if ( arg == "-compiler" ) {
    186189                                // use the user specified compiler
     
    375378        } else {
    376379                libbase = TOP_BUILDDIR "libcfa/";
     380        }
     381
     382        if( compiling_libs ) {
    377383                args[nargs] = "-D__CFA_FLAG__=-t";
    378384                nargs += 1;
     
    564570        cerr << "args:" << endl;
    565571        for ( int i = 0; args[i] != NULL; i += 1 ) {
    566                 cerr << " \"" << args[i] << "\"" << endl;
     572                cerr << " \"" << args[i] << "\" ";
    567573        } // for
     574        cerr << endl;
    568575        #endif // __DEBUG_H__
    569576
  • libcfa/prelude/Makefile.am

    ref46abb r1ee048fd  
    7272distribution: @LOCAL_CFACC@ @CFACPP@ gcc-builtins.cf builtins.cf extras.cf prelude.cfa bootloader.c $(srcdir)/../../tools/build/push2dist.sh
    7373        ${AM_V_GEN}$(srcdir)/../../tools/build/push2dist.sh @CFADIR_HASH@
    74         echo "Dummy file to track distribution to remote hosts" > ${@}
     74        @echo "Dummy file to track distribution to remote hosts" > ${@}
    7575
    7676all: all-am distribution
  • libcfa/prelude/Makefile.in

    ref46abb r1ee048fd  
    572572@ENABLE_DISTCC_TRUE@distribution: @LOCAL_CFACC@ @CFACPP@ gcc-builtins.cf builtins.cf extras.cf prelude.cfa bootloader.c $(srcdir)/../../tools/build/push2dist.sh
    573573@ENABLE_DISTCC_TRUE@    ${AM_V_GEN}$(srcdir)/../../tools/build/push2dist.sh @CFADIR_HASH@
    574 @ENABLE_DISTCC_TRUE@    echo "Dummy file to track distribution to remote hosts" > ${@}
     574@ENABLE_DISTCC_TRUE@    @echo "Dummy file to track distribution to remote hosts" > ${@}
    575575
    576576@ENABLE_DISTCC_TRUE@all: all-am distribution
  • libcfa/src/Makefile.am

    ref46abb r1ee048fd  
    3030# use -no-include-stdhdr to prevent rebuild cycles
    3131# The built sources must not depend on the installed headers
    32 AM_CFAFLAGS = -quiet @PRELUDEFLAG@ -I$(srcdir)/stdhdr @CONFIG_CFAFLAGS@
     32AM_CFAFLAGS = -quiet -cfalib @PRELUDEFLAG@ -I$(srcdir)/stdhdr @CONFIG_CFAFLAGS@
    3333AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@
    3434AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@
  • libcfa/src/Makefile.in

    ref46abb r1ee048fd  
    443443# use -no-include-stdhdr to prevent rebuild cycles
    444444# The built sources must not depend on the installed headers
    445 AM_CFAFLAGS = -quiet @PRELUDEFLAG@ -I$(srcdir)/stdhdr @CONFIG_CFAFLAGS@
     445AM_CFAFLAGS = -quiet -cfalib @PRELUDEFLAG@ -I$(srcdir)/stdhdr @CONFIG_CFAFLAGS@
    446446AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@
    447447AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@
Note: See TracChangeset for help on using the changeset viewer.