github.com/gotranspile/cxgo@v0.3.7/examples/tcc/cxgo.yml (about) 1 vcs: https://repo.or.cz/tinycc.git 2 branch: 'release_0_9_27' 3 root: ./ 4 out: ../../.examples/tcc 5 package: main 6 int_size: 8 7 ptr_size: 8 8 use_go_int: true 9 ignore_include_dir: true 10 exec_before: ['./configure'] 11 files: 12 - name: elf.h 13 - name: libtcc.c 14 skip: 15 - TCCState 16 - gnu_ext 17 - tcc_ext 18 - tcc_state 19 replace: 20 - old: 'goto err' 21 new: 'tcc_error(libc.CString("unsupported linker option ''%s''"), option)' 22 - old: ' err:' 23 new: '' 24 - old: 'goto set_output_type' 25 new: | 26 if s.Output_type != 0 { 27 tcc_warning(libc.CString("-%s: overriding compiler action already specified"), popt.Name) 28 } 29 s.Output_type = x 30 - old: 'set_output_type:' 31 new: '' 32 - old: | 33 unsupported_option: 34 if s.Warn_unsupported != 0 { 35 tcc_warning(libc.CString("unsupported option '%s'"), r) 36 } 37 } 38 new: | 39 if s.Warn_unsupported != 0 { 40 tcc_warning(libc.CString("unsupported option '%s'"), r) 41 } 42 } 43 unsupported_option_after: 44 - old: 'goto unsupported_option' 45 new: | 46 if s.Warn_unsupported != 0 { 47 tcc_warning(libc.CString("unsupported option '%s'"), r) 48 } 49 goto unsupported_option_after 50 - old: 'goto extra_action' 51 new: | 52 arg_start = optind - 1 53 if arg_start != noaction { 54 tcc_error(libc.CString("cannot parse %s here"), r) 55 } 56 tool = x 57 - old: 'extra_action:' 58 new: '' 59 - name: tcc.c 60 skip: 61 - reg_classes 62 replace: 63 - old: 'type tcc_token int64' 64 new: 'type tcc_token = int' 65 - name: tccpp.c 66 replace: 67 - old: 'goto fail' 68 new: 'return 1' 69 - old: 'fail:' 70 new: '' 71 - old: 'addv:' 72 new: '' 73 - old: 'goto unterminated_string' 74 new: 'tcc_error(libc.CString("missing terminating %c character"), sep)' 75 - old: 'unterminated_string:' 76 new: '' 77 - old: 'add_char:' 78 new: '' 79 - old: 'goto add_char' 80 new: | 81 if str != nil { 82 cstr_ccat(str, c) 83 } 84 p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(p)) + 1)) 85 - old: 'goto addv' 86 new: | 87 *func() *byte { 88 p := &p 89 x := *p 90 *p = (*byte)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1)) 91 return x 92 }() = byte(v) 93 *p = '\x00' 94 - old: | 95 break 96 _default: 97 ; 98 fallthrough 99 default: 100 p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(p)) + 1)) 101 } 102 new: | 103 default: 104 p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(p)) + 1)) 105 } 106 _default_after: 107 - old: 'goto _default' 108 new: | 109 p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(p)) + 1)) 110 goto _default_after 111 - name: tccelf.c 112 - name: tccgen.c 113 flatten: 114 - gen_opl 115 - gen_op 116 - parse_btype 117 replace: 118 - old: 'save_found:' 119 new: '' 120 - old: 'goto save_found' 121 new: | 122 save_reg(r) 123 return r 124 - old: 'general_case:' 125 new: '' 126 - old: 'goto general_case' 127 new: | 128 if t1 == 4 || t2 == 4 || 4 == 8 && (t1 == 5 || t2 == 5) { 129 gen_opl(op) 130 } else { 131 gen_opi(op) 132 } 133 return 134 - old: 'goto invalid_operands' 135 new: 'tcc_error(libc.CString("invalid operands to binary %s"), get_tok_str(op, nil))' 136 - old: 'invalid_operands:' 137 new: '' 138 - old: 'add_tstr:' 139 new: '' 140 - old: 'goto add_tstr' 141 new: | 142 pstrcat(buf, buf_size, tstr) 143 break 144 - old: 'tstruct:' 145 new: '' 146 - old: 'goto tstruct' 147 new: | 148 pstrcat(buf, buf_size, tstr) 149 v = type_.Ref.V & ^int(0x40000000) 150 if v >= 0x10000000 { 151 pstrcat(buf, buf_size, libc.CString("<anonymous>")) 152 } else { 153 pstrcat(buf, buf_size, get_tok_str(v, nil)) 154 } 155 - name: tcctools.c 156 - name: i386-gen.c 157 flatten: 158 - gen_opi 159 - name: i386-link.c