Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • driver/cc1.cc

    rd6f4488 rbf71cfd  
    1010// Created On       : Fri Aug 26 14:23:51 2005
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug 23 09:48:40 2018
    13 // Update Count     : 122
     12// Last Modified On : Thu Jul 19 10:46:11 2018
     13// Update Count     : 111
    1414//
    1515
     
    4747const string suffixes[NumSuffixes] = { "cfa", "hfa", };
    4848
    49 
    50 void suffix( string arg, const char * args[], int & nargs ) {
     49bool suffix( string arg ) {
    5150        //std::cerr << arg << std::endl;
    5251        size_t dot = arg.find_last_of( "." );
    5352        //std::cerr << dot << " " << (dot != string::npos ? arg.substr( dot + 1 ) : "fred" ) << std::endl;
    54         if ( dot == string::npos ) return;
     53        if ( dot == string::npos ) return false;
    5554        string sx = arg.substr( dot + 1 );
    5655        for ( int i = 0; i < NumSuffixes; i += 1 ) {
    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
     56                if ( sx == suffixes[i] ) return true;
     57        } // for
     58        return false;
    6559} // suffix
    6660
    6761
    68 void checkEnv( const char * args[], int & nargs ) {
     62void checkEnv( const char *args[], int &nargs ) {
    6963        char *value;
    7064
    71         value = getenv( "__CFA_COMPILER__" );
     65        value = getenv( "__COMPILER__" );
    7266        if ( value != NULL ) {
    7367                compiler_name = value;
     
    269263
    270264                args[0] = compiler_name.c_str();
    271                 suffix( cpp_in, args, nargs );                                  // check suffix
    272265                args[nargs] = cpp_in;
    273266                nargs += 1;
     
    317310
    318311                args[0] = compiler_name.c_str();
    319                 suffix( cpp_in, args, nargs );                                  // check suffix
     312                if ( suffix( cpp_in ) ) {
     313                        args[nargs] = "-x";
     314                        nargs += 1;
     315                        args[nargs] = "c";
     316                        nargs += 1;
     317                } // if
    320318                args[nargs] = cpp_in;                                                   // input to cpp
    321319                nargs += 1;
     
    356354
    357355        if ( fork() == 0 ) {                                                            // child runs CFA
    358                 cargs[0] = ( *new string( bprefix + "cfa-cpp" ) ).c_str();
     356                cargs[0] = ( *new string( bprefix + "/cfa-cpp" ) ).c_str();
    359357
    360358                // Source file-name used to generate routine names containing global initializations for TU.
Note: See TracChangeset for help on using the changeset viewer.