Changes in / [62502cc4:badd22f]
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
driver/cc1.cc
r62502cc4 rbadd22f 10 10 // Created On : Fri Aug 26 14:23:51 2005 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat May 30 18:09:05 202013 // Update Count : 40 412 // Last Modified On : Thu Aug 13 21:03:15 2020 13 // Update Count : 407 14 14 // 15 15 … … 170 170 if ( arg == "-quiet" ) { 171 171 } else if ( arg == "-imultilib" || arg == "-imultiarch" ) { 172 i += 1; // and theargument172 i += 1; // and argument 173 173 } else if ( prefix( arg, "-A" ) ) { 174 174 } else if ( prefix( arg, "-D__GNU" ) ) { … … 177 177 //******** 178 178 } else if ( arg == "-D" && prefix( argv[i + 1], "__GNU" ) ) { 179 i += 1; // and theargument179 i += 1; // and argument 180 180 181 181 // strip flags controlling cpp step … … 184 184 cpp_flag = true; 185 185 } else if ( arg == "-D" && string( argv[i + 1] ) == "__CPP__" ) { 186 i += 1; // and theargument186 i += 1; // and argument 187 187 cpp_flag = true; 188 188 … … 194 194 cpp_out = argv[i]; 195 195 } else { 196 args[nargs++] = argv[i]; // pass theflag along196 args[nargs++] = argv[i]; // pass flag along 197 197 // CPP flags with an argument 198 198 if ( arg == "-D" || arg == "-U" || arg == "-I" || arg == "-MF" || arg == "-MT" || arg == "-MQ" || … … 200 200 arg == "-iwithprefix" || arg == "-iwithprefixbefore" || arg == "-isystem" || arg == "-isysroot" ) { 201 201 i += 1; 202 args[nargs++] = argv[i]; // pass theargument along202 args[nargs++] = argv[i]; // pass argument along 203 203 #ifdef __DEBUG_H__ 204 204 cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl; 205 205 #endif // __DEBUG_H__ 206 206 } else if ( arg == "-MD" || arg == "-MMD" ) { 207 // gcc frontend generates the dependency file-name after the -MD/-MMD flag, but it is necessary to 208 // prefix that file name with -MF. 207 209 args[nargs++] = "-MF"; // insert before file 208 210 i += 1; 209 args[nargs++] = argv[i]; // pass theargument along211 args[nargs++] = argv[i]; // pass argument along 210 212 #ifdef __DEBUG_H__ 211 213 cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl; … … 279 281 // Run the C preprocessor and save the output in the given file. 280 282 281 if ( fork() == 0 ) { 283 if ( fork() == 0 ) { // child process ? 282 284 // -o xxx.ii cannot be used to write the output file from cpp because no output file is created if cpp detects 283 285 // an error (e.g., cannot find include file). Whereas, output is always generated, even when there is an error, … … 388 390 389 391 } else { 390 args[nargs++] = argv[i]; // pass theflag along392 args[nargs++] = argv[i]; // pass flag along 391 393 if ( arg == "-o" ) { 392 394 i += 1; 393 395 cpp_out = argv[i]; 394 args[nargs++] = argv[i]; // pass theargument along396 args[nargs++] = argv[i]; // pass argument along 395 397 #ifdef __DEBUG_H__ 396 398 cerr << "arg:\"" << argv[i] << "\"" << endl; -
driver/cfa.cc
r62502cc4 rbadd22f 10 10 // Created On : Tue Aug 20 13:44:49 2002 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat May 30 18:28:23202013 // Update Count : 43 312 // Last Modified On : Thu Aug 13 17:22:02 2020 13 // Update Count : 435 14 14 // 15 15 … … 180 180 181 181 if ( arg == "-Xlinker" || arg == "-o" ) { 182 args[nargs++] = argv[i]; // pass argumentalong182 args[nargs++] = argv[i]; // pass flag along 183 183 i += 1; 184 184 if ( i == argc ) continue; // next argument available ? 185 185 args[nargs++] = argv[i]; // pass argument along 186 186 if ( arg == "-o" ) o_file = i; // remember file 187 } else if ( strncmp(arg.c_str(), "-XCFA", 5) == 0 ) { 188 if (arg.size() == 5) {187 } else if ( strncmp(arg.c_str(), "-XCFA", 5) == 0 ) { // CFA pass through 188 if ( arg.size() == 5 ) { 189 189 i += 1; 190 if ( i == argc ) continue; 190 if ( i == argc ) continue; // next argument available ? 191 191 Putenv( argv, argv[i] ); 192 193 // CFA specific arguments 194 } 195 else if(arg[5] == ',') { 192 } else if ( arg[5] == ',' ) { // CFA specific arguments 196 193 Putenv( argv, argv[i] + 6 ); 197 198 // CFA specific arguments 199 } 200 else { 194 } else { // CFA specific arguments 201 195 args[nargs++] = argv[i]; 202 } 203 196 } // if 204 197 } else if ( arg == "-CFA" ) { 205 198 CFA_flag = true; // strip the -CFA flag … … 235 228 } else if ( arg == "-v" ) { 236 229 verbose = true; // verbosity required 237 args[nargs++] = argv[i]; // pass argumentalong230 args[nargs++] = argv[i]; // pass flag along 238 231 } else if ( arg == "-g" ) { 239 232 debugging = true; // symbolic debugging required 240 args[nargs++] = argv[i]; // pass argumentalong233 args[nargs++] = argv[i]; // pass flag along 241 234 } else if ( arg == "-save-temps" ) { 242 args[nargs++] = argv[i]; // pass argumentalong235 args[nargs++] = argv[i]; // pass flag along 243 236 Putenv( argv, arg ); // save cfa-cpp output 244 237 } else if ( prefix( arg, "-x" ) ) { // file suffix ? 245 238 string lang; 246 args[nargs++] = argv[i]; // pass argumentalong239 args[nargs++] = argv[i]; // pass flag along 247 240 if ( arg.length() == 2 ) { // separate argument ? 248 241 i += 1; … … 261 254 } else if ( prefix( arg, "-std=" ) || prefix( arg, "--std=" ) ) { 262 255 std_flag = true; // -std=XX provided 263 args[nargs++] = argv[i]; // pass argumentalong256 args[nargs++] = argv[i]; // pass flag along 264 257 } else if ( arg == "-w" ) { 265 args[nargs++] = argv[i]; // pass argumentalong258 args[nargs++] = argv[i]; // pass flag along 266 259 Putenv( argv, arg ); 267 260 } else if ( prefix( arg, "-W" ) ) { // check before next tests 268 261 if ( arg == "-Werror" || arg == "-Wall" ) { 269 args[nargs++] = argv[i]; // pass argumentalong262 args[nargs++] = argv[i]; // pass flag along 270 263 Putenv( argv, argv[i] ); 271 264 } else { … … 281 274 bprefix = arg.substr(2); // strip the -B flag 282 275 } else if ( arg == "-c" || arg == "-S" || arg == "-E" || arg == "-M" || arg == "-MM" ) { 283 args[nargs++] = argv[i]; // pass argumentalong276 args[nargs++] = argv[i]; // pass flag along 284 277 if ( arg == "-E" || arg == "-M" || arg == "-MM" ) { 285 278 cpp_flag = true; // cpp only 286 279 } // if 287 280 link = false; // no linkage required 281 } else if ( arg == "-D" || arg == "-U" || arg == "-I" || arg == "-MF" || arg == "-MT" || arg == "-MQ" || 282 arg == "-include" || arg == "-imacros" || arg == "-idirafter" || arg == "-iprefix" || 283 arg == "-iwithprefix" || arg == "-iwithprefixbefore" || arg == "-isystem" || arg == "-isysroot" ) { 284 args[nargs++] = argv[i]; // pass flag along 285 i += 1; 286 args[nargs++] = argv[i]; // pass argument along 288 287 } else if ( arg[1] == 'l' ) { 289 288 // if the user specifies a library, load it after user code -
libcfa/src/iostream.cfa
r62502cc4 rbadd22f 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Aug 10 09:32:14202013 // Update Count : 112 612 // Last Modified On : Tue Aug 11 22:16:33 2020 13 // Update Count : 1128 14 14 // 15 15 … … 37 37 38 38 forall( dtype ostype | ostream( ostype ) ) { 39 ostype & ?|?( ostype & os, zero_t ) {40 if ( $sepPrt( os ) ) fmt( os, "%s", $sepGetCur( os ) );41 fmt( os, "%d", 0n );42 return os;43 } // ?|?44 void ?|?( ostype & os, zero_t z ) {45 (ostype &)(os | z); ends( os );46 } // ?|?47 48 ostype & ?|?( ostype & os, one_t ) {49 if ( $sepPrt( os ) ) fmt( os, "%s", $sepGetCur( os ) );50 fmt( os, "%d", 1n );51 return os;52 } // ?|?53 void ?|?( ostype & os, one_t o ) {54 (ostype &)(os | o); ends( os );55 } // ?|?56 57 39 ostype & ?|?( ostype & os, bool b ) { 58 40 if ( $sepPrt( os ) ) fmt( os, "%s", $sepGetCur( os ) ); -
libcfa/src/iostream.hfa
r62502cc4 rbadd22f 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T hu Jul 16 07:43:32202013 // Update Count : 3 4812 // Last Modified On : Tue Aug 11 22:16:14 2020 13 // Update Count : 350 14 14 // 15 15 … … 67 67 68 68 forall( dtype ostype | ostream( ostype ) ) { 69 ostype & ?|?( ostype &, zero_t );70 void ?|?( ostype &, zero_t );71 ostype & ?|?( ostype &, one_t );72 void ?|?( ostype &, one_t );73 74 69 ostype & ?|?( ostype &, bool ); 75 70 void ?|?( ostype &, bool ); -
libcfa/src/stdlib.hfa
r62502cc4 rbadd22f 10 10 // Created On : Thu Jan 28 17:12:35 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T hu Jul 30 16:14:58202013 // Update Count : 49 012 // Last Modified On : Tue Aug 11 21:11:46 2020 13 // Update Count : 495 14 14 // 15 15 … … 136 136 T * alloc_set( char fill ) { 137 137 return (T *)memset( (T *)alloc(), (int)fill, sizeof(T) ); // initialize with fill value 138 } // alloc 139 140 T * alloc_set( Tfill ) {138 } // alloc_set 139 140 T * alloc_set( const T & fill ) { 141 141 return (T *)memcpy( (T *)alloc(), &fill, sizeof(T) ); // initialize with fill value 142 } // alloc 142 } // alloc_set 143 143 144 144 T * alloc_set( size_t dim, char fill ) { 145 145 return (T *)memset( (T *)alloc( dim ), (int)fill, dim * sizeof(T) ); // initialize with fill value 146 } // alloc 147 148 T * alloc_set( size_t dim, Tfill ) {146 } // alloc_set 147 148 T * alloc_set( size_t dim, const T & fill ) { 149 149 T * r = (T *)alloc( dim ); 150 150 for ( i; dim ) { memcpy( &r[i], &fill, sizeof(T) ); } // initialize with fill value 151 151 return r; 152 } // alloc 152 } // alloc_set 153 153 154 154 T * alloc_set( size_t dim, const T fill[] ) { 155 155 return (T *)memcpy( (T *)alloc( dim ), fill, dim * sizeof(T) ); // initialize with fill value 156 } // alloc 156 } // alloc_set 157 157 158 158 T * alloc_set( T ptr[], size_t dim, char fill ) { // realloc array with fill … … 166 166 } // alloc_set 167 167 168 T * alloc_set( T ptr[], size_t dim, T & fill ) { // realloc array with fill168 T * alloc_set( T ptr[], size_t dim, const T & fill ) { // realloc array with fill 169 169 size_t odim = malloc_size( ptr ) / sizeof(T); // current dimension 170 170 size_t nsize = dim * sizeof(T); // new allocation … … 177 177 } // if 178 178 return nptr; 179 } // alloc_ align_set179 } // alloc_set 180 180 } // distribution 181 181 … … 204 204 T * alloc_align_set( size_t align, char fill ) { 205 205 return (T *)memset( (T *)alloc_align( align ), (int)fill, sizeof(T) ); // initialize with fill value 206 } // alloc_align 207 208 T * alloc_align_set( size_t align, Tfill ) {206 } // alloc_align_set 207 208 T * alloc_align_set( size_t align, const T & fill ) { 209 209 return (T *)memcpy( (T *)alloc_align( align ), &fill, sizeof(T) ); // initialize with fill value 210 } // alloc_align 210 } // alloc_align_set 211 211 212 212 T * alloc_align_set( size_t align, size_t dim, char fill ) { 213 213 return (T *)memset( (T *)alloc_align( align, dim ), (int)fill, dim * sizeof(T) ); // initialize with fill value 214 } // alloc_align 215 216 T * alloc_align_set( size_t align, size_t dim, Tfill ) {214 } // alloc_align_set 215 216 T * alloc_align_set( size_t align, size_t dim, const T & fill ) { 217 217 T * r = (T *)alloc_align( align, dim ); 218 218 for ( i; dim ) { memcpy( &r[i], &fill, sizeof(T) ); } // initialize with fill value 219 219 return r; 220 } // alloc_align 220 } // alloc_align_set 221 221 222 222 T * alloc_align_set( size_t align, size_t dim, const T fill[] ) { 223 223 return (T *)memcpy( (T *)alloc_align( align, dim ), fill, dim * sizeof(T) ); 224 } // alloc_align 224 } // alloc_align_set 225 225 226 226 T * alloc_align_set( T ptr[], size_t align, size_t dim, char fill ) { … … 234 234 } // alloc_align_set 235 235 236 T * alloc_align_set( T ptr[], size_t align, size_t dim, T & fill ) {236 T * alloc_align_set( T ptr[], size_t align, size_t dim, const T & fill ) { 237 237 size_t odim = malloc_size( ptr ) / sizeof(T); // current dimension 238 238 size_t nsize = dim * sizeof(T); // new allocation
Note: See TracChangeset
for help on using the changeset viewer.