Commit Graph

4917 Commits (50bbb34594eedf7a978c00edb525bcea472b554b)

Author SHA1 Message Date
emekoi 6057513cc7 fixed visibility of zig_libc_cc_print_file_name 2019-04-27 16:17:07 -05:00
Ryan Liptak 205e501e42 std.fmt: add max_depth to avoid infinite recursion from self-references 2019-04-27 11:20:10 -04:00
daurnimator bc1840e18f Revert "std: Add mem.nativeIntToBig and mem.nativeIntToLittle"
This reverts commit 211f0a2226.

The functions `mem.nativeToBig` and `mem.nativeToLittle` already existed.
2019-04-27 11:18:53 -04:00
emekoi 66f3ef06e8 fixed syntax error 2019-04-27 11:16:33 -04:00
emekoi dfada0cc77 added static_crt_dir to libc file 2019-04-27 00:24:26 -05:00
Shritesh Bhattarai d02489fd9a fix missing semicolon 2019-04-26 21:01:20 -04:00
Andrew Kelley 2d6520d5d4
zig fmt is built directly into stage1 rather than child process
Previously, `zig fmt` on the stage1 compiler (which is what we currently
ship) would perform what equates to `zig run std/special/fmt_runner.zig`

Now, `zig fmt` is implemented with the hybrid zig/C++ strategy outlined
by #1964.

This means Zig no longer has to ship some of the stage2 .zig files, and
there is no longer a delay when running `zig fmt` for the first time.
2019-04-26 20:46:28 -04:00
Andrew Kelley ac3946620c
Merge pull request #2357 from squeek502/heap-shrink-large-align
DirectAllocator: reduce the amount of redundant memcpy calls on Windows
2019-04-26 19:34:24 -04:00
Shritesh Bhattarai efc5122fb6 docgen: properly close tags for skipped execs 2019-04-26 19:33:33 -04:00
Ryan Liptak 6936f0514f readme: Fix filepath to test file when testing std lib changes 2019-04-26 14:14:48 -07:00
Andrew Kelley 28071ac637
self-hosted translate-c emits a hello world AST
Also breaking std lib API change: the return value of
std.zig.parse returns `*ast.Tree` rather than `ast.Tree`.

See #1964
2019-04-26 15:43:36 -04:00
Andrew Kelley c82acdbb9e
clean up test output
After 4df2f3d74f test names have the word "test" in them so the
redundant word is removed from test runner. Also move the prefix/suffix
to where it logically belongs in the fully qualified symbol name.
2019-04-26 15:10:13 -04:00
Andrew Kelley 1d95fdaf6e
Fix path canonicalization when $HOME has a trailing slash 2019-04-26 14:37:26 -04:00
LemonBoy 9ec4ccc68f Do not invoke UB in BigInt shr operations
Shifting a value of type T by an amount that's greater or equal to the
size of the type itself is UB.

Spotted by @tgschultz
2019-04-26 14:24:35 -04:00
rylmovuk 4df2f3d74f Change symbol name of tests in codegen
Tests now have the symbol name of the format `test "<name>"` in order
to be more easily distinguished from functions with similar names.
See issue #2267.
2019-04-26 14:23:56 -04:00
Ryan Liptak afc33f00ee heap: fixup style of realloc memory copies 2019-04-25 13:41:19 -07:00
Ryan Liptak 57f545eed8 std.heap.DirectAllocator: reduce the amount of redundant memcpy calls on Windows
Previously the memory would be copied to a different aligned address in some cases where the old offset could have been used. This fixes it so that it will always try to use the old offset when possible, and only uses a different offset if the old one is truly invalid (not aligned or not enough space to store the alloc at the old offset).
2019-04-25 13:35:45 -07:00
Andrew Kelley 92d9cef071
Merge pull request #2332 from ziglang/translate-c-userland
beginnings of implementing translate-c in userland
2019-04-25 08:35:28 -04:00
Andrew Kelley 17ffe166c2
add preliminary windows support to std.io.COutStream 2019-04-25 00:24:25 -04:00
Andrew Kelley e1bf74fca3
translate-c: put -x c back in there, it's necessary 2019-04-25 00:06:58 -04:00
Andrew Kelley 535d419590
translate-c: self-hosted implementation can detect C errors
See #1964
2019-04-25 00:06:58 -04:00
Andrew Kelley 712274997e
translate-c: unify API for self-hosted and C++ translate-c
See #1964
2019-04-25 00:06:57 -04:00
Andrew Kelley 976080462c
translate-c: a little closer to self-hosted implementation 2019-04-25 00:06:54 -04:00
Andrew Kelley 56e07622c6
Merge pull request #2312 from squeek502/heap-shrink-large-align
fix heap allocators when shrinking an object but growing its alignment
2019-04-24 23:44:28 -04:00
Shawn Landden 8ef7f6febb remove Shebang (#!) support
Closes:  #2165
2019-04-24 23:34:19 -04:00
Andrew Kelley fb2acaff06
`@sizeOf` returns 0 for comptime types
This defines `@sizeOf` to be the runtime size of a type, which means
that it is zero for types such as comptime_int, type, and (enum
literal).

See #2209
2019-04-24 22:31:53 -04:00
vegecode 733c547a65 compiler-rt: Add missing import of test for comparesf2 2019-04-24 21:16:03 -04:00
vegecode 01168e1577 compiler-rt: add aeabi_dcmp, comparedf2 2019-04-24 21:15:39 -04:00
LemonBoy e4825dbd77 Other 2019-04-24 20:54:17 +02:00
LemonBoy 12eff09ff4 Expose Elf32_Dyn and Elf64_Dyn 2019-04-24 20:54:05 +02:00
LemonBoy 074ddf1ac6 Implementation of dl_phdr_info 2019-04-24 20:53:46 +02:00
Andrew Kelley ad994c9642
Merge pull request #2296 from LemonBoy/translate-c-stuff
Handle implicit casts in translate-c
2019-04-24 14:43:46 -04:00
Wink Saville 7bafe2e490 Fix alignment of macro FIND_AND_ADD_CLANG_LIB 2019-04-24 14:42:08 -04:00
hryx 06bf918436 Sync grammar with spec
- Remove rule LabeledExpr
- Add rule CurlySuffixExpr
2019-04-24 14:38:56 -04:00
Michael Dusan 5de934810f add -fvisibility-inlines-hidden
On macOS building with Xcode/clang the linker complains loudly when
symbol visibility is inconsistent. This option syncs visibilty setting
of both LLVM and Zig.
2019-04-24 14:37:14 -04:00
Andrew Kelley ed41955522
build libuserland in cross compilation mode
Previously libuserland was being built for the native target,
which could depend on native CPU features such as AVX. The
CI infrastructure is intending to create binaries that are
widely compatible and do not make use of specific CPU features.

There could be something to gain from enabling native CPU features
sometimes, by introducing a new cmake configuration option, but
since it's planned to eventually ship self-hosted rather than stage1,
I don't think it really matters.

closes #2348
2019-04-24 14:13:55 -04:00
Jimmi Holst Christensen e4a86d4653
Merge pull request #2351 from ziglang/fixed-2346
fixes #2346
2019-04-24 18:42:55 +02:00
Jimmi HC 1a2e02e267 fixed #2356
const_ptr_pointee_unchecked did not take into account that if the
pointer is zero sized, then const_val->data.x_ptr.special would be
ConstPtrSpecialInvalid. This commit fixes this by also checking
that the child type of the pointer only have one possible value
and just returns that value.
2019-04-24 15:04:58 +02:00
Jimmi Holst Christensen e553ade090
Merge pull request #2335 from hryx/no-tag-expr-for-struct
Allow tag expr for enum but not struct
2019-04-24 14:53:54 +02:00
Andrew Kelley 3bc361178c
Merge pull request #2344 from LemonBoy/dbg-things
Minor debug things
2019-04-23 10:15:53 -04:00
LemonBoy 374d16793f Go one instruction before the return address
The return address may not point to an area covered by the debug infos
so we hope for the best and decrement the address so that it points to
the caller instruction.
2019-04-23 10:05:46 +02:00
LemonBoy b095e33667 Fix silly typo 2019-04-23 09:57:57 +02:00
LemonBoy 57ec183c09 Fix reading of signed leb128 values 2019-04-23 09:57:22 +02:00
LemonBoy 70c2e86da3 Add translation from pointer to boolean 2019-04-22 22:23:41 +02:00
LemonBoy a44ad08954 Add some zig_panic for 80-bit float codepaths 2019-04-22 22:23:41 +02:00
LemonBoy 9ea600b634 Correct rendering of AST Char literals 2019-04-22 22:23:41 +02:00
LemonBoy 8d05330cf7 More precise translation of char literals 2019-04-22 22:23:41 +02:00
LemonBoy ab424bbb35 translate-c: Add test for implicit casts 2019-04-22 22:23:41 +02:00
LemonBoy 69bc5fd04d translate-c: Pointer to/from integral conversion 2019-04-22 22:16:30 +02:00
LemonBoy d3dd49c403 translate-c: Support for integer to boolean conversions 2019-04-22 22:16:29 +02:00