Commit Graph

21 Commits

Author SHA1 Message Date
Andrew Kelley
0d5ff6f462 error sets - most tests passing 2018-02-08 02:08:45 -05:00
Andrew Kelley
6fece14cfb self-hosted: build against zig_llvm and embedded LLD
Now the self-hosted compiler re-uses the same C++ code for interfacing
with LLVM as the C++ code.
It also links against the same LLD library files.
2017-12-26 19:44:08 -05:00
Dimenus
38f05d4ac5 WIN32: Linking with the CRT at runtime. (#570)
Disclaimer: Forgive me if my format sucks, I've never submitted a PR before!

Fixes: #517 

I added a few things to allow zig to link with the CRT properly both statically and dynamically. In Visual Studio 2017, Microsoft changed how the c-runtime is factored again. With this change, they also added a COM interface to allow you to query the respective Visual Studio instance for two of them. This does that and also falls back on a registry query for 2015 support. If you're using a Visual Studio instance older than 2015, you'll have to use the existing options available with the zig compiler. Changes are listed below along with a general description of the changes.

all_types.cpp:

The separate variables for msvc/kern32 have been removed and all win32 libc directory paths have been combined into a ZigList since we're querying more than two directories and differentiating one from another doesn't matter to lld.

analyze.cpp:

The existing functions were extended to support querying libc libs & libc headers at runtime.

codegen.cpp/hpp:

Microsoft uses the new 'Universal C Runtime' name now. Doesn't matter from a functionality standpoint. I left the compiler switches as is to not introduce any breaking changes.

link.cpp:

We're linking 4 libs and generating another in order to support the UCRT.
Dynamic: msvcrt/d, vcruntime/d, ucrt/d, legacy_stdio_definitions.lib
Static: libcmt/d, libvcruntime/d libucrt/d, legacy_stdio_definitions.lib

main.cpp:

Update function call names.

os.cpp/hpp:

COM/Registry interface for querying Windows UCRT/SDK.

Sources:
[Windows CRT](https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features)
[VS 2015 Breaking Changes](https://msdn.microsoft.com/en-us/library/bb531344.aspx)
2017-11-01 15:33:14 -04:00
Andrew Kelley
9cdb5dec7a parsec: cleaner shifting code for fixed size types 2017-09-20 22:44:24 -04:00
Jonathan Marler
bb44e4b479 Fixed a couple compilation errors for MSVC 64-bit (#475) 2017-09-13 23:59:09 -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
Jonathan Marler
7c81cd30de Add support for MSVC 2017-09-11 09:26:26 -06:00
Andrew Kelley
cf5108f222 correct size of types for packed structs
with byte aligned but non-power-of-2 fields such as 24
2017-02-21 14:22:23 -05:00
Andrew Kelley
3239b3cb69 use size_t for indexes
protect against incorrect copies in debug mode
2016-09-19 11:54:01 -04:00
Andrew Kelley
66163692ad parseh: support anonymous enums and enums with initializers 2016-04-22 21:43:48 -07:00
Andrew Kelley
e411467e1d add number literal type
it gets implicitly casted to whatever is needed.

closes #24
2015-12-14 02:46:37 -07:00
Josh Wolfe
f6eecfe5f4 getting started on array types 2015-12-07 08:29:19 -07:00
Andrew Kelley
dfb6682089 add test for bad import 2015-12-01 02:29:21 -07:00
Andrew Kelley
4cc95174a7 add tests for compile errors 2015-11-27 18:55:06 -07:00
Andrew Kelley
ca836191e1 debug information for functions 2015-11-24 19:07:33 -07:00
Andrew Kelley
1b24f4c73c parsing hello.zig example with recursive descent
that was easy
2015-11-23 21:30:12 -07:00
Andrew Kelley
4236b85c72 parser generator supports a simple OR 2015-11-07 04:50:48 -07:00
Andrew Kelley
7cfceeca2d parser generator beginnings 2015-11-03 22:39:35 -07:00
Andrew Kelley
d519ce87dd preprocessor runs once 2015-08-05 21:47:08 -07:00
Andrew Kelley
e09932928a tokenize 2015-08-05 17:44:05 -07:00
Andrew Kelley
899c9fe94e read a file 2015-08-05 16:22:21 -07:00