1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
Commit Graph

25 Commits

Author SHA1 Message Date
Delyan Angelov
b2ab7a333b transformer: improve -trace-calls output, enable tracing of builtin fns, show elapsed ns and used stack size (#16205)
Make it easier to change later, by splitting the tracing call into its own `v.trace_calls` module, so that it can be iterated upon without changing the compiler itself.
2022-10-25 20:56:12 +03:00
Delyan Angelov
3d2e251bf2 transformer: fix precalculations of simple expressions involving floating literals, with -prod (fix VSL tests with -prod) 2022-10-16 20:23:41 +03:00
shove
8b962f8446 checker: fix nested struct reference type field initialized check. (fix: #15741) (#15752) 2022-09-15 07:59:31 +03:00
Larpon
af8bd10761 v.pref: support v -trace-calls run file.v (#15450) 2022-08-18 11:45:37 +03:00
Delyan Angelov
e9809572b1 ast: use const empty_expr instead of fn empty_expr (thanks to Joe Conigliaro for the idea) (#15175) 2022-07-22 12:14:46 +03:00
Alexander Medvednikov
e76f74fd73 checker: unsafe 0 for references (default value) 2022-06-26 06:40:40 +03:00
lemon
e4e858b132 transformer: fix a bug with string literal length (#14757) 2022-06-14 12:42:45 +03:00
StunxFS
e24482a143 transformer: minor optimization for 'string literal'.len (#14207) 2022-04-28 22:35:16 +03:00
yuyi
27f9bc9ba0 checker: check error for match mut with immutable variable (fix #9704 #8976) (#13725) 2022-03-13 09:53:29 +02:00
yuyi
288b13b51d all: cleanup smartcasts in the compiler (#13639) 2022-03-03 10:48:31 +02:00
Tim Basel
9d0a5942ac builtin: change IError msg and code to methods + fix vlib, add a deprecation notice for the old usages (#13041) 2022-02-11 15:52:33 +02:00
yuyi
291a1ffd8d token: rename Position to Pos, rename position() to pos() (#13279) 2022-01-26 12:36:28 +02:00
Tim Basel
6c8e7f53b5 transformer: fix some missing stmt assignments (#13236) 2022-01-21 12:11:10 +02:00
Tim Basel
14b33baa3b transformer: refactor + apply transform to (hopefully) all nodes (#13216) 2022-01-20 08:40:16 +02:00
spaceface
d13fe7843c v: fix build and failing tests on arm64 (#12840) 2021-12-15 09:00:38 +02:00
Thomas Mangin
99f14a7ead transformer: only enable array optimisation with -prod (#12833) 2021-12-14 13:05:54 +02:00
Thomas Mangin
0d0d7323bb transformer: provide direct_memory_access to arrays when safe (#12724) 2021-12-11 21:55:46 +02:00
Delyan Angelov
6d97b0a407 checker: improve checking of a << b, when a and b are numbers (#12589) 2021-11-29 03:48:49 +03:00
ChAoS_UnItY
fe37da31a8 v.transformer: fix string always escaped by transformer (#12603) 2021-11-28 23:53:30 +02:00
yuyi
5a89c0a480 ast: change CompFor to ComptimeFor (#12482) 2021-11-17 08:29:43 +02:00
05st
fd3a10ab43 checker: fix mut check bypass with for in loops (#12208) 2021-10-17 06:41:39 +03:00
ChAoS_UnItY
6f629d1a6a transformer: eliminate unreachable branches & redundant branch expressions in MatchExpr (#12174) 2021-10-14 02:15:52 +03:00
ChAoS_UnItY
d0c961ebc0 transformer: eliminate unreachable branches in IfExpr and fold more expressions and statements (#12135)
* v: fix using constant as length in fixed array

* format test file

* v/trasnformer: discard unreachable if branches

* transform more expressions and statements

* replace IfExpr with EmptyExpr when all branches were eliminated

* fix typo

* fix gens

* only allows branch elimination on if expression statement

* fix native gen

* fix handling of multi branch ifs in the native backend, also allow for `if true {}`

Co-authored-by: KyleLin921021 <43753315+KyleLin921021@users.noreply.github.com>
Co-authored-by: Delyan Angelov <delian66@gmail.com>
2021-10-11 14:29:17 +03:00
ChAoS_UnItY
3647fc6633 parser: perform constant folding before checking size of fixed array (#12126) 2021-10-10 01:55:25 +03:00
Caden Haustein
cf0767ad6c v: add constant folding AST transformation (#11085) 2021-08-06 23:19:18 +03:00