Changeset 381bea6
- Timestamp:
- Aug 27, 2018, 5:53:45 PM (7 years ago)
- 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. - Files:
-
- 12 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
rb7c89aa r381bea6 56 56 src/Parser/parser.h 57 57 src/Parser/parser.hh 58 src/demangler 58 59 59 60 tools/prettyprinter/parser.output -
driver/as.cc
rb7c89aa r381bea6 10 10 // Created On : Wed Aug 1 10:49:42 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Aug 2 17:50:09201813 // Update Count : 9 012 // Last Modified On : Wed Aug 22 17:30:24 2018 13 // Update Count : 93 14 14 // 15 15 … … 23 23 24 24 //#define __DEBUG_H__ 25 26 #ifdef __DEBUG_H__ 27 #include <iostream> 28 using namespace std; 29 #endif // __DEBUG_H__ 25 30 26 31 int main( const int argc, const char * argv[] ) { -
driver/cc1.cc
rb7c89aa r381bea6 10 10 // Created On : Fri Aug 26 14:23:51 2005 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 19 10:46:11201813 // Update Count : 1 1112 // Last Modified On : Thu Aug 23 09:48:40 2018 13 // Update Count : 122 14 14 // 15 15 … … 47 47 const string suffixes[NumSuffixes] = { "cfa", "hfa", }; 48 48 49 bool suffix( string arg ) { 49 50 void suffix( string arg, const char * args[], int & nargs ) { 50 51 //std::cerr << arg << std::endl; 51 52 size_t dot = arg.find_last_of( "." ); 52 53 //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; 54 55 string sx = arg.substr( dot + 1 ); 55 56 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 59 65 } // suffix 60 66 61 67 62 void checkEnv( const char * args[], int &nargs ) {68 void checkEnv( const char * args[], int & nargs ) { 63 69 char *value; 64 70 65 value = getenv( "__C OMPILER__" );71 value = getenv( "__CFA_COMPILER__" ); 66 72 if ( value != NULL ) { 67 73 compiler_name = value; … … 263 269 264 270 args[0] = compiler_name.c_str(); 271 suffix( cpp_in, args, nargs ); // check suffix 265 272 args[nargs] = cpp_in; 266 273 nargs += 1; … … 310 317 311 318 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 318 320 args[nargs] = cpp_in; // input to cpp 319 321 nargs += 1; … … 354 356 355 357 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(); 357 359 358 360 // Source file-name used to generate routine names containing global initializations for TU. -
driver/cfa.cc
rb7c89aa r381bea6 10 10 // Created On : Tue Aug 20 13:44:49 2002 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Aug 10 18:17:58201813 // Update Count : 2 5912 // Last Modified On : Thu Aug 23 15:41:55 2018 13 // Update Count : 270 14 14 // 15 15 … … 43 43 const string suffixes[NumSuffixes] = { "cfa", "hfa", }; 44 44 45 bool suffix( string arg) {45 void suffix( string arg, const char * args[], int & nargs ) { 46 46 //std::cerr << arg << std::endl; 47 47 size_t dot = arg.find_last_of( "." ); 48 48 //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; 50 50 string sx = arg.substr( dot + 1 ); 51 51 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 53 59 } // for 54 return false;55 60 } // suffix 56 61 … … 86 91 string Major( str( CFA_VERSION_MAJOR ) ), Minor( str( CFA_VERSION_MINOR ) ), Patch( str( CFA_VERSION_PATCH ) ); 87 92 88 string installincdir( CFA_INCDIR ); 89 string installlibdir( CFA_LIBDIR ); 90 string srcdriverdir ( TOP_BUILDDIR "driver"); 93 string installincdir( CFA_INCDIR ); // fixed location of include files 94 string installlibdir( CFA_LIBDIR ); // fixed location of cc1 and cfa-cpp commands when installed 95 string srcdriverdir ( TOP_BUILDDIR "driver"); // fixed location of cc1 and cfa-cpp commands when in tree 91 96 92 97 string heading; // banner printed at start of cfa compilation … … 178 183 if ( i == argc ) continue; // next argument available ? 179 184 compiler_path = argv[i]; 180 if ( putenv( (char *)( *new string( string( "__ U_COMPILER__=" ) + argv[i]) ).c_str() ) != 0 ) {185 if ( putenv( (char *)( *new string( string( "__CFA_COMPILER__=" ) + argv[i]) ).c_str() ) != 0 ) { 181 186 cerr << argv[0] << " error, cannot set environment variable." << endl; 182 187 exit( EXIT_FAILURE ); … … 294 299 } else { 295 300 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 301 303 // args[nargs] = ( *new string( string("-D__GCC_X__=c") ) ).c_str(); // add the argument for -x 302 304 // nargs += 1; … … 341 343 args[nargs] = "-I" CFA_INCDIR; 342 344 nargs += 1; 343 if ( ! noincstd_flag ) { 344 args[nargs] = "-I" CFA_INCDIR " /stdhdr";345 if ( ! noincstd_flag ) { // do not use during build 346 args[nargs] = "-I" CFA_INCDIR "stdhdr"; 345 347 nargs += 1; 346 348 } // 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"; 350 352 nargs += 1; 351 353 } else { 352 354 args[nargs] = "-I" TOP_SRCDIR "libcfa/src"; 353 355 nargs += 1; 354 if ( ! noincstd_flag ) { 356 if ( ! noincstd_flag ) { // do not use during build 355 357 args[nargs] = "-I" TOP_SRCDIR "libcfa/src" "/stdhdr"; 356 358 nargs += 1; … … 377 379 } 378 380 379 const char * const arch = m32 ? CFA_32_CPU : (m64 ? CFA_64_CPU : CFA_DEFAULT_CPU); 381 string arch = m32 ? CFA_32_CPU : (m64 ? CFA_64_CPU : CFA_DEFAULT_CPU); 382 if ( ! m32 && ! m64 && arch == "x86" ) { // no override and 32-bit architecture 383 args[nargs] = "-m32"; 384 nargs += 1; 385 } // if 380 386 const char * config = debug ? "debug": "nodebug"; 381 387 string libdir = libbase + arch + "-" + config; 382 if( !dirExists(libdir) ) { 388 389 if ( ! dirExists( libdir ) ) { 383 390 cerr << argv[0] << " internal error, configuration " << config << " not installed." << endl; 384 391 cerr << "Was looking for " << libdir << endl; 385 392 libdir = libbase + arch + "-" + "nolib"; 386 } 387 388 if ( !dirExists(libdir) ) {393 } // if 394 395 if ( ! dirExists( libdir ) ) { 389 396 cerr << argv[0] << " internal error, cannot find prelude directory." << endl; 390 397 cerr << "Was looking for " << libdir << endl; 391 398 exit( EXIT_FAILURE ); 392 } 399 } // if 393 400 394 401 args[nargs] = ( *new string( string("-D__CFA_FLAG__=--prelude-dir=" ) + libdir + (intree ? "/prelude" : "")) ).c_str(); … … 470 477 471 478 if ( Bprefix.length() == 0 ) { 472 Bprefix = !intree ? installlibdir : srcdriverdir; 479 Bprefix = ! intree ? installlibdir : srcdriverdir; 480 if ( Bprefix[Bprefix.length() - 1] != '/' ) Bprefix += '/'; 473 481 args[nargs] = ( *new string( string("-D__GCC_BPREFIX__=") + Bprefix ) ).c_str(); 474 482 nargs += 1; … … 504 512 args[nargs] = "-D__int8_t_defined"; // prevent gcc type-size attributes 505 513 nargs += 1; 506 args[nargs] = ( *new string( string("-B") + Bprefix + "/") ).c_str();514 args[nargs] = ( *new string( string("-B") + Bprefix ) ).c_str(); 507 515 nargs += 1; 508 516 args[nargs] = "-lm";
Note: See TracChangeset
for help on using the changeset viewer.