Commit Graph

3539 Commits (5e345ff0ee9eb70d7f5f7167227f6a1e8903f428)

Author SHA1 Message Date
Andrew Kelley 5e345ff0ee
Merge pull request #3955 from LemonBoy/fix-1528
Pointer arithmetic affects the alignment factor
2020-01-09 13:53:56 -05:00
LemonBoy 5ab5de89c0 New @export() handling
Use a struct as second parameter to be future proof (and also allows to
specify default values for the parameters)

Closes #2679 as it was just a matter of a few lines of code.
2020-01-09 13:43:06 -05:00
LemonBoy c51b79c56e Correct alignment calculation for runtime addends 2020-01-09 11:56:45 +01:00
LemonBoy 27b290f312 Propagate more failures upwards
Fixes #4112
2020-01-08 17:25:00 -05:00
LemonBoy 7ea7842ed0 Fix calculation of new alignment factor 2020-01-08 21:02:05 +01:00
LemonBoy e134e6c994 Pointer arithmetic affects the alignment factor
Closes #1528
2020-01-08 20:03:03 +01:00
LemonBoy fd7e69a2c0 More translate-c fixes
* Translate OpaqueValueExpr
* Translate BinaryConditionalOperator
* Fix translation of boolean->int casts
* Reoder some tokens to avoid rendering errors
2020-01-08 08:43:37 +01:00
LemonBoy 2a5c622e65 Fix crash with unresolved loc
Fixes #4099
2020-01-07 18:16:17 -05:00
Andrew Kelley af390b75db
cleanups related to --eh-frame-hdr 2020-01-07 16:02:38 -05:00
David Cao 8e57dd57ca
add --eh-frame-hdr conditionally 2020-01-07 15:58:40 -05:00
David Cao 599213463d
add --eh-frame-hdr arg for linking 2020-01-07 15:58:39 -05:00
LemonBoy 3607d9ee68 Fix crash in struct initializer evaluation
Closes #4100
2020-01-07 15:06:22 -05:00
via 9390e8b848 Preserve packed attribute in C translated struct (#4085)
* Preserve packed attribute in C translated struct

* Add tests for packed C struct
2020-01-07 02:36:07 -05:00
LemonBoy 8c640b3e60 Prevent bitCast to enum types
Stop the user from creating invalid enum values.
2020-01-06 19:36:17 -05:00
Andrew Kelley baaef7ed97
Merge pull request #4083 from LemonBoy/better-stdbool
Better _Bool translation
2020-01-06 19:21:55 -05:00
LemonBoy 1dc25d7550
Translate anonymous union/struct 2020-01-06 19:17:47 -05:00
Andrew Kelley be2483c576
fix test suite regressions 2020-01-06 18:20:31 -05:00
Andrew Kelley 3b5c71d2a5
fix regression with `@TypeInfo` 2020-01-06 17:13:45 -05:00
Andrew Kelley 5951b79af4
remove stdcallcc, extern, nakedcc from stage1; zig fmt rewrites 2020-01-06 15:23:05 -05:00
Andrew Kelley 0a9daeb37e
Merge branch 'cc-work' of https://github.com/LemonBoy/zig into LemonBoy-cc-work 2020-01-06 14:07:56 -05:00
LemonBoy cd39f6df95 Better _Bool translation 2020-01-06 00:12:18 +01:00
LemonBoy 6ff70d3c31 Better InitListExpr translation 2020-01-05 17:39:29 -05:00
Andrew Kelley a0ca34979e
Merge pull request #4053 from ziglang/test-run-translated-c
add test harness for "run translated C" tests
2020-01-05 14:50:02 -05:00
Andrew Kelley 14fcfe2981
translate-c supports --cache on
this will be used to provide a zig build step
2020-01-03 22:11:19 -05:00
LemonBoy b91eaba38c Correct evaluation of optional type alignment
The lazy logic was too oversimplified and produced a different result
than the one computed later causing all kinds of problems.

Closes #4013
2020-01-03 17:41:55 -05:00
Haze Booth f40b6b85f1 Remove `translate-c-2` from zig help 2020-01-03 02:17:08 -05:00
Andrew Kelley 695c8f756b
add test harness for "run translated C" tests 2020-01-03 00:26:12 -05:00
Andrew Kelley a90fa45ae1
Merge pull request #4027 from ziglang/fix-float-ops
fix float ops with respect to vectors
2020-01-02 16:10:41 -05:00
LemonBoy b0fa2ff853
Translate struct/union initializer expressions 2020-01-02 14:16:39 -05:00
Andrew Kelley 213ff939f1
fix comptime vector float ops and add test coverage
also rename `@ln` to `@log` to match libc convention.
2020-01-02 14:01:48 -05:00
LemonBoy 435528a7c5 Use the LLVM C++ API 2020-01-02 18:57:09 +01:00
LemonBoy 0ccac79c8e Implement Thiscall CC 2020-01-02 18:57:08 +01:00
LemonBoy 271fc6a247 Catch more errors during the type resolution phase
Returning the uninitialized/stale error condition made the compiler turn
a blind eye to some problems.
2020-01-02 18:53:20 +01:00
LemonBoy 563d9ebfe5 Implement the callconv() annotation 2020-01-02 18:53:16 +01:00
LemonBoy d908ca4823
Translate align attribute 2020-01-02 12:33:19 -05:00
LemonBoy 8e89bdfe99
Translate linksection attribute 2020-01-02 12:32:51 -05:00
LemonBoy 1e61e5f404 Don't ptrCast a result-location assignment to _
After #4010 doing `_ = @bitCast(...)` triggered a nonsensical compiler
error.
2020-01-02 10:41:11 -05:00
Andrew Kelley cb56b26900
fix float ops with respect to vectors
also remove the redundant type parameter
2020-01-01 23:27:43 -05:00
Andrew Kelley 576320e6d5
Merge pull request #4025 from ziglang/Vexu-stage-2-cimport
Use self hosted translate-c for cImport
2020-01-01 22:46:46 -05:00
Andrew Kelley 88c5e2a96e
translate-c: don't export inline functions 2020-01-01 20:54:17 -05:00
Vexu 1b64a5f5f0 fix segfault in bit shift safety check 2020-01-01 13:11:42 -05:00
Andrew Kelley 39ee3bc0ec
Merge branch 'stage-2-cimport' of https://github.com/Vexu/zig into Vexu-stage-2-cimport 2019-12-31 16:55:41 -05:00
Andrew Kelley 73e535e112
Merge pull request #3683 from Vexu/atomic-float
Support floats with some atomic operations
2019-12-30 19:19:05 -05:00
LemonBoy cbfd66f68a Don't crash when parsing invalid files 2019-12-30 19:17:19 -05:00
Andrew Kelley a05150e92d
fix comparing comptime_int against undefined literal
closes #4004
2019-12-30 19:08:57 -05:00
LemonBoy 28a8ded95a Resolve more types as needed
Closes #3994
2019-12-30 17:45:09 -05:00
LemonBoy c1ee846c22 Fix ptrCast of zero-sized type
Closes #2431
2019-12-30 17:43:58 -05:00
Vexu fceda07f94
use self hosted translate-c for cimports 2019-12-29 11:04:45 +02:00
Vexu ab7fc33c83
add zig llvm wrapper for atomicrmw 2019-12-23 11:55:00 +02:00
Vexu 8bb1e04449
support some atomic operations with floats 2019-12-23 11:54:47 +02:00