Commit Graph

450 Commits (870ed86afc4023d46ca2433285de20b4c2e5d088)

Author SHA1 Message Date
playX 4333a53f28
js: support running `.js.v` tests in `v test-self`, fixes for array methods & codegen (#12011) 2021-09-29 15:33:14 +03:00
Delyan Angelov 87fe15e39f
ci: fix typo 2021-09-28 15:30:05 +03:00
Delyan Angelov 3467ab1551
ci: fix the `g++` build and the `alpine-musl` task 2021-09-28 15:29:00 +03:00
crthpl 85b58b03a3
cgen: parallelize (#10844) 2021-09-28 10:28:04 +03:00
yuyi 108a01d65f
fmt: fix unnecessary line break in array init (fix #11448) (#11562) 2021-09-21 16:20:09 +03:00
Delyan Angelov 5cf0ee46b3
v.pref,v.builder: support overriding the C cross compiler by setting `VCROSS_COMPILER_NAME` 2021-09-20 19:57:43 +03:00
Delyan Angelov 6b2cc9c5cf
v.pref: add a simple options_test.v to check for -cflags regressions 2021-09-18 16:08:15 +03:00
Delyan Angelov 2eeba4758a
v.builder: fix `-cc msvc -cflags /O2` and support CFLAGS and LDFLAGS env vars 2021-09-18 09:14:21 +03:00
yuyi fb75d528eb
builder: remove panics, when cleaning up tmp files after tests (#11525) 2021-09-17 20:56:33 +03:00
playX c175b4fd48
v.gen.js: refactor code, fix alias codegen, `-stats` now again works with tests on the JS backend (#11512) 2021-09-16 14:00:15 +03:00
Ekopalypse 41fc4c55c6
v.builder: simplify target architecture logic for msvc (#11491) 2021-09-14 17:47:26 +03:00
Ekopalypse f9eb14d914
builder: remove fPic argument from windows builds (#11467) 2021-09-11 04:48:02 +03:00
Delyan Angelov bdd053fcf1
v.builder: fix `./v examples/v_script.vsh` on windows (this quickfix is thanks to yuyi98) 2021-09-10 12:30:40 +03:00
playX 72089c4feb
js: use prefixed names for functions and global symbols (#11387) 2021-09-08 20:30:46 +03:00
Delyan Angelov aec016bb14
v.builder: change exit code of `v -check file.v` to 0, when file.v is clean from any errors. 2021-09-07 07:29:45 +03:00
Ned Palacios aedb6b8e84
v.builder: implement a `-check` mode, that runs only the parser + the checker, without codegen (#11414) 2021-09-07 07:17:53 +03:00
Delyan Angelov 9496fcdfe1 v.builder: fix compilation with tcc on FreeBSD 13.0 2021-08-30 13:21:49 +00:00
Alexander Medvednikov 853d3cb83e os: make chmod() return error 2021-08-28 09:37:24 +03:00
Alexander Medvednikov 858ba25d55 os: make chdir() return error 2021-08-28 09:35:39 +03:00
Alexander Medvednikov 4824b409b1 builder: simplify the C error message 2021-08-24 06:24:35 +03:00
Delyan Angelov 9ca99c6f93
v.builder: add `-Wl,--allow-multiple-definition` when targeting FreeBSD 2021-08-18 12:57:44 +03:00
Leo Developer b3094b0667
checker: abort prematurely on too many errors (#11185) 2021-08-15 13:41:51 +03:00
Delyan Angelov 6843b85063
ci: fix `clang -std=c99 -D_DEFAULT_SOURCE -o v vc/v.c` warnings 2021-08-15 11:12:48 +03:00
Delyan Angelov eef7eea7bc
v.pref, v.builder: support `-no-std` (skips passing `-std=c99` to the C backend) 2021-08-15 11:05:06 +03:00
Delyan Angelov f7cbcc241a
v.pref, v.builder: support `-no-rsp` (pass C options directly to the C compiler backend, without writing response files) 2021-08-15 10:47:44 +03:00
Delyan Angelov d540b3f1a8
v.util: improve formatted_error by adding cached_file2sourcelines, so .split_into_lines is called just once (important for long source files with many errors) 2021-08-14 23:01:30 +03:00
Leo Developer f6d7170e77
checker: changes related to warn/error limit (#11184) 2021-08-14 22:14:13 +03:00
Delyan Angelov 1743ad05c0
v.util: add a small cache for util.read_file, so reading individual source files is done just once 2021-08-14 21:59:28 +03:00
Caden Haustein cf0767ad6c
v: add constant folding AST transformation (#11085) 2021-08-06 23:19:18 +03:00
Delyan Angelov 33e4dc3ad3
ci: fix coutput_test.v on windows by fixing `-o -` on windows 2021-08-01 00:27:06 +03:00
Delyan Angelov d25bd95a0e
v: support -show-depgraph in addition to -show-callgraph 2021-07-28 16:42:11 +03:00
Delyan Angelov b0a721b2ec
js: draft support for compiling `-b js x_test.v` 2021-07-27 13:49:47 +03:00
Delyan Angelov 45a15755b8
v.builder: implement -show-callgraph 2021-07-24 13:32:56 +03:00
Delyan Angelov 72c56ccc85
v.builder: use os.write_file/os.write_file_array for writing full files to disk. 2021-07-24 13:32:55 +03:00
Delyan Angelov 5098334e65
os: add execute_or_exit(cmd), use it consistently instead of execute_or_panic(cmd) 2021-07-20 15:22:04 +03:00
Daniel Däschle ad3835b598
parser: deprecate short struct init (#10842) 2021-07-20 11:17:08 +03:00
playX 425ca5e3c3
v.gen.js: add three backend options for JS, and comptime if support (#10859) 2021-07-19 15:55:03 +03:00
Delyan Angelov 016240d00b
v: support `-o - x_test.v` too, describe `-o -` in the `v help` screen 2021-07-18 16:41:32 +03:00
Delyan Angelov a007dd5d22
builder: support `-o -` to print the generated C/JS source to stdout 2021-07-18 16:26:50 +03:00
yuyi a5c784830b
all: simplify global_scope processing (#10848) 2021-07-18 15:29:34 +03:00
shadowninja55 0d587d3580
checker: prohibit using non-lvalue as mut receiver (#10790) 2021-07-16 13:03:40 +03:00
Delyan Angelov cbe4ac703e
v.builder: remove temporary file.js file after `v -b js run file.v` 2021-07-16 10:03:46 +03:00
spaceface 6e942bf4c2
v: initial support for generic interfaces and sumtypes (#10795) 2021-07-15 08:29:13 +03:00
Delyan Angelov 24f5d0afc4
ci: fix `-o x.c` regression introduced in ff62b27 2021-07-13 22:13:28 +03:00
Delyan Angelov ff62b27ef0
v.builder: remove unused vjs_cc vestige (the -b js backend does its job now) 2021-07-13 20:32:30 +03:00
Delyan Angelov 54f6dc70c3
v.util: add Timers.show_remaining/0, use it in v.builder.compile/2 2021-07-06 13:06:11 +03:00
Delyan Angelov 972542d6ee
checker: `[noreturn]` part 2 (cleanup) (#10667) 2021-07-05 05:05:37 +03:00
yuyi 665279938e
checker: fix nested generic struct init (fix #10652) (#10659) 2021-07-04 18:37:31 +03:00
Delyan Angelov d5ee60b4a1 v.builder: use a github repo for ~/.vmodules/linuxroot/ folder, to ease its updating 2021-06-29 13:05:43 +03:00
Uwe Krüger 60c880a0cc
vlib: use `malloc_noscan()` where possible (#10465) 2021-06-15 14:47:11 +03:00
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