Commit Graph

86 Commits (f92ccf365be1e4dad74f6ac08503832ed2d7f805)

Author SHA1 Message Date
Andrew Kelley 656ba530d8
Merge remote-tracking branch 'origin/master' into llvm10 2020-03-13 15:17:53 -04:00
Vexu cb4c488cbd
translate-c support struct field alignment 2020-03-10 15:57:57 +02:00
Vexu 692a974c3e
translate-c reject structs with VLAs 2020-03-08 12:11:37 +02:00
Andrew Kelley d1cb16aace
Merge remote-tracking branch 'origin/master' into llvm10 2020-03-03 09:44:13 -05:00
Andrew Kelley 4616af0ca4
introduce operating system version ranges as part of the target
* re-introduce `std.build.Target` which is distinct from `std.Target`.
   `std.build.Target` wraps `std.Target` so that it can be annotated as
   "the native target" or an explicitly specified target.
 * `std.Target.Os` is moved to `std.Target.Os.Tag`. The former is now a
   struct which has the tag as well as version range information.
 * `std.elf` gains some more ELF header constants.
 * `std.Target.parse` gains the ability to parse operating system
   version ranges as well as glibc version.
 * Added `std.Target.isGnuLibC()`.
 * self-hosted dynamic linker detection and glibc version detection.
   This also adds the improved logic using `/usr/bin/env` rather than
   invoking the system C compiler to find the dynamic linker when zig
   is statically linked. Related: #2084
   Note: this `/usr/bin/env` code is work-in-progress.
 * `-target-glibc` CLI option is removed in favor of the new `-target`
   syntax. Example: `-target x86_64-linux-gnu.2.27`

closes #1907
2020-02-28 14:51:53 -05:00
Andrew Kelley a475877007
fix translate-c regression
clang.zig had incorrect enum for builtin types
2020-01-30 18:43:54 -05:00
Andrew Kelley a63a2fdf76
update zig_clang bindings to release/10.x 2020-01-29 23:50:24 -05:00
Andrew Kelley a95dce15ae
Merge remote-tracking branch 'origin/master' into llvm10 2020-01-29 23:33:12 -05:00
Feix Weiglhofer a4a9330648 translate-c: Don't make const parameters mutable. (#4273)
* translate-c: Remove arg-prefix from const parameters.
* translate-c: Add unittest for const parameters.
2020-01-24 15:32:32 -05:00
Andrew Kelley 72589dbffe
zig_clang builds with llvm 10 2020-01-23 17:22:13 -05:00
Andrew Kelley 32dafbdadc
zig_clang: update StmtClass to llvm 10 2020-01-23 16:52:40 -05:00
Andrew Kelley 3588f99719
zig_clang: update TypeClass enum 2020-01-23 14:35:12 -05:00
LemonBoy a284be3f69 Fix unsafe cast in translate_c
Fixes #4250
2020-01-22 17:58:57 -05:00
LemonBoy 34ae1d9aa8 Fix unsafe cast in translate_c
* Handle EmptyDecls to clean up the generated code

Closes #4143
2020-01-11 15:51:10 -05:00
LemonBoy 570ffc470e Handle forward-declared functions
Closes #4130
2020-01-10 16:34:40 -05: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
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
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
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
LemonBoy b0fa2ff853
Translate struct/union initializer expressions 2020-01-02 14:16:39 -05: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
Andrew Kelley 88c5e2a96e
translate-c: don't export inline functions 2020-01-01 20:54:17 -05:00
Andrew Kelley dc28526c6c
translate-c: improve support of integer casting
Widening and truncating integer casting to different signedness
works better now. For example `(unsigned long)-1` is now translated
to zig code that compiles correctly.
2020-01-01 18:10:43 -05:00
frmdstryr fcc82a219a
Add macro ops 2019-12-29 19:50:45 +02:00
Vexu f837c7c9cd
translate-c-2 compound assign 2019-12-19 16:13:28 +02:00
Vexu 809deb6ec0
translate-c-2 unary operators common case 2019-12-19 09:56:00 +02:00
Vexu e4c47e80b4
translate-c-2 unaryexprortypetrait + fixes 2019-12-19 08:28:36 +02:00
Vexu 122a9bad39
translate-c-2 fix some casts 2019-12-19 01:38:42 +02:00
Vexu d54c288bd3
translate-c-2 function calls 2019-12-18 23:56:39 +02:00
Vexu c2666c48a4
translate-c-2 array access 2019-12-18 22:57:53 +02:00
Vexu cf7a5b7a4a
translate-c-2 member access 2019-12-18 22:29:42 +02:00
Vexu e65b9e8f7b
translate-c-2 stmt expr 2019-12-18 21:20:38 +02:00
Vexu f54e7d6c99
translate-c-2 update @kavika13's work to removal of TransResult 2019-12-18 12:47:35 +02:00
Vexu 21bc3353b8
translate-c-2 character literals and more test fixes 2019-12-18 01:04:01 +02:00
Vexu 6d7025d0c5
translate-c-2 various fixes to get more tests passing 2019-12-17 23:28:13 +02:00
Vexu 65531c73a9
translate-c-2 switch 2019-12-17 17:19:28 +02:00
Vexu 0283ab8a1a
translate-c-2 conditional operator 2019-12-17 12:06:28 +02:00
Vexu daa22d42b0
translate-c-2 floats 2019-12-17 11:28:56 +02:00
Vexu ab6fe57462
translate-c-2 for loops 2019-12-17 01:40:06 +02:00
Vexu 6a3d48353b
translate-c-2 while loops 2019-12-16 22:10:17 +02:00
Vexu e3f1bfe483
translate-c-2 if statements 2019-12-16 18:19:37 +02:00
Vexu a37caaa528
translate-c-2 parameter name aliasing 2019-12-16 10:39:31 +02:00
Vexu ab60c8e28f
c tokenizer escape sequences 2019-12-16 00:55:50 +02:00
Vexu 75218d4765
translate-c-2 macros 2019-12-15 14:44:11 +02:00
Vexu e57e3602e7
translate-c-2 implement enums 2019-12-14 23:24:47 +02:00
Vexu 4dae70e702
translate-c-2 container aliases 2019-12-14 13:40:33 +02:00
Vexu e4ca1f441b
translate-c-2 record type 2019-12-14 02:00:01 +02:00