Changeset 130a778
- Timestamp:
- Dec 7, 2021, 8:56:22 PM (18 months ago)
- Branches:
- ADT, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 88792f3
- Parents:
- 63f2697
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
driver/as.cc
r63f2697 r130a778 11 11 // Created On : Wed Aug 1 10:49:42 2018 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Tue Dec 7 16:56:24202114 // Update Count : 1 1513 // Last Modified On : Tue Dec 7 20:49:15 2021 14 // Update Count : 121 15 15 // 16 16 … … 51 51 if ( (dcursor = strstr( start, ".Ldebug_info0:" ) ) ) { // debug information ? 52 52 53 if ( char * cursor = strstr( dcursor, ".long\t.LASF" ) ) { // debug information?53 if ( char * cursor = strstr( dcursor, ".long\t.LASF" ) ) { // language code ? 54 54 for ( int i = 0; i < 2; i += 1 ) { // move N (magic) lines forward 55 55 cursor = strstr( cursor, "\n" ) + 1; 56 56 } // for 57 58 cursor -= 2; // backup over "c\n" language value 59 if ( *(cursor - 1) != 'x' ) { // 0x before code 57 cursor -= 1; // backup over '\n' 58 if ( (*(cursor - 3) == '0' && *(cursor - 2) == 'x' && *(cursor - 1) == 'c') ) { // 0xc => C99 59 // Expand file by one byte to hold 2 character Cforall language code. 60 if ( ftruncate( fd, size + 1 ) ) { perror( "ftruncate" ); exit( EXIT_FAILURE ); }; 61 memmove( cursor + 1, cursor, start + size - cursor ); // move remaining text 1 character right 62 } else if ( *(cursor - 4) == '0' && *(cursor - 3) == 'x' && *(cursor - 2) == '1' && *(cursor - 1) == 'd' ) { // 0x1d => C11 63 // replace "1d" with "25" 64 } else { 60 65 for ( int i = 0; i < 6; i += 1 ) { // move N (magic) lines forward 61 66 cursor = strstr( cursor, "\n" ) + 1; … … 65 70 argv[argc - 1], (int)(cursor - dcursor), dcursor ); 66 71 exit( EXIT_FAILURE ); 67 } ;72 } // if 68 73 69 // Expand file by one byte to hold 2 character Cforall language code. 70 if ( ftruncate( fd, size + 1 ) ) { perror( "ftruncate" ); exit( EXIT_FAILURE ); }; 71 72 memmove( cursor + 2, cursor + 1, start + size - cursor - 1 ); // move remaining text 1 character right 73 74 *(cursor) = '2'; // replace C language value with CFA 75 *(cursor + 1) = '5'; 74 *(cursor - 2) = '2'; // replace C/C11 language value with CFA 75 *(cursor - 1) = '5'; 76 76 } // if 77 77 } // if
Note: See TracChangeset
for help on using the changeset viewer.