Changeset 58e0d3c for driver/as.cc
- Timestamp:
- Dec 8, 2021, 7:46:13 AM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- a499702
- Parents:
- 88792f3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
driver/as.cc
r88792f3 r58e0d3c 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 21:15:25202114 // Update Count : 13 213 // Last Modified On : Wed Dec 8 07:34:12 2021 14 // Update Count : 135 15 15 // 16 16 … … 50 50 cursor = strstr( cursor, "\n" ) + 1; 51 51 } // for 52 cursor -= 1; // backup over '\n'52 cursor -= 2; // backup over "d\n", where d is a hex digit 53 53 // From elfcpp/dwarf.h in the binutils source tree. 54 54 // DW_LANG_C89 = 0x1, DW_LANG_C = 0x2, DW_LANG_C99 = 0xc, DW_LANG_C11 = 0x1d 55 if ( *(cursor - 3) == '0' && *(cursor - 2) == 'x' &&56 (* (cursor - 1) == 'c' || *(cursor - 1) == '1' || *(cursor - 1) == '2') ) { // C89/C/C9955 if ( *(cursor - 2) == '0' && *(cursor - 1) == 'x' && 56 (*cursor == 'c' || *cursor == '1' || *cursor == '2') ) { // C99/C89/C 57 57 // Expand file by one byte to hold 2 character Cforall language code. 58 58 if ( ftruncate( fd, size + 1 ) ) { perror( "ftruncate" ); exit( EXIT_FAILURE ); }; 59 memmove( cursor + 1, cursor, start + size - cursor); // move remaining text 1 character right60 } else if ( *(cursor - 4) == '0' && *(cursor - 3) == 'x' && *(cursor - 2) == '1' && *(cursor - 1)== 'd' ) { // C1159 memmove( cursor + 2, cursor + 1, start + size - cursor - 1 ); // move remaining text 1 character right 60 } else if ( *(cursor - 3) == '0' && *(cursor - 2) == 'x' && *(cursor - 1) == '1' && *cursor == 'd' ) { // C11 61 61 } else { 62 62 for ( int i = 0; i < 6; i += 1 ) { // move N (magic) lines forward … … 69 69 } // if 70 70 71 *(cursor - 2) = '2'; // replace C89/C/C99/C11 language code with CFA code72 * (cursor - 1)= '5';71 *(cursor - 1) = '2'; // replace C89/C/C99/C11 language code with CFA code 72 *cursor = '5'; 73 73 } // if 74 74 } // if
Note: See TracChangeset
for help on using the changeset viewer.