Changeset 381bea6 for driver/cc1.cc


Ignore:
Timestamp:
Aug 27, 2018, 5:53:45 PM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
e5ea867
Parents:
b7c89aa (diff), 2a9d12d (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' into cleanup-dtors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • driver/cc1.cc

    rb7c89aa r381bea6  
    1010// Created On       : Fri Aug 26 14:23:51 2005
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 19 10:46:11 2018
    13 // Update Count     : 111
     12// Last Modified On : Thu Aug 23 09:48:40 2018
     13// Update Count     : 122
    1414//
    1515
     
    4747const string suffixes[NumSuffixes] = { "cfa", "hfa", };
    4848
    49 bool suffix( string arg ) {
     49
     50void suffix( string arg, const char * args[], int & nargs ) {
    5051        //std::cerr << arg << std::endl;
    5152        size_t dot = arg.find_last_of( "." );
    5253        //std::cerr << dot << " " << (dot != string::npos ? arg.substr( dot + 1 ) : "fred" ) << std::endl;
    53         if ( dot == string::npos ) return false;
     54        if ( dot == string::npos ) return;
    5455        string sx = arg.substr( dot + 1 );
    5556        for ( int i = 0; i < NumSuffixes; i += 1 ) {
    56                 if ( sx == suffixes[i] ) return true;
    57         } // for
    58         return false;
     57                if ( sx == suffixes[i] ) {
     58                        args[nargs] = "-x";
     59                        nargs += 1;
     60                        args[nargs] = "c";
     61                        nargs += 1;
     62                        return;
     63                } // if
     64        } // for
    5965} // suffix
    6066
    6167
    62 void checkEnv( const char *args[], int &nargs ) {
     68void checkEnv( const char * args[], int & nargs ) {
    6369        char *value;
    6470
    65         value = getenv( "__COMPILER__" );
     71        value = getenv( "__CFA_COMPILER__" );
    6672        if ( value != NULL ) {
    6773                compiler_name = value;
     
    263269
    264270                args[0] = compiler_name.c_str();
     271                suffix( cpp_in, args, nargs );                                  // check suffix
    265272                args[nargs] = cpp_in;
    266273                nargs += 1;
     
    310317
    311318                args[0] = compiler_name.c_str();
    312                 if ( suffix( cpp_in ) ) {
    313                         args[nargs] = "-x";
    314                         nargs += 1;
    315                         args[nargs] = "c";
    316                         nargs += 1;
    317                 } // if
     319                suffix( cpp_in, args, nargs );                                  // check suffix
    318320                args[nargs] = cpp_in;                                                   // input to cpp
    319321                nargs += 1;
     
    354356
    355357        if ( fork() == 0 ) {                                                            // child runs CFA
    356                 cargs[0] = ( *new string( bprefix + "/cfa-cpp" ) ).c_str();
     358                cargs[0] = ( *new string( bprefix + "cfa-cpp" ) ).c_str();
    357359
    358360                // Source file-name used to generate routine names containing global initializations for TU.
Note: See TracChangeset for help on using the changeset viewer.