Commit Graph

125 Commits

Author SHA1 Message Date
Jay Petacat a9b505fa77 Reduce use of deprecated IO types
Related: #4917
2021-01-07 23:48:58 -08:00
LemonBoy 1fbe89dc2e langref: Update langref to use {s} 2021-01-02 17:12:57 -07:00
g-w1 51a904677c update depreciated code (#7502)
* `zig env`:

* fix depreciated interface, update outStream -> writer
* make code more readable by updating `anytype` -> `std.fs.File.Writer`
2020-12-23 13:01:29 +02:00
Travis f54605ecc2 add missing Invalid_periodasterisks case in docgen 2020-10-29 14:02:08 -05:00
LemonBoy 475fc2934b Update langref errors 2020-10-20 10:05:44 +02:00
Tadeo Kondrak 6b8ae6fffb langref: update for opaque {} syntax 2020-10-06 22:08:29 -06:00
Andrew Kelley b6556c944b fix another round of regressions in this branch
* std.log: still print error messages in ReleaseSmall builds.
   - when start code gets an error code from main, it uses std.log.err
     to report the error. this resulted in a test failure because
     ReleaseSmall wasn't printing `error: TheErrorCode` when an error
     was returned from main. But that seems like it should keep working.
     So I changed the std.log defaults. I plan to follow this up with a
     proposal to change the names of and reduce the quantity of the
     log levels.
 * warning emitted when using -femit-h when using stage1 backend; fatal
   log message when using -femit-h with self-hosted backend (because the
   feature is not yet available)
 * fix double `test-cli` build steps in zig's build.zig
 * update docgen to use new CLI
 * translate-c uses `-x c` and generates a temporary basename with a
   `.h` extension. Otherwise clang reports an error.
 * --show-builtin implies -fno-emit-bin
 * restore the compile error for using an extern "c" function without
   putting -lc on the build line. we have to know about the libc
   dependency up front.
 * Fix ReleaseFast and ReleaseSmall getting swapped when passing the
   value to the stage1 backend.
 * correct the zig0 CLI usage text.
 * update test harness code to the new CLI.
2020-09-26 21:03:38 -07:00
Vexu be1507a7af update compile error tests and some doc comments 2020-07-12 00:54:07 +03:00
Andrew Kelley 3a89f214aa update more HashMap API usage 2020-07-05 21:11:42 +00:00
Andrew Kelley 2952604d5d update docgen to new ast API 2020-05-23 20:40:09 -04:00
Tadeo Kondrak 7ada59f873 remove nakedcc/stdcallcc/async fn/extern fn fnproto 2020-05-05 09:37:28 -06:00
Tadeo Kondrak 8d5636ebe4 Rename noasync to nosuspend in self-hosted, add rewriter 2020-05-05 05:17:33 -06:00
joachimschmidt557 f1360bee1c Update docgen to new ArrayList API 2020-04-09 14:57:14 -04:00
daurnimator e535057364 std: use std.ArrayList(u8).OutStream instead of std.Buffer.OutStream 2020-04-01 10:36:38 -04:00
Andrew Kelley 9e7ae06249 std lib API deprecations for the upcoming 0.6.0 release
See #3811
2020-03-30 14:23:22 -04:00
Andrew Kelley 46ffc798b6 fix swapped logic for Windows
Remove `std.fs.deleteTree`. Callers instead should use
`std.fs.cwd().deleteTree`.

Add `std.fs.deleteTreeAbsolute` for when the caller has an absolute
path.
2020-03-18 16:42:47 -04:00
Andrew Kelley faa3c40b54 fix docgen, which relied on stdout being path to binary 2020-03-14 00:46:40 -04:00
Andrew Kelley 2bff0dda79 fix regressions found by test suite 2020-03-10 20:22:30 -04:00
Andrew Kelley c4f81586f1 update docgen to new std.fs API 2020-03-03 16:01:09 -05:00
Andrew Kelley 662b5f7c60 update docs to latest Target API 2020-02-28 14:51:55 -05:00
Andrew Kelley 70bf8874d7 update docgen to new Target API 2020-02-28 14:51:55 -05:00
Andrew Kelley dbe4d72bcf separate std.Target and std.zig.CrossTarget
Zig now supports a more fine-grained sense of what is native and what is
not. Some examples:

This is now allowed:
-target native

Different OS but native CPU, default Windows C ABI:
-target native-windows
This could be useful for example when running in Wine.

Different CPU but native OS, native C ABI.
-target x86_64-native -mcpu=skylake

Different C ABI but otherwise native target:
-target native-native-musl
-target native-native-gnu

Lots of breaking changes to related std lib APIs.
Calls to getOs() will need to be changed to getOsTag().
Calls to getArch() will need to be changed to getCpuArch().

Usage of Target.Cross and Target.Native need to be updated to use
CrossTarget API.

`std.build.Builder.standardTargetOptions` is changed to accept its
parameters as a struct with default values. It now has the ability to
specify a whitelist of targets allowed, as well as the default target.
Rather than two different ways of collecting the target, it's now always
a string that is validated, and prints helpful diagnostics for invalid
targets. This feature should now be actually useful, and contributions
welcome to further improve the user experience.

`std.build.LibExeObjStep.setTheTarget` is removed.
`std.build.LibExeObjStep.setTarget` is updated to take a CrossTarget
parameter.

`std.build.LibExeObjStep.setTargetGLibC` is removed. glibc versions are
handled in the CrossTarget API and can be specified with the `-target`
triple.

`std.builtin.Version` gains a `format` method.
2020-02-28 14:51:54 -05:00
Andrew Kelley eddca50059 fix regression in docgen
I used the wrong function here
2020-02-08 00:03:06 -05:00
Andrew Kelley 4a60689309 more carefully calculate llvm field indexes
more correctly solves #4403
2020-02-07 14:54:58 -05:00
Benjamin Feng b077f3ab7d Promoted "leak_count_allocator" to the main testing.allocator 2020-01-29 22:22:00 -06:00
Benjamin Feng c4e6e5fad6 Add explicit free to docs 2020-01-29 14:47:17 -06:00
Benjamin Feng aa9caf5064 Create leak_count_allocator 2020-01-29 14:37:01 -06:00
Benjamin Feng 4d134a01f5 Move debug.global_allocator to testing.allocator 2020-01-29 12:21:29 -06:00
LemonBoy 563d9ebfe5 Implement the callconv() annotation 2020-01-02 18:53:16 +01:00
xackus cb5a5ebb20 langref table of contents in a separate column on large displays 2019-12-16 12:25:56 -05:00
Andrew Kelley 8b3c0bbeee update docgen to new format API 2019-12-09 00:18:01 -05:00
xackus cb96a096cb docs: fix duplicate closing tag generation 2019-12-05 22:56:56 +01:00
Andrew Kelley 37caa56fbc fix docs regressions 2019-12-01 21:27:55 -05:00
Andrew Kelley cb38bd0a14 rename std.heap.direct_allocator to std.heap.page_allocator
std.heap.direct_allocator is still available for now but it is marked
deprecated.
2019-11-25 17:25:06 -05:00
Andrew Kelley 4c7b52503b all tests passing 2019-11-24 02:14:21 -05:00
Vexu 314cb707fc fix containerdoccomment not handled in docgen.zig 2019-11-15 18:44:29 +02:00
Andrew Kelley 3cf5c2c62b fix regressed tests and update docs to use "type coercion" 2019-11-08 15:57:25 -05:00
Brendan Hansknecht c1e8fdf812 add token for parsing pointer dereference 2019-11-06 14:03:21 -05:00
stratact e78d3750c5 Use 8192 sized buffers and remove allocator parameters 2019-10-19 14:04:51 -04:00
Andrew Kelley 0e9f86b1db docs: docgen supports release safe exe code examples
and make the type names of `@hasDecl` and `@hasField` consistent
2019-09-29 17:28:30 -04:00
Andrew Kelley ec545859b9 docgen: support code examples for riscv target 2019-09-29 14:03:49 -04:00
Andrew Kelley b89a09af4b docgen: add "process terminated by signal" to exe_err 2019-09-26 13:11:07 -04:00
Andrew Kelley 568c183d2a docgen: slightly better caching 2019-09-25 17:59:52 -04:00
Andrew Kelley 56b1818beb docgen: test blocks support linking libc 2019-09-24 11:41:19 -04:00
Andrew Kelley c0b937ba12 docgen: slightly cleaner display of libc cli args 2019-09-24 11:36:59 -04:00
Andrew Kelley 0a3c6dbda9 implement noasync function calls
See #3157
2019-09-05 21:55:32 -04:00
LemonBoy fabf45f5fc Add the noinline keyword for function declarations 2019-09-05 13:04:58 -04:00
Andrew Kelley ac7703f65f fixups and add documentation for @Type 2019-09-04 11:12:14 -04:00
Sahnvour f08c6e4fe6 changing occurrences of HashMap with []const u8 as keys for StringHashMap 2019-09-03 23:53:05 +02:00
Andrew Kelley 13b5a4bf8c remove cancel 2019-08-15 14:05:12 -04:00