Commit Graph

450 Commits (870ed86afc4023d46ca2433285de20b4c2e5d088)

Author SHA1 Message Date
Emily Hudson 535dcac8fa
net: ipv6 support, merge unix+ip;[pack:x] attribute (#9904) 2021-06-13 23:53:38 +03:00
Delyan Angelov 2ff0f62866
v: fix passing `-arch arm64` to `$if arm64{}` 2021-06-13 01:15:35 +03:00
Delyan Angelov 9f6c4030f6 tests: fix `-cstrict` self compilation on m0 with clang 2021-06-07 18:23:18 +03:00
Delyan Angelov 007ba5178e
v: add more timing points 2021-06-06 12:23:00 +03:00
Delyan Angelov 603e57745f
builder: use some -cstrict flags only with clang (gcc does not understand them) 2021-05-23 21:00:48 +03:00
Delyan Angelov bc01de2181
ast: mark ast.File{} with `[heap]`, and use []&ast.File consistently 2021-05-22 19:06:55 +03:00
Delyan Angelov ac469f5eff
v.depgraph: fix detection of indirect module dependency cycles 2021-05-20 01:53:41 +03:00
Delyan Angelov 20a22453cf
v.builder: remove default link flags -lm, -ldl, -lpthread (use module specific link flags instead) (#10099) 2021-05-14 14:28:53 +03:00
kevin70g 28a22e5a84
v.builder: try finding msvc from env variables, when not found from registry (#10072) 2021-05-10 10:15:50 +03:00
Delyan Angelov 3aa85bb5d7
v.ast: ensure interface->types info is complete 2021-05-06 19:48:11 +03:00
Delyan Angelov 483068f071
ci: fix tests-sanitize-undefined-gcc job 2021-05-06 15:15:35 +03:00
Delyan Angelov adffae4453
v.builder: refactor to make adding other post checker stages easier 2021-05-06 14:37:49 +03:00
Rhialto The M c21df2d44c
v: building on NetBSD (#9953) 2021-05-03 19:50:54 +03:00
Alexander Medvednikov e949d4b26c tools/fast: add "V lines" and "V lines/s" 2021-04-30 15:31:50 +03:00
Lukas Neubert dee733aae4
fmt: reset const field align after multi line exprs (#9916) 2021-04-29 02:17:37 +03:00
pancake 1eac6eee59 native: use pref.arch to host_arch() by default 2021-04-27 12:24:58 +03:00
pancake 6750ed254f x64: rename to `native` to not conflict with the x64 comptime variable 2021-04-27 12:24:58 +03:00
pancake b951d679ca
x64: handle -arch amd64/arm64 and -os for raw/linux/macos options (#9844) 2021-04-22 15:44:25 +03:00
Enzo c174bfa52f
tools: add a `v bug file.v` tool to automatically report bugs on GitHub (#9746) 2021-04-19 21:40:54 +03:00
spaceface 73352583e7
ci: fix all `-cstrict` warnings with gcc and clang (#9792) 2021-04-19 15:38:48 +03:00
Gaetano 1c7fb65491
builder: fix a bug that happens with local modules (#9701) 2021-04-17 08:30:03 +03:00
Delyan Angelov d90be54850
v: add -cstrict for optionally turning on all ccoptions.wargs 2021-04-15 14:56:45 +03:00
Leah Lundqvist cfaba49683
ios: move `sokol` declarations out of builder, and support non-sokol apps too (#9703) 2021-04-12 19:35:06 +03:00
crthpl 903dd49212
v: add support for `$if freestanding {`, without using it (part 1) (#9656) 2021-04-09 23:24:25 +03:00
Delyan Angelov 7c79e9bce7
v.builder: streamline -stats output between backends. add a 'compilation speed' stat too 2021-04-08 12:18:16 +03:00
Delyan Angelov 9c67a1cf62
ci: fix the `v -autofree cmd/v` job 2021-04-07 18:37:30 +03:00
Delyan Angelov de5cf4ac5e
v: show the number of processed bytes and lines for V source code with -stats 2021-04-07 18:12:27 +03:00
Delyan Angelov 90b123c27b
ci: fix self compilation on windows 2021-04-05 15:47:43 +03:00
Delyan Angelov 897cd4cec2
builder: update cached .o files when their .c file is newer 2021-04-02 08:49:54 +03:00
Alexander Medvednikov 7385f8e56b all: a massive merge of ast and table modules 2021-04-02 01:57:09 +03:00
yuyi 5c21c748c9
builder,checker,table: simpify generics unwrap and struct processing (#9531) 2021-03-30 15:23:17 +03:00
Lukas Neubert 1b572f75e8
fmt: minor array wrap improvement (#9420) 2021-03-22 23:06:12 +01:00
Delyan Angelov a00c80b98f
v: support compiler notices. Use them for `[deprecated_after: '2021-05-01']` tags
Compiler notices are like warnings, with these differences:
   a) notices use a different color.
   b) notices use a different label.
   c) notices do not prevent compilation with -prod.
   (warnings are converted to errors with -prod)
2021-03-22 19:59:00 +02:00
Larpon b7a0c44f39
builder: allow running symlinked .vsh files (#9385) 2021-03-20 17:25:09 +01:00
Delyan Angelov a386be6505
v.table: correct `table.types` to `table.type_symbols` 2021-03-19 22:51:52 +02:00
Delyan Angelov 1753445a64
builtin: make panics more IDE friendly 2021-03-16 20:50:11 +02:00
Leah Lundqvist 0823ea4af1
builder: produce an iOS binary instead of a bundle (#9316) 2021-03-15 19:03:05 +01:00
Delyan Angelov 69f1e7c9c3
v: fixes for `v -autofree -o v2 cmd/v` 2021-03-14 09:37:38 +02:00
Nick Treleaven df46fe1373
builder: warn when using tcc with -prod (#9288) 2021-03-14 01:55:14 +01:00
Delyan Angelov d7049ae2da
os: deprecate os.exec (returning ?os.Result), in favour of os.execute, which returns os.Result (#8974) 2021-03-08 20:52:13 +02:00
Nick Treleaven dc04c3196b
builder: fix detecting duplicate functions (#9033) 2021-03-01 21:38:31 +01:00
spaceface b712af56fd
all: bring back `panic(err.msg)` -> `panic(err)` (#9022) 2021-03-01 00:18:14 +01:00
spaceface d63b7bc35a
all: update repo to use the new error handling syntax (#8950) 2021-02-28 23:20:21 +03:00
Alexander Medvednikov d39866d4f7 cgen: optionals/autofree fixes 2021-02-27 17:11:30 +03:00
Lukas Neubert 2c609411dd
fmt: do not write single line or blocks with multi line stmts (#8952) 2021-02-26 08:41:24 +02:00
Delyan Angelov 77b3440e44
builder: make C compilation retrying more uniform 2021-02-25 11:56:54 +02:00
Delyan Angelov 1c0eefae38
parser/scanner: replace p.peek_tok2/3 with p.peek_token(2/3) (#8946) 2021-02-24 21:03:53 +03:00
Delyan Angelov 9ab291319c
builder: fix thirdparty object files compilation with tcc (no -lxyz with -c) 2021-02-22 08:18:24 +02:00
Stanislav Ershov 44177c4e7c
builder: use stable MSVC version instead preview (#8867) 2021-02-21 00:00:44 +02:00
spaceface cc3fd5333b
builder: print tcc output, when the system C compiler also failed (#8835) 2021-02-20 18:52:54 +02:00
Alexander Medvednikov 0dbc9417e7 builder: vfmt msvc.v 2021-02-18 17:00:07 +03:00
Stanislav Ershov 51dd22bcc0
builder: support -m32/-m64 flags for msvc (#8819) 2021-02-18 14:58:47 +01:00
zakuro d3bcd5d305
fmt: keep single line if in struct init (#8734) 2021-02-14 19:22:24 +01:00
Delyan Angelov 3d29f819cf
builder: add markused.mark_used calls to js.v and x64.v 2021-02-13 18:09:04 +02:00
Delyan Angelov e809264f12
builder,checker: split the unused marking into a new `v.markused` module 2021-02-13 18:02:31 +02:00
Delyan Angelov 93c1c1cec3
builder: add generated C lines with -stats too 2021-02-11 08:38:09 +02:00
Delyan Angelov de287c0add
builder: add C source code size info on -stats 2021-02-10 19:12:12 +02:00
Delyan Angelov 16dffc7c1d
compiler: move timing_start/timing_measure to util.timing_start/util.timing_measure 2021-02-05 16:34:56 +02:00
Delyan Angelov e5c9fcb7e9
ci: fix building vdoc, vls, etc 2021-02-05 09:27:14 +02:00
Alexander Medvednikov 1084b43ffb all: ast walker for marking unused fns 2021-02-05 08:05:35 +01:00
Ekopalypse 5eef730290
builder: make msvc build if v path contains spaces (#8552) 2021-02-04 20:45:59 +01:00
Ekopalypse 856246c858
builder: make repl work if path contains spaces (#8550) 2021-02-04 18:18:18 +01:00
pancake 27239db427
builder: show file:line when import fails (#8537) 2021-02-04 09:09:54 +02:00
joe-conigliaro ffedbe4b81
cgen: move cgen from v.gen to v.gen.c (#8515) 2021-02-02 15:41:51 +01:00
Lukas Neubert d660f2cc6f
fmt: insert newline after last HashStmt (#8482) 2021-02-01 14:50:41 +01:00
Delyan Angelov 7f5d654c3a
all: cleanup redundant `.ends_with(_test.v)` calls 2021-01-30 11:08:52 +02:00
Delyan Angelov 760b4c37b9
all: support _test.vv files (to test _test.v errors/checks too) 2021-01-30 10:42:18 +02:00
Delyan Angelov 948f63b507
checker,builder: rename `details:` to `Details:` 2021-01-30 10:20:09 +02:00
Delyan Angelov 8398e2f448
ci: fix -usecache for programs using thirdparty C libs 2021-01-29 19:44:33 +02:00
Delyan Angelov 9f31829e0c ci: fix failing clipboard_test.v on macos 2021-01-29 18:59:44 +02:00
Delyan Angelov 2326a3a1e1
builder: small cleanup, use .dump_c_options in Builder.cc_linux_cross/0 too 2021-01-29 18:30:40 +02:00
Delyan Angelov 4d180171ba
builder: implement `-dump-c-flags flags.txt` 2021-01-29 18:05:14 +02:00
Lukas Neubert 75d85403a6
fmt: better ternary concat wrapping (#8379) 2021-01-28 11:23:48 +01:00
Delyan Angelov e5a84719ca
all: require calling `optfn() ?` / `optfn() or {...}` for `fn optfn() ? {}` 2021-01-26 16:43:17 +02:00
Delyan Angelov 728344ff65
ci: fix `v test-cleancode` 2021-01-25 12:55:01 +02:00
Alexander Medvednikov d991712b3c gg: native rendering mode on macOS 2021-01-23 10:25:43 +01:00
Lukas Neubert 8b61891348
fmt: smarter if condition wrapping (#8201) 2021-01-23 10:33:22 +02:00
joe-conigliaro 97ebecc5f4
usecache: get all tests running with -usecache enabled by default (p.1) (#7699) 2021-01-20 06:04:59 +01:00
Lukas Neubert ac2c3847af
all: update copyright to 2019-2021 (#8029) 2021-01-18 13:20:06 +01:00
Lukas Neubert 16c9cbce7c
fmt: correctly increase f.line_len for write_indent (#8174) 2021-01-18 06:02:29 +01:00
Delyan Angelov 8571d9395b
preludes: move to vlib/v/preludes 2021-01-16 14:43:24 +02:00
Daniel Däschle 53941c4a0a
fmt: fix if cond break readability (#8132) 2021-01-16 02:12:17 +01:00
zakuro 254df0ca62
fmt: improve string quotes (#8075) 2021-01-13 06:05:27 +01:00
zakuro 33694665f0
fmt: align each contiguous field of struct. not the whole. (#7981) 2021-01-12 04:38:43 +01:00
Delyan Angelov aa37382e8d
tools: let `v fmt` use VTMP too, stabilise `v test-cleancode` 2021-01-09 20:41:15 +02:00
yuyi 9d9ca0ab5e
builder: auto cleanup xxx.def generated by tcc on windows (#7878) 2021-01-05 17:07:07 +02:00
Alexander Medvednikov baae302894 cc: use -g instead of -g3 2021-01-04 00:15:27 +01:00
Alexander Medvednikov f7b3ed2f4a cc: hide a print behind -v 2020-12-31 14:24:34 +01:00
Delyan Angelov 100b3704cd
v.pref: fix `-nocache`, add `-no-retry-compilation`, add `-d trace_use_cache` 2020-12-28 09:42:43 +02:00
Lukas Neubert 06fdf34214
fmt: unwrap long single line ifs (#7608) 2020-12-27 14:20:30 +01:00
spaceface 214290d55b
fmt: add a space around single-line `unsafe` expressions (#7505) 2020-12-23 19:13:42 +01:00
Lukas Neubert c4aae2b55f
vfmt: do not replace module aliases in fn param and return types (#7472) 2020-12-22 22:38:13 +02:00
joe-conigliaro d5b03d16e0
builder: if fpath is a descendant of modules folder add it as a search path 2020-12-22 22:32:02 +11:00
joe-conigliaro dd27d0a2a3
cgen/builder: make unused-command-line-argument a warning & cgen module_built fix 2020-12-22 19:21:05 +11:00
spaceface c544cc508b
pref: fix cross-compiling graphical apps to Windows (#7449) 2020-12-21 19:45:12 +02:00
Delyan Angelov dc3a6bb169
builder: use the same compilation mode for thirdparty object files (#7450) 2020-12-21 17:46:26 +01:00
Alexander Medvednikov 583c02316a checker: more arr1=arr2 fixes 2020-12-20 15:21:32 +01:00
Delyan Angelov 4b45f2eaab builder: do not remove executables after run when -keepc is passed; add `-d trace_thirdparty_obj_files` 2020-12-20 12:22:17 +02:00
joe-conigliaro 12d5720841
builder: don't pass -usecache linker flags when building modules 2020-12-20 18:23:54 +11:00
Delyan Angelov 2f1cc2bd08
v.util: simplify the sorting of v's timing output 2020-12-19 12:55:42 +02:00
ka-weihe 5788d6d768
cc: enable more C warnings (#7401) 2020-12-18 23:33:51 +02:00
Delyan Angelov 7e1e247f56
builder: implement b.timing_start/1 and b.timing_measure/1 2020-12-18 13:21:17 +02:00
joe-conigliaro 05e15bdd59
builder/cgen: fix -usecache using absolute mod paths (ui examples ~/.vmodules) 2020-12-18 11:21:40 +11:00
joe-conigliaro 05e101bd95
builder: v fmt cc.v 2020-12-17 16:51:13 +11:00
joe-conigliaro 40bad75a8f
builder: temp macos self -usecache fix (will break -usecache with ~/.vmodules/ui) 2020-12-17 16:46:20 +11:00
joe-conigliaro f2f32626bc
all: get -usecache working with mods in ~/.vmodules (ui examples) 2020-12-17 16:08:28 +11:00
Delyan Angelov 3a9034a0d0
dl: add a complete tested shared library generation/usage example 2020-12-15 18:22:07 +02:00
joe-conigliaro 239a8c8aa3
cgen: cached modules fixes (#7345) 2020-12-15 16:07:06 +01:00
Delyan Angelov 8067fcee57
builder: change the tcc recompilation failed message 2020-12-15 10:47:41 +02:00
ka-weihe 4d025582c0
cgen: fix shadowing warning (#7289) 2020-12-12 23:06:02 +01:00
Delyan Angelov 3386526610
builder: improve support for -g in cross compilation to windows 2020-12-07 23:38:21 +02:00
Delyan Angelov 1914bc790b
builder: add comment about the goal of cflags.c_options_only_object_files() in cross compilation 2020-12-07 20:35:04 +02:00
Delyan Angelov 4b4733d6b4
builder: fix cross compilation of examples from linux->windows 2020-12-07 19:57:12 +02:00
Delyan Angelov daa659e1fd
builder: allow for `-os windows -cc msvc -o x.c` on any platform 2020-12-05 15:35:39 +02:00
Delyan Angelov fbf6910ab9
builder: remove executables after `v run file.v` 2020-12-05 13:03:12 +02:00
spaceface777 50a3009113
fmt: make single-stmt `or` blocks single-line (#7126) 2020-12-04 13:25:23 +02:00
spaceface777 9345d489f8
ci: fix self compilation with cached modules on macos (#7127) 2020-12-04 13:25:02 +02:00
joe-conigliaro ca7692c839
error on unknown generic struct init. closes #7085 2020-12-02 20:53:40 +11:00
Delyan Angelov 394e9c4c56
builder: replace single `goto start` usage, with `for { ... continue ... break}` 2020-12-01 22:11:44 +02:00
Delyan Angelov 7511d6e4e8 builder: fix building thirdparty C files with tcc, when run outside vroot 2020-11-30 21:48:21 +02:00
Delyan Angelov ff42572e93 builder: show the C compiler output on -show-c-output, NOT on -showcc 2020-11-30 20:30:47 +02:00
Alexander Medvednikov 376833aea7 builder: show tcc compiler error with -v and -showcc 2020-11-30 17:47:38 +01:00
ka-weihe 9367dcda10
all: fix remaining c warnings and add -Werror to CI (#7021) 2020-11-29 21:23:37 +02:00
spaceface777 4e6bc27b30
compiler: fix self compilation with cached modules on macOS (#7023) 2020-11-29 19:30:35 +01:00
Delyan Angelov adeebad2a6
compiler: use thirdparty/tcc/tcc.exe by default, when no explicit -cc is given (#6598) 2020-11-29 16:18:49 +01:00
Delyan Angelov e6116c47be scanner: guarantee an early exit when the parser/scanner is stuck 2020-11-27 12:44:39 +02:00
Alexander Medvednikov 62ee436944 all: remove broken escape sequences after $ in strings 2020-11-27 03:07:37 +01:00
Delyan Angelov fa126b950a cgen: prevent `undefined symbol: tcc_backtrace` errors with tcc and `-shared -d no_backtrace` 2020-11-25 15:47:55 +02:00
Ekopalypse a46eda7c44
builder: fix dll generation on Windows (#6939) 2020-11-25 12:18:58 +01:00
Daniel Däschle aa6303f0b2
all: use the new types with old syntax (#6922) 2020-11-24 13:58:29 +01:00
Delyan Angelov 1b8609c318 builder: fix for `v -o x.exe run examples/hello_world.v` 2020-11-20 02:38:24 +02:00
Delyan Angelov 01579957b8 builder: move -c right before the .c thirdparty file 2020-11-13 20:42:26 +02:00
Delyan Angelov 8cb1714255 builder: fix building sqlite3 on windows 2020-11-13 20:35:21 +02:00
pancake af5836202c
js: fix wrong filename and invalid backend selected when using -o .js (#6777) 2020-11-08 17:45:32 +01:00
Delyan Angelov 6da8454b3b builder: a small -usecache fix, when v is run in subfolders 2020-11-08 09:18:05 +02:00
Delyan Angelov 4b35495fbe all: support VMODULES environment variable (defaulting to ~/.vmodules) 2020-11-08 08:07:17 +02:00
spaceface777 a9e9554b11
all: fix most C warnings (#6758) 2020-11-06 16:26:59 +02:00
Delyan Angelov d34c5b767b vfmt: keep the source fn type alias names, instead of the expanded fn declarations 2020-11-05 20:21:37 +02:00
Delyan Angelov 18f5ed671d builder: fix -showcc with msvc 2020-11-03 12:37:04 +02:00
Delyan Angelov 204fd8be03 builder: improve the function redefinition detector 2020-11-03 10:00:06 +02:00
Delyan Angelov 535c4ed0d6 builder: return early in run_compiled_executable_and_exit, when -check-syntax is passed 2020-10-26 11:23:28 +02:00
Delyan Angelov 5cb31c2c8f builder: fix support for tcc on windows (openlibm.o) 2020-10-25 03:35:34 +03:00
Delyan Angelov 5f6259dde6 v: add VCACHE support for thirdparty object files and for `v build-module` 2020-10-25 03:09:07 +03:00
Delyan Angelov 89daec4e93 ci: run vfmt over compile.v and checker.v 2020-10-24 20:41:52 +03:00
Delyan Angelov 8b01146b90 compiler: implement -W and -reuse-tmpc 2020-10-24 20:34:50 +03:00
Delyan Angelov 296a6095a4 builder: vfmt compile.v 2020-10-24 15:48:11 +03:00
Delyan Angelov 8f85396a31 builder: use unique .tmp.c and .tmp.c.rsp files, and rm them on successfull non debug builds. 2020-10-24 15:08:45 +03:00
Delyan Angelov 44753e62ab builder: enable `v run x_test.v` to allow universal make/compile commands in vim/emacs 2020-10-18 10:34:40 +03:00
Delyan Angelov 3c2202572b
cgen: produce cleaner error on missing C headers (with optional explanation) (#6637)
Implements support for `#include <openssl/rand.h> # Please install OpenSSL`.
2020-10-17 18:27:06 +03:00
Enzo b083f4014b
fmt: fix multiple things and format most of the compiler (#6631)
Format expressions inside string interpolation like the rest (it used to be a+b instead of a + b, not too sure why)
Fix formatting some match branches when there were only one statement inside (it was inlined)
Fix parsing and formatting some comments edge case on struct field init. You should check out this test because the result is a bit different from before. I personally find it more logical but I would understand if the former format was to stay
Fix formatting of void-returning function signature
2020-10-15 22:12:59 +02:00