78 Commits

Author SHA1 Message Date
Vexu
cf5932b236
translate-c: convert int to bool if bool is expected 2020-08-11 12:24:45 +03:00
Vexu
4ab2f947f9
translate-c: recognize other type trait expressions
Closes #5979
2020-08-04 00:48:29 +03:00
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
Michael Dusan
bc75c0de6c stage1: fix compile error on macOS Xcode 11.4 2020-03-07 12:16:56 -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
Andrew Kelley
fbe6af81fd
Merge remote-tracking branch 'origin/master' into llvm10 2020-01-16 13:01:36 -05:00
LemonBoy
0267afa9c0 Fix garbled error messages from clang 2020-01-16 12:16:30 -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
95619ecb8c Stop dropping errors from clang
* Refactor the error-writing code to be more compact and flexible
2020-01-11 15:48:32 -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
LemonBoy
cbfd66f68a Don't crash when parsing invalid files 2019-12-30 19:17:19 -05:00
Vexu
122a9bad39
translate-c-2 fix some casts 2019-12-19 01:38:42 +02:00
Vexu
daa22d42b0
translate-c-2 floats 2019-12-17 11:28:56 +02:00
Vexu
eb057ef41c
translate-c-2 dont eval init expr 2019-12-13 15:07:10 +02:00
daurnimator
ed956b5812 translate-c: add support for MacroQualified definitions 2019-11-19 01:05:17 +00:00
LemonBoy
230d27c1cd Adapt to clang API additions 2019-10-13 11:08:16 -04:00
LemonBoy
3ea0a76fb6 More clang API changes 2019-10-12 16:25:51 +02:00
LemonBoy
6439759298 Add/shuffle several enum members to match Clang's API 2019-10-12 16:15:58 +02:00
Andrew Kelley
a7c9aa7ddb
finish conversion of translate_c.cpp to use zig_clang.h
See #1964

translate_c.cpp now exclusively uses the clang API via zig_clang.h

shaves off 5 seconds from building zig when translate_c.cpp
(or any h files it uses) change.
2019-10-02 19:21:40 -04:00
Andrew Kelley
f84086132f
more conversion of translate_c.cpp to use zig_clang.h
Progress: 96%

See #1964
2019-10-02 02:02:31 -04:00
Andrew Kelley
c1a05f0581
translate-c: make trans_implicit_cast_expr use zig_clang.h
See #1964
2019-10-01 17:33:11 -04:00
Andrew Kelley
e816d592e8
update zig codebase to llvm 9 2019-07-17 17:47:39 -04:00
hryx
f845994839
transBinaryOperator: Add, Sub 2019-06-23 17:17:21 -07:00
hryx
4ae95d7ffc
Translate assignment BinaryOperator statements 2019-06-22 17:29:36 -07:00
hryx
0f545e5a2b
transReturnStmt 2019-06-10 23:06:54 -07:00
hryx
84e479d94f
(broken) local var decls, integer literals (part) 2019-06-09 23:35:48 -07:00
hryx
1f82c7ba22
transCStyleCastExpr 2019-06-08 15:54:15 -07:00
hryx
3e14f86f9e
Implement missing clang functions from last commit 2019-05-29 15:33:44 -07:00
hryx
b558d0996a
expr: DeclRefExpr 2019-05-27 19:20:23 -07:00
hryx
3bbee1ba2e
expr: BitCast for ImplicitCastExpr 2019-05-27 14:38:09 -07:00
hryx
9c437f9032
var decl: ImplicitCastExpr 2019-05-26 19:14:50 -07:00
hryx
1a8f8c6262
var decl: init node 2019-05-26 17:36:47 -07:00