Changeset b740f0b for driver/cfa.cc


Ignore:
Timestamp:
Aug 22, 2018, 9:39:45 PM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
d6f4488
Parents:
92f413c
Message:

remove double trialing slash for file names, fix -E flag, clean up suffix handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • driver/cfa.cc

    r92f413c rb740f0b  
    1010// Created On       : Tue Aug 20 13:44:49 2002
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Aug 10 18:17:58 2018
    13 // Update Count     : 259
     12// Last Modified On : Wed Aug 22 17:26:19 2018
     13// Update Count     : 265
    1414//
    1515
     
    4343const string suffixes[NumSuffixes] = { "cfa", "hfa", };
    4444
    45 bool suffix( string arg ) {
     45void suffix( string arg, const char * args[], int & nargs ) {
    4646        //std::cerr << arg << std::endl;
    4747        size_t dot = arg.find_last_of( "." );
    4848        //std::cerr << dot << " " << (dot != string::npos ? arg.substr( dot + 1 ) : "fred" ) << std::endl;
    49         if ( dot == string::npos ) return false;
     49        if ( dot == string::npos ) return;
    5050        string sx = arg.substr( dot + 1 );
    5151        for ( int i = 0; i < NumSuffixes; i += 1 ) {
    52                 if ( sx == suffixes[i] ) return true;
     52                if ( sx == suffixes[i] ) {
     53                        args[nargs] = "-x";
     54                        nargs += 1;
     55                        args[nargs] = "c";
     56                        nargs += 1;
     57                        return;
     58                } // if
    5359        } // for
    54         return false;
    5560} // suffix
    5661
     
    294299                } else {
    295300                        bool opt = false;
    296                         if ( ! xflag && suffix( arg ) ) {
    297                                 args[nargs] = "-x";
    298                                 nargs += 1;
    299                                 args[nargs] = "c";
    300                                 nargs += 1;
     301                        if ( ! xflag ) {
     302                                suffix( arg, args, nargs );                             // check suffix
    301303                                // args[nargs] = ( *new string( string("-D__GCC_X__=c") ) ).c_str(); // add the argument for -x
    302304                                // nargs += 1;
     
    342344                nargs += 1;
    343345                if ( ! noincstd_flag ) {                                                        // do not use during build
    344                         args[nargs] = "-I" CFA_INCDIR "/stdhdr";
     346                        args[nargs] = "-I" CFA_INCDIR "stdhdr";
    345347                        nargs += 1;
    346348                } // if
    347                 args[nargs] = "-I" CFA_INCDIR "/concurrency";
    348                 nargs += 1;
    349                 args[nargs] = "-I" CFA_INCDIR "/containers";
     349                args[nargs] = "-I" CFA_INCDIR "concurrency";
     350                nargs += 1;
     351                args[nargs] = "-I" CFA_INCDIR "containers";
    350352                nargs += 1;
    351353        } else {
     
    470472
    471473        if ( Bprefix.length() == 0 ) {
    472                 Bprefix = !intree ? installlibdir : srcdriverdir;
     474                Bprefix = ! intree ? installlibdir : srcdriverdir;
     475                if ( Bprefix[Bprefix.length() - 1] != '/' ) Bprefix += '/';
    473476                args[nargs] = ( *new string( string("-D__GCC_BPREFIX__=") + Bprefix ) ).c_str();
    474477                nargs += 1;
     
    504507                args[nargs] = "-D__int8_t_defined";                             // prevent gcc type-size attributes
    505508                nargs += 1;
    506                 args[nargs] = ( *new string( string("-B") + Bprefix + "/" ) ).c_str();
     509                args[nargs] = ( *new string( string("-B") + Bprefix ) ).c_str();
    507510                nargs += 1;
    508511                args[nargs] = "-lm";
Note: See TracChangeset for help on using the changeset viewer.