aboutsummaryrefslogtreecommitdiff
path: root/src-self-hosted/stage1.zig
AgeCommit message (Collapse)Author
2020-02-16rename libuserland to libstage2Andrew Kelley
2020-02-16self-hosted libc detectionAndrew Kelley
* libc_installation.cpp is deleted. src-self-hosted/libc_installation.zig is now used for both stage1 and stage2 compilers. * (breaking) move `std.fs.File.access` to `std.fs.Dir.access`. The API now encourages use with an open directory handle. * Add `std.os.faccessat` and related functions. * Deprecate the "C" suffix naming convention for null-terminated parameters. "C" should be used when it is related to libc. However null-terminated parameters often have to do with the native system ABI rather than libc. "Z" suffix is the new convention. For example, `std.os.openC` is deprecated in favor of `std.os.openZ`. * Add `std.mem.dupeZ` for using an allocator to copy memory and add a null terminator. * Remove dead struct field `std.ChildProcess.llnode`. * Introduce `std.event.Batch`. This API allows expressing concurrency without forcing code to be async. It requires no Allocator and does not introduce any failure conditions. However it is not thread-safe. * There is now an ongoing experiment to transition away from `std.event.Group` in favor of `std.event.Batch`. * `std.os.execvpeC` calls `getenvZ` rather than `getenv`. This is slightly more efficient on most systems, and works around a limitation of `getenv` lack of integration with libc. * (breaking) `std.os.AccessError` gains `FileBusy`, `SymLinkLoop`, and `ReadOnlyFileSystem`. Previously these error codes were all reported as `PermissionDenied`. * Add `std.Target.isDragonFlyBSD`. * stage2: access to the windows_sdk functions is done with a manually maintained .zig binding file instead of `@cImport`. * Update src-self-hosted/libc_installation.zig with all the improvements that stage1 has seen to src/libc_installation.cpp until now. In addition, it now takes advantage of Batch so that evented I/O mode takes advantage of concurrency, but it still works in blocking I/O mode, which is how it is used in stage1.
2020-02-15translate-c: change OutOfMemory → ASTUnitFailureMichael Dusan
- return a better error when no diagnostics are available
2020-01-22fix not respecting sub-arch featureAndrew Kelley
2020-01-22std.Target.CpuFeatures is now a struct with both CPU and feature setAndrew Kelley
Previously it was a tagged union which was one of: * baseline * a specific CPU * a set of features Now, it's possible to have a CPU but also modify the CPU's feature set on top of that. This is closer to what LLVM does. This is more correct because Zig's notion of CPUs (and LLVM's) is not exact CPU models. For example "skylake" is not one very specific model; there are several different pieces of hardware that match "skylake" that have different feature sets enabled.
2020-01-21don't trust llvm's GetHostCPUNameAndrew Kelley
comment from this commit reproduced here: I have observed the CPU name reported by LLVM being incorrect. On the SourceHut build services, LLVM 9.0 reports the CPU as "athlon-xp", which is a 32-bit CPU, even though the system is 64-bit and the reported CPU features include, among other things, +64bit. So the strategy taken here is that we observe both reported CPU, and the reported CPU features. The features are trusted more; but if the features match exactly the features of the reported CPU, then we trust the reported CPU.
2020-01-21enable native CPU feature for windows; disable failing testsAndrew Kelley
See #508. These can be re-enabled when we upgrade to LLVM 10.
2020-01-21put hack back in to disable windows native cpu featuresAndrew Kelley
See #508. This can be removed when we upgrade to LLVM 10.
2020-01-21lazily compute the full cpu features dependenciesAndrew Kelley
2020-01-21hit a comptime limitation with computing dense setsAndrew Kelley
2020-01-21fix cache of cpu featuresAndrew Kelley
2020-01-21properly forward baseline target cpu features to llvmAndrew Kelley
2020-01-21make zig targets show native cpu name and featuresAndrew Kelley
2020-01-21fixups to arch data, support any number of cpu featuresAndrew Kelley
2020-01-20improve `zig targets`Andrew Kelley
2020-01-20fix std.Target.Arch.parseCpuFeatureSetAndrew Kelley
2020-01-20stage1 is building. `zig targets` now self-hostedAndrew Kelley
2020-01-19some fixesAndrew Kelley
2020-01-19figure out zig0/stage1 and scanning for native CPUAndrew Kelley
2020-01-19progress towards mergingAndrew Kelley
see BRANCH_TODO file
2020-01-19Allow target details with no LLVM supportLayne Gustafson
2020-01-19Fix sentinel mismatch in llvm stringsLayne Gustafson
Previously, buffers were used with toOwnedSlice() to create c strings for LLVM cpu/feature strings. However, toOwnedSlice() shrinks the string memory to the buffer's length, which cuts off the null terminator. Now toSliceConst() is used instead, and the buffer is not deinited so that the string memory is not freed.
2020-01-19Enable 64bit feature for riscv64Layne Gustafson
2020-01-19No allocations for n.t. empty stringsLayne Gustafson
2020-01-19Only enable requested featuresLayne Gustafson
2020-01-19Make sure llvm strings are null-terminatedLayne Gustafson
2020-01-19Add defaut feature supportLayne Gustafson
2020-01-19Add builtin.zig supportLayne Gustafson
2020-01-19Add TargetDetails abstractionLayne Gustafson
2020-01-19Add cpu/feature specification to cmndlineLayne Gustafson
2020-01-19Switch CPU/features to simple formatLayne Gustafson
2020-01-19Make targets cmd able to list CPUs and featuresLayne Gustafson
2019-12-29translate-c-2 bug fixesVexu
- fix use of undefined value - fix parenexprclass result not being suppressed - add an error and a TODO for access of an anonymous field
2019-12-16translate-c-2 parameter name aliasingVexu
2019-12-12remove concept of translate modeVexu
2019-12-11self-hosted: manually parse argsAndrew Kelley
2019-12-10Fix usage of freed memory in zig fmtRobin Voetter
2019-12-08update docs to new fmt APIAndrew Kelley
2019-12-08std.fmt.format: tuple parameter instead of var argsAndrew Kelley
2019-12-01Merge remote-tracking branch 'origin/master' into remove-array-type-coercionAndrew Kelley
2019-11-30move `std.fs.Dir.cwd` to `std.fs.cwd`Andrew Kelley
update to non-deprecated std.fs APIs throughout the codebase Related: #3811
2019-11-30Merge pull request #3284 from Sahnvour/export_variablesAndrew Kelley
Improved support for exporting variables
2019-11-27remove type coercion from array values to referencesAndrew Kelley
* Implements #3768. This is a sweeping breaking change that requires many (trivial) edits to Zig source code. Array values no longer coerced to slices; however one may use `&` to obtain a reference to an array value, which may then be coerced to a slice. * Adds `IrInstruction::dump`, for debugging purposes. It's useful to call to inspect the instruction when debugging Zig IR. * Fixes bugs with result location semantics. See the new behavior test cases, and compile error test cases. * Fixes bugs with `@typeInfo` not properly resolving const values. * Behavior tests are passing but std lib tests are not yet. There is more work to do before merging this branch.
2019-11-25Avoid deprecated cwd-based functions for opening directories, preferring to ↵Jonathan S
open explicitly relative to `Dir.cwd()`.
2019-11-24make std.mem.toSlice use null terminated pointersAndrew Kelley
and fix the fallout
2019-11-24Merge remote-tracking branch 'origin/master' into null-terminated-pointersAndrew Kelley
2019-11-24export: check variable typeSahnvour
also fixed existing occurrences
2019-11-23Merge branch 'master' into modernize-stage2Vexu
2019-11-21string literals are now null terminatedAndrew Kelley
this also deletes C string literals from the language, and then makes the std lib changes and compiler changes necessary to get the behavior tests and std lib tests passing again.
2019-11-13std.io.getStdOut and related fns no longer can errorAndrew Kelley
Thanks to the Windows Process Environment Block, it is possible to obtain handles to the standard input, output, and error streams without possibility of failure.