Changes in / [52df81c:2b22e050]
- Location:
- src
- Files:
-
- 4 edited
-
Parser/parser.yy (modified) (4 diffs)
-
driver/cc1.cc (modified) (3 diffs)
-
driver/cfa.cc (modified) (5 diffs)
-
libcfa/stdlib (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r52df81c r2b22e050 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed May 9 17:17:35201813 // Update Count : 32 4412 // Last Modified On : Fri May 11 17:51:38 2018 13 // Update Count : 3261 14 14 // 15 15 … … 2436 2436 { 2437 2437 for ( DeclarationNode * iter = $5; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) { 2438 iter->addQualifiers( $1->clone() ); 2438 if ( isMangled( iter->linkage ) ) { // ignore extern "C" 2439 iter->addQualifiers( $1->clone() ); 2440 } // if 2439 2441 } // for 2440 2442 xxx = false; … … 2449 2451 { 2450 2452 for ( DeclarationNode * iter = $5; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) { 2451 iter->addQualifiers( $1->clone() ); 2453 if ( isMangled( iter->linkage ) ) { // ignore extern "C" 2454 iter->addQualifiers( $1->clone() ); 2455 } // if 2452 2456 } // for 2453 2457 xxx = false; … … 2463 2467 { 2464 2468 for ( DeclarationNode * iter = $6; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) { 2465 iter->addQualifiers( $1->clone() ); 2466 iter->addQualifiers( $2->clone() ); 2469 if ( isMangled( iter->linkage ) && isMangled( $2->linkage ) ) { // ignore extern "C" 2470 iter->addQualifiers( $1->clone() ); 2471 iter->addQualifiers( $2->clone() ); 2472 } // if 2467 2473 } // for 2468 2474 xxx = false; -
src/driver/cc1.cc
r52df81c r2b22e050 10 10 // Created On : Fri Aug 26 14:23:51 2005 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jan 18 08:14:21 201713 // Update Count : 8112 // Last Modified On : Sat May 12 16:11:53 2018 13 // Update Count : 94 14 14 // 15 15 … … 32 32 string compiler_name( CFA_BACKEND_CC ); // path/name of C compiler 33 33 34 string D__GCC_X__( "-D__GCC_X__=" ); 34 35 string D__GCC_BPREFIX__( "-D__GCC_BPREFIX__=" ); 35 36 string D__CFA_FLAGPREFIX__( "-D__CFA_FLAG__=" ); … … 162 163 cargs[ncargs] = ( *new string( string( argv[i + 1] ).substr( D__CFA_FLAGPREFIX__.size() - 2 ) ) ).c_str(); 163 164 ncargs += 1; 165 i += 1; // and the argument 166 } else if ( prefix( arg, D__GCC_X__ ) ) { 167 args[nargs] = "-x"; 168 nargs += 1; 169 args[nargs] = ( *new string( arg.substr( D__GCC_X__.size() ) ) ).c_str(); // pass the flag along 170 nargs += 1; 171 } else if ( arg == "-D" && prefix( argv[i + 1], D__GCC_X__.substr(2) ) ) { 172 args[nargs] = "-x"; 173 nargs += 1; 174 args[nargs] = ( *new string( string( argv[i + 1] ).substr( D__GCC_X__.size() - 2 ) ) ).c_str(); // pass the flag along 175 nargs += 1; 164 176 i += 1; // and the argument 165 177 } else if ( prefix( arg, D__GCC_BPREFIX__ ) ) { -
src/driver/cfa.cc
r52df81c r2b22e050 10 10 // Created On : Tue Aug 20 13:44:49 2002 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed May 2 17:57:43201813 // Update Count : 2 2412 // Last Modified On : Mon May 14 07:52:50 2018 13 // Update Count : 243 14 14 // 15 15 … … 158 158 args[nargs] = argv[i]; // pass the argument along 159 159 nargs += 1; 160 } else if ( prefix( arg, "-std=" ) ) {160 } else if ( prefix( arg, "-std=" ) || prefix( arg, "--std=" ) ) { 161 161 std_flag = true; // -std=XX provided 162 162 args[nargs] = argv[i]; // pass the argument along 163 nargs += 1; 164 } else if ( arg == "-x" ) { // lost so force along 165 args[nargs] = argv[i]; // pass the argument along 166 nargs += 1; 167 i += 1; // advance to argument 168 args[nargs] = argv[i]; // pass the argument along 169 nargs += 1; 170 args[nargs] = ( *new string( string("-D__GCC_X__=") + argv[i] ) ).c_str(); // add the argument for -x 171 nargs += 1; 172 } else if ( prefix( arg, "-x" ) ) { // lost so force along 173 args[nargs] = argv[i]; // pass the argument along 174 nargs += 1; 175 args[nargs] = ( *new string( string("-D__GCC_X__=") + arg.substr(2) ) ).c_str(); // add the argument for -x 163 176 nargs += 1; 164 177 } else if ( arg == "-w" ) { … … 240 253 } // for 241 254 255 #ifdef __x86_64__ 256 args[nargs] = "-mcx16"; // allow double-wide CAA 257 nargs += 1; 258 #endif // __x86_64__ 259 242 260 #ifdef __DEBUG_H__ 243 261 cerr << "args:"; … … 268 286 if ( link ) { 269 287 #if ! defined(HAVE_LIBCFA_RELEASE) 270 if ( !debug ) {288 if ( ! debug ) { 271 289 cerr << "error: Option -nodebug is unavailable, libcfa was not installed." << endl; 272 290 exit( EXIT_FAILURE ); 273 }291 } // if 274 292 #endif 275 293 #if ! defined(HAVE_LIBCFA_DEBUG) 276 if ( debug ) {294 if ( debug ) { 277 295 cerr << "error: Option -debug is unavailable, libcfa-d was not installed." << endl; 278 296 exit( EXIT_FAILURE ); 279 }297 } // if 280 298 #endif 281 299 … … 292 310 args[nargs] = "-L" CFA_LIBDIR; 293 311 nargs += 1; 294 if ( debug ) {312 if ( debug ) { 295 313 args[nargs] = "-lcfa-d"; 296 314 } else { 297 315 args[nargs] = "-lcfa"; 298 } 316 } // if 299 317 nargs += 1; 300 318 args[nargs] = "-lpthread"; -
src/libcfa/stdlib
r52df81c r2b22e050 10 10 // Created On : Thu Jan 28 17:12:35 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jan 2 12:21:04201813 // Update Count : 29 212 // Last Modified On : Sun May 13 23:22:23 2018 13 // Update Count : 299 14 14 // 15 15 16 16 #pragma once 17 17 18 //#define _XOPEN_SOURCE 600 // posix_memalign, *rand48 18 #define __USE_ISOC11 // aligned_alloc 19 19 #include <stdlib.h> // strto*, *abs 20 20 … … 28 28 //--------------------------------------- 29 29 30 // allocation, non-array types 31 static inline forall( dtype T | sized(T) ) T * malloc( void ) { 32 // printf( "* malloc\n" ); 33 return (T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc 34 } // malloc 35 36 // static inline forall( dtype T | sized(T) ) T & malloc( void ) { 37 // int & p = *(T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc 38 // printf( "& malloc %p\n", &p ); 39 // return p; 40 // // return (T &)*(T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc 41 // } // malloc 42 43 extern "C" { void * calloc( size_t dim, size_t size ); } // default C routine 44 static inline forall( dtype T | sized(T) ) T * calloc( size_t dim ) { 45 //printf( "X2\n" ); 46 return (T *)(void *)calloc( dim, sizeof(T) ); // C cmalloc 47 } 48 49 extern "C" { void * realloc( void * ptr, size_t size ); } // default C routine for void * 50 static inline forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size ) { 51 //printf( "X3\n" ); 52 return (T *)(void *)realloc( (void *)ptr, size ); 53 } 54 55 extern "C" { void * memalign( size_t align, size_t size ); } // use default C routine for void * 56 static inline forall( dtype T | sized(T) ) T * memalign( size_t align ) { 57 //printf( "X4\n" ); 58 return (T *)memalign( align, sizeof(T) ); 59 } // memalign 60 61 static inline forall( dtype T | sized(T) ) T * aligned_alloc( size_t align ) { 62 //printf( "X5\n" ); 63 return (T *)memalign( align, sizeof(T) ); 64 } // aligned_alloc 65 66 extern "C" { int posix_memalign( void ** ptr, size_t align, size_t size ); } // use default C routine for void * 67 static inline forall( dtype T | sized(T) ) int posix_memalign( T ** ptr, size_t align ) { 68 //printf( "X6\n" ); 69 return posix_memalign( (void **)ptr, align, sizeof(T) ); 70 } // posix_memalign 71 72 73 extern "C" { void * memset( void * dest, int c, size_t size ); } // use default C routine for void * 74 75 static inline forall( dtype T | sized(T) ) T * alloc( void ) { 76 //printf( "X7\n" ); 77 return (T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc 78 } // alloc 79 static inline forall( dtype T | sized(T) ) T * alloc( char fill ) { 80 //printf( "X8\n" ); 81 T * ptr = (T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc 82 return (T *)memset( ptr, (int)fill, sizeof(T) ); // initial with fill value 83 } // alloc 84 85 static inline forall( dtype T | sized(T) ) T * alloc( size_t dim ) { 86 //printf( "X9\n" ); 87 return (T *)(void *)malloc( dim * (size_t)sizeof(T) ); // C malloc 88 } // alloc 89 static inline forall( dtype T | sized(T) ) T * alloc( size_t dim, char fill ) { 90 //printf( "X10\n" ); 91 T * ptr = (T *)(void *)malloc( dim * (size_t)sizeof(T) ); // C malloc 92 return (T *)memset( ptr, (int)fill, dim * sizeof(T) ); 93 } // alloc 94 95 static inline forall( dtype T | sized(T) ) T * alloc( T ptr[], size_t dim ) { 96 //printf( "X11\n" ); 97 return (T *)(void *)realloc( (void *)ptr, dim * (size_t)sizeof(T) ); // C realloc 98 } // alloc 30 // C dynamic allocation 31 static inline forall( dtype T | sized(T) ) { 32 T * malloc( void ) { 33 // printf( "* malloc\n" ); 34 return (T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc 35 } // malloc 36 37 // T & malloc( void ) { 38 // int & p = *(T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc 39 // printf( "& malloc %p\n", &p ); 40 // return p; 41 // // return (T &)*(T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc 42 // } // malloc 43 44 T * calloc( size_t dim ) { 45 //printf( "X2\n" ); 46 return (T *)(void *)calloc( dim, sizeof(T) ); // C calloc 47 } // calloc 48 49 T * realloc( T * ptr, size_t size ) { 50 //printf( "X3\n" ); 51 return (T *)(void *)realloc( (void *)ptr, size ); 52 } // realloc 53 54 extern "C" { void * memalign( size_t align, size_t size ); } // use default C routine for void * 55 T * memalign( size_t align ) { 56 //printf( "X4\n" ); 57 return (T *)memalign( align, sizeof(T) ); 58 } // memalign 59 60 extern "C" { void * aligned_alloc( size_t align, size_t size ); } // use default C routine for void * 61 T * aligned_alloc( size_t align ) { 62 //printf( "X5\n" ); 63 return (T *)aligned_alloc( align, sizeof(T) ); 64 } // aligned_alloc 65 66 int posix_memalign( T ** ptr, size_t align ) { 67 //printf( "X6\n" ); 68 return posix_memalign( (void **)ptr, align, sizeof(T) ); // C posix_memalign 69 } // posix_memalign 70 71 72 // Cforall dynamic allocation 73 extern "C" { void * memset( void * dest, int c, size_t size ); } // use default C routine for void * 74 75 T * alloc( void ) { 76 //printf( "X7\n" ); 77 return (T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc 78 } // alloc 79 80 T * alloc( char fill ) { 81 //printf( "X8\n" ); 82 T * ptr = (T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc 83 return (T *)memset( ptr, (int)fill, sizeof(T) ); // initial with fill value 84 } // alloc 85 86 T * alloc( size_t dim ) { 87 //printf( "X9\n" ); 88 return (T *)(void *)malloc( dim * (size_t)sizeof(T) ); // C malloc 89 } // alloc 90 91 T * alloc( size_t dim, char fill ) { 92 //printf( "X10\n" ); 93 T * ptr = (T *)(void *)malloc( dim * (size_t)sizeof(T) ); // C malloc 94 return (T *)memset( ptr, (int)fill, dim * sizeof(T) ); // initial with fill value 95 } // alloc 96 97 T * alloc( T ptr[], size_t dim ) { 98 //printf( "X11\n" ); 99 return (T *)(void *)realloc( (void *)ptr, dim * (size_t)sizeof(T) ); // C realloc 100 } // alloc 101 } // distribution 102 103 99 104 forall( dtype T | sized(T) ) T * alloc( T ptr[], size_t dim, char fill ); 100 105
Note:
See TracChangeset
for help on using the changeset viewer.