comparison gcc/go/gofrontend/runtime.cc @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
28 RFT_BOOL, 28 RFT_BOOL,
29 // Go type *bool, C type _Bool*. 29 // Go type *bool, C type _Bool*.
30 RFT_BOOLPTR, 30 RFT_BOOLPTR,
31 // Go type int, C type intgo. 31 // Go type int, C type intgo.
32 RFT_INT, 32 RFT_INT,
33 // Go type uint, C type uintgo.
34 RFT_UINT,
35 // Go type uint8, C type uint8_t.
36 RFT_UINT8,
37 // Go type uint16, C type uint16_t.
38 RFT_UINT16,
33 // Go type int32, C type int32_t. 39 // Go type int32, C type int32_t.
34 RFT_INT32, 40 RFT_INT32,
41 // Go type uint32, C type uint32_t.
42 RFT_UINT32,
35 // Go type int64, C type int64_t. 43 // Go type int64, C type int64_t.
36 RFT_INT64, 44 RFT_INT64,
37 // Go type uint64, C type uint64_t. 45 // Go type uint64, C type uint64_t.
38 RFT_UINT64, 46 RFT_UINT64,
39 // Go type uintptr, C type uintptr_t. 47 // Go type uintptr, C type uintptr_t.
58 RFT_CHAN, 66 RFT_CHAN,
59 // Go type non-empty interface, C type struct __go_interface. 67 // Go type non-empty interface, C type struct __go_interface.
60 RFT_IFACE, 68 RFT_IFACE,
61 // Go type interface{}, C type struct __go_empty_interface. 69 // Go type interface{}, C type struct __go_empty_interface.
62 RFT_EFACE, 70 RFT_EFACE,
63 // Go type func(unsafe.Pointer), C type void (*) (void *).
64 RFT_FUNC_PTR,
65 // Pointer to Go type descriptor. 71 // Pointer to Go type descriptor.
66 RFT_TYPE, 72 RFT_TYPE,
67 // [2]string. 73 // [2]string.
68 RFT_ARRAY2STRING, 74 RFT_ARRAY2STRING,
69 // [3]string. 75 // [3]string.
107 113
108 case RFT_INT: 114 case RFT_INT:
109 t = Type::lookup_integer_type("int"); 115 t = Type::lookup_integer_type("int");
110 break; 116 break;
111 117
118 case RFT_UINT:
119 t = Type::lookup_integer_type("uint");
120 break;
121
122 case RFT_UINT8:
123 t = Type::lookup_integer_type("uint8");
124 break;
125
126 case RFT_UINT16:
127 t = Type::lookup_integer_type("uint16");
128 break;
129
112 case RFT_INT32: 130 case RFT_INT32:
113 t = Type::lookup_integer_type("int32"); 131 t = Type::lookup_integer_type("int32");
132 break;
133
134 case RFT_UINT32:
135 t = Type::lookup_integer_type("uint32");
114 break; 136 break;
115 137
116 case RFT_INT64: 138 case RFT_INT64:
117 t = Type::lookup_integer_type("int64"); 139 t = Type::lookup_integer_type("int64");
118 break; 140 break;
174 196
175 case RFT_EFACE: 197 case RFT_EFACE:
176 t = Type::make_empty_interface_type(bloc); 198 t = Type::make_empty_interface_type(bloc);
177 break; 199 break;
178 200
179 case RFT_FUNC_PTR:
180 {
181 Typed_identifier_list* param_types = new Typed_identifier_list();
182 Type* ptrtype = runtime_function_type(RFT_POINTER);
183 param_types->push_back(Typed_identifier("", ptrtype, bloc));
184 t = Type::make_function_type(NULL, param_types, NULL, bloc);
185 }
186 break;
187
188 case RFT_TYPE: 201 case RFT_TYPE:
189 t = Type::make_type_descriptor_ptr_type(); 202 t = Type::make_type_descriptor_ptr_type();
190 break; 203 break;
191 204
192 case RFT_ARRAY2STRING: 205 case RFT_ARRAY2STRING:
253 go_unreachable(); 266 go_unreachable();
254 267
255 case RFT_BOOL: 268 case RFT_BOOL:
256 case RFT_BOOLPTR: 269 case RFT_BOOLPTR:
257 case RFT_INT: 270 case RFT_INT:
271 case RFT_UINT:
272 case RFT_UINT8:
273 case RFT_UINT16:
258 case RFT_INT32: 274 case RFT_INT32:
275 case RFT_UINT32:
259 case RFT_INT64: 276 case RFT_INT64:
260 case RFT_UINT64: 277 case RFT_UINT64:
261 case RFT_UINTPTR: 278 case RFT_UINTPTR:
262 case RFT_RUNE: 279 case RFT_RUNE:
263 case RFT_FLOAT64: 280 case RFT_FLOAT64:
264 case RFT_COMPLEX64: 281 case RFT_COMPLEX64:
265 case RFT_COMPLEX128: 282 case RFT_COMPLEX128:
266 case RFT_STRING: 283 case RFT_STRING:
267 case RFT_POINTER: 284 case RFT_POINTER:
268 case RFT_FUNC_PTR:
269 { 285 {
270 Type* t = runtime_function_type(bft); 286 Type* t = runtime_function_type(bft);
271 if (!Type::are_identical(t, e->type(), true, NULL)) 287 if (!Type::are_identical(t, e->type(), true, NULL))
272 e = Expression::make_cast(t, e, loc); 288 e = Expression::make_cast(t, e, loc);
273 return e; 289 return e;