Andrew Kelley
4f4da3c10c
wip self hosted code
2017-10-24 10:08:20 -04:00
Andrew Kelley
175893913d
fix compiler crash regarding type name of undefined
...
See #547
2017-10-21 13:14:10 -04:00
Andrew Kelley
0744c83f51
add uwtable attribute to functions on windows
...
See #516
now we have at least a callstack. we still need updated LLD
to get stack traces.
2017-10-17 01:41:26 -04:00
Andrew Kelley
5866032e76
fix codegen of enum name table having wrong LLVM types
...
See https://bugs.llvm.org/show_bug.cgi?id=34952
2017-10-16 18:10:28 -04:00
Andrew Kelley
cbb6d2239f
look for libc at runtime on windows
...
See #539
before we close the issue we should also detect MSVC 2017
but this gets us started with supporting MSVC 2015
2017-10-16 12:21:46 -04:00
Andrew Kelley
d08c57741a
ability to make a DLL
...
See #302
2017-10-16 01:14:28 -04:00
Andrew Kelley
562f91e875
clean up some resources
2017-10-15 21:06:04 -04:00
Andrew Kelley
e3ad13e054
fix windows argument parsing
2017-10-15 20:19:15 -04:00
Andrew Kelley
9c44dd7db3
disable byval parameters on windows to work around llvm bug
...
See #536
2017-10-15 01:22:17 -04:00
Andrew Kelley
fd7654e4e8
build-exe allows direct export of WinMainCRTStartup
2017-10-14 20:12:15 -04:00
Andrew Kelley
aa78827db2
add module flag to emit CodeView for COFF object files
...
see #516
2017-10-10 18:04:02 -04:00
Andrew Kelley
6a0c428997
use __chkstk_ms compiler-rt functions for __chkstk
...
I had to revert the target native features thing because there
is still some incorrect behavior with f128.
Reopens #508
partially reverts b505462509
See #302
2017-10-03 00:57:02 -04:00
Andrew Kelley
b505462509
replace __chkstk function with a stub that does not crash
...
Closes #508
See #302
2017-10-03 00:29:41 -04:00
Andrew Kelley
f1bd02e6f4
add @setAlignStack builtin
2017-10-03 00:29:27 -04:00
Andrew Kelley
ec40542c44
windows: alignstack=16 on every function
...
See #302
2017-10-02 09:55:49 -04:00
Andrew Kelley
1962c8588f
implement standard library path search
...
closes #463
See #302
2017-10-01 18:30:31 -04:00
Andrew Kelley
0975e37b16
fix implementation of --zig-std-dir
...
see #463
2017-10-01 15:51:55 -04:00
Andrew Kelley
5e6fc94b7f
fix codegen on windows
2017-10-01 03:05:01 -04:00
Andrew Kelley
c6295fe9ab
remove zigrt
...
adds test case for #394
partially reverts a32b5929cc
2017-09-30 20:21:57 -04:00
Andrew Kelley
6db589fff5
don't try to use cold calling convention on windows
...
it just causes a segfault
2017-09-30 20:20:51 -04:00
Andrew Kelley
ba3d21ca67
better divTrunc codegen
...
branch and phi instead of select instruction
fixes division test for windows. See #302
2017-09-30 16:59:31 -04:00
Andrew Kelley
588d2862d9
workaround for invalid binary created on windows
...
when target native features are used.
See #508
2017-09-30 15:47:46 -04:00
Andrew Kelley
6c3a56a7ff
fix i386 windows stdcall
2017-09-24 05:04:44 -04:00
Andrew Kelley
ba41be67f0
windows gui hello world
2017-09-24 03:55:45 -04:00
Andrew Kelley
3c41c2d84b
Merge branch 'master' into c-to-zig
2017-09-20 12:52:54 -04:00
Andrew Kelley
b8ee3a8143
add -mllvm support
...
useful for debugging crashes in llvm optimizer
2017-09-17 17:46:16 -04:00
Andrew Kelley
57ea6e8c9f
fix up msvc stuff to make it work on linux and macos too
2017-09-13 02:40:02 -04:00
Andrew Kelley
bf52a74803
fix error messages
2017-09-12 00:07:37 -04:00
Jonathan Marler
7c81cd30de
Add support for MSVC
2017-09-11 09:26:26 -06:00
Andrew Kelley
2c9bdad346
rename parseh to parsec
2017-09-05 22:55:03 -04:00
Andrew Kelley
3ff465e288
add OpaqueType builtin
...
closes #326
2017-09-05 18:51:07 -04:00
Raul Leal
e93ece7514
Opaque ptr patch
2017-08-31 18:01:09 -04:00
Andrew Kelley
021155db5b
successfully cross-building behavior tests for windows
2017-08-30 17:01:14 -04:00
Andrew Kelley
3f5dd08ca8
codegen: all stores specify align value
...
See #37
2017-08-30 04:23:52 -04:00
Andrew Kelley
849f65332d
set alignment on all loads and globals
...
See #37
2017-08-30 03:43:51 -04:00
Andrew Kelley
898d65baa9
more alignment improvements
...
* add alignment capability for fn protos
* add @alignCast
* fix some ast rendering code
* fix some ir rendering code
* add error for pointer cast increasing alignment
* update allocators in std to correctly align
See #37
2017-08-29 23:33:25 -04:00
Andrew Kelley
8f682efbc5
pass all tests without triggering assertions
...
fixes tests when targeting darwin
2017-08-29 09:30:22 -04:00
Andrew Kelley
c5c9d98065
introduce align keyword
...
* remove `@setGlobalAlign`
* add align keyword for setting alignment on functions and
variables.
* loads and stores use alignment from pointer
* memcpy, memset use alignment from pointer
* add syntax for pointer alignment
* slices can have volatile
* add u2, i2 primitives
* ignore preferred align and use abi align everywhere
* back to only having alignOf builtin.
preferredAlignOf is too tricky to be useful.
See #432 . Partial revert of
e726925e80 .
See #37
2017-08-29 07:51:34 -04:00
Andrew Kelley
d7a539906d
Merge branch 'embed-lld'
...
Zig now depends on LLVM 5.0.0.
For the latest version that supports LLVM 4.0.1, use
2a49c876be .
Unfortunately we had to embed LLD into Zig due to some
MACH-O related LLD bugs. One of them is already upstream
and another is awaiting feedback on the llvm-dev mailing
list.
You can use cmake option -DZIG_FORCE_EXTERNAL_LLD=ON to
still use external LLD if you want to live with the MACH-O
bugs or if your system LLD is patched.
Closes #273
2017-08-28 04:09:09 -04:00
Andrew Kelley
6c7e975b75
remove remnants of depending on darwin system linker
2017-08-28 03:31:57 -04:00
Andrew Kelley
91536813ec
macos updates
...
* try some macos travis stuff
* put c in the link libs for macos since we always link with libSystem
* for non-native targets on macos, allow runtime symbol resolution
- it's causing an infinite loop in LLD.
* for macos, always build compiler_rt and turn on LinkOnce because
compiler_rt on darwin is missing some stuff.
2017-08-27 02:51:25 -04:00
Andrew Kelley
2a49c876be
audit alignment for functions
...
see #37
2017-08-26 15:20:39 -04:00
Andrew Kelley
a0ae575ff8
codegen for enums chooses best order of tag and union fields
...
closes #396
2017-08-26 14:25:52 -04:00
scurest
5bc877017e
use most_aligned_member+padding to represent enum unions
2017-08-26 13:48:16 -04:00
Andrew Kelley
e726925e80
remove @alignOf and add @cAbiAlignOf and @preferredAlignOf
...
See #396
2017-08-26 13:29:24 -04:00
Andrew Kelley
105a09e1d6
fix invalid llvm IR for const enum
...
closes #394
2017-08-26 00:34:40 -04:00
Andrew Kelley
6aa04c422b
float division by zero check only when FloatMode.Optimzed
...
closes #395
2017-08-25 20:44:32 -04:00
Andrew Kelley
754f7809e3
refactor - codegen llvm functions lazily
2017-08-25 13:13:07 -04:00
Andrew Kelley
629aa10c56
unreachable still codegens to unreachable in ReleaseFast test mode
...
closes #430
2017-08-25 10:20:06 -04:00
Andrew Kelley
5dddb45ec7
fix compiler test errors
...
closes #428
Thanks Marc Tiehuis for diagnosing this bug
2017-08-22 11:54:58 -04:00