Commit Graph

69 Commits (31c234485a6bd0ce1dd9dc4ee726d065b5d52a0f)

Author SHA1 Message Date
yuyi 3732db2bcc
cgen: cleanup in gen_array_contains_methods() (#14274) 2022-05-03 20:46:07 +03:00
yuyi 276bd8060c
cgen: fix error for fixed array in operate (#14269) 2022-05-03 12:45:04 +03:00
yuyi 968d2b4654
cgen: fix fixed array init with `it` (#14251) 2022-05-02 02:00:45 +03:00
yuyi be513b4c27
cgen: split up array_init() (#14178) 2022-04-26 20:58:47 +03:00
yuyi aeba110d01
cgen: fix error for printing multi fixed array (#14141) 2022-04-25 14:42:05 +03:00
牧心 a810fbb80e
cgen: fix infix_expr_in_optimization compile error when treating some kind cannot directly use '==' (#14015) 2022-04-12 16:19:44 +03:00
牧心 25d8faabf6
cgen: fix alloc empty struct array error (#14007) 2022-04-11 14:16:09 +03:00
牧心 11d9a67e3b
cgen: fix invalid operands to `an_alias in an_array_of_aliased_values` (#13994) 2022-04-10 11:42:17 +03:00
crthpl b232a3b0d1
cgen: fix `.filter()` and `.map()` on shared arrays (#13954) 2022-04-07 18:05:11 +03:00
yuyi 509a8fcaf1
cgen: fix 'for in mut val' with 'if val in' (#13263) 2022-01-24 17:08:21 +02:00
yuyi 7c9cd855b4
cgen: fix fn call with fixed array literal arguments (#13225) 2022-01-20 15:04:16 +03:00
yuyi dfc23d939f
ast, checker, cgen: fix array of sumtype initialisation with a default `init:` (#13178) 2022-01-15 09:59:38 +02:00
Alexander Medvednikov 59ed4be49a all: update copyright year 2022-01-04 12:21:12 +03:00
Delyan Angelov ca5154747e cgen: fix `v -usecache examples/news_fetcher.v` on macos (.sort() compare_ functions duplication) 2021-12-29 20:15:51 +02:00
yuyi cd0b581445
ast: rename 'table.get_type_symbol()' to 'table.sym()' and more related calls (#12898) 2021-12-19 18:25:18 +02:00
yuyi 7c255f0ff2
builtin, cgen: fix array of map init with default value (#12885) 2021-12-18 10:07:25 +02:00
yuyi 758c18a906
cgen: fix for in mut val in array.index() (#12410) 2021-11-08 11:12:10 +02:00
ChAoS_UnItY 8cd01e0eac
cgen: fix error caused by fixed size array init syntax with variable it (#12314) 2021-10-28 02:20:49 +03:00
ChAoS_UnItY 4d1307f29b
all: index accessor in array init expression (#12181) 2021-10-15 03:57:49 +03:00
spaceface 9b6e07e2a6
cgen: support `index` and `in` for sumtype/interface arrays (#12051) 2021-10-03 15:44:13 +03:00
crthpl 85b58b03a3
cgen: parallelize (#10844) 2021-09-28 10:28:04 +03:00
yuyi 4c01627e00
cgen: cleanup stmt_path_pos processing (#11983) 2021-09-26 15:51:18 +03:00
yuyi e09860731f
cgen: fix if expr with complex nested array call (#11979) 2021-09-26 07:35:48 +03:00
yuyi d329e1decd
cgen: fix if expr with nested array calls (fix #11953) (#11973) 2021-09-25 20:38:33 +03:00
Ruofan XU 834cf40ab2
cgen, fmt, scanner: fix and use nested lambda in scanner (#11967) 2021-09-24 18:21:22 +03:00
yuyi 430677a0c0
cgen: format generated C code of nested array call (#11955) 2021-09-23 19:56:12 +03:00
zakuro b354f9ae9a
cgen: fix c error of if-expression when debug mode (#11950) 2021-09-23 14:52:32 +03:00
Delyan Angelov 930b95f76c
v.gen.c: fix uninitialised value usages regression after e5fb4e4 2021-09-23 12:24:03 +03:00
yuyi b8935551f1
cgen: fix nested array call (#11948) 2021-09-23 08:50:37 +03:00
yuyi 76e360ce86
cgen: format the generated C code for array map/filter/all/any methods (#11936) 2021-09-22 09:24:36 +03:00
yuyi e5fb4e4845
cgen: fix if expr with array call (fix #11557) (#11569) 2021-09-22 02:21:18 +03:00
yuyi de4c0c237b
cgen: fix if infix expr with array.all/any() (#11567) 2021-09-21 16:20:41 +03:00
yuyi 91c6eeeae5
cgen: fix `b := &[5, 6, 7]` (#11457) 2021-09-10 14:30:30 +03:00
crthpl a85467eb0f
cgen: fix `expr in shared_array` (#11319) 2021-08-27 11:48:32 +03:00
Lukas Neubert 3249f8f0e7
cgen: properly cast to sumtypes in array prepend and insert (#11289) 2021-08-24 06:25:09 +03:00
Enzo 506c30a291
builtin: remove methods that can be autogenerated (#11109) 2021-08-09 15:42:31 +03:00
Enzo 1a555ab898
v.gen.c: fix generation for `string.index` (#11106) 2021-08-09 07:39:15 +03:00
Enzo 7346aeca5f
cgen: refactor array sort generation (#11067) 2021-08-06 03:55:48 +03:00
yuyi b870f7a6f1
cgen: fix array sort error (#11046) 2021-08-04 06:31:57 +03:00
yuyi 2eb11110d6
cgen: fix autofree error of array init with string variable (fix #10427) (#11041) 2021-08-04 03:39:20 +03:00
Daniel Däschle 091ce6cc08
cgen: fix several sort declarations (#10919) 2021-07-23 08:55:55 +03:00
yuyi 7687b28d8d
cgen: remove Gen.write_expr_to_string() (#10804) 2021-07-15 08:15:28 +03:00
Enzo b351aa1289
gen: cleanup `Gen.array init` (#10613) 2021-06-30 09:45:18 +03:00
Delyan Angelov 63638fd271
cgen: optimize generated array.index(elem) 2021-06-28 17:45:13 +03:00
yuyi 6dbe8a8a2c
cgen: fix for in mut reference selector val (fix #10524) (#10536) 2021-06-21 19:25:18 +03:00
Uwe Krüger 0e2c86310a
GC-boehm: extend optimized mode to all `array` methods (#10406) 2021-06-10 21:26:17 +03:00
Enzo 886f69bfcf
all: use operator overloading on strings (p. 2) (#10183) 2021-05-24 11:38:31 +03:00
zakuro 82a9add25b
cgen: insert a newline every 8 elements in array init (#10034) 2021-05-08 13:35:21 +03:00
Delyan Angelov 53ae9dda4b
cgen: speed up auto generated Array_*_contains and Array_*_index methods
Uses a.data instead of array_get, since the auto generated methods
have the calls in a loop that guarantees that the bounds of the arrays
will not be exceeded, thus the inner bounds checking can be skipped.

Results in +5% improvement for V compiled with tcc, doing `v -o x.c cmd/v`,
more with -prod.
2021-05-02 20:35:04 +03:00
yuyi 7ddf569de6
cgen: fix generics multi_array in (#9885) 2021-04-26 19:59:40 +03:00