53 Commits

Author SHA1 Message Date
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
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
hryx
c79b8aeaef
var decl: threadlocal 2019-05-26 17:05:49 -07:00
hryx
99f0b28d39
var decl: mut_token, create child scope 2019-05-26 16:51:25 -07:00
hryx
fceedada5c
WIP translate var decl 2019-05-26 15:43:13 -07:00
Andrew Kelley
07d0aee11a
clang C API wrapper: small progress 2019-05-16 12:55:45 -04:00
Andrew Kelley
3aa43dc31c
update libclang C API wrapper 2019-05-15 11:57:55 -04:00
Andrew Kelley
5f4c3e6557
stage2 translate-c: simple function definitions
See #1964
2019-05-10 23:35:46 -04:00
Andrew Kelley
a6f7a9ce2b
translate-c: we have our first test of self-hosted
See #1964
2019-05-10 16:03:54 -04:00
Andrew Kelley
1c0223899c
translate-c: progress on self-hosted function prototypes
See #1964
2019-05-10 01:24:00 -04:00
Andrew Kelley
eea2de108d
translate-c: progress on self-hosted function prototypes
See #1964
2019-05-09 16:52:30 -04:00
Andrew Kelley
214625587c
translate-c: use C API for builtin types
See #1964
2019-05-09 15:46:48 -04:00
Andrew Kelley
46e1c34fcf
self-hosted translate-c progress on function decls
See #1964
2019-05-08 22:05:59 -04:00
Andrew Kelley
b4f8d68e2e
translate-c: fix using wrong enum
closes #2385
2019-04-30 03:14:45 -04:00
Andrew Kelley
a7f99c8ee9
self-hosted translate-c: iterate over top level decls
See #1964
2019-04-30 00:21:45 -04:00
LemonBoy
77383f968d translate-c: Emit @ptrCast + @alignPtr sequence
Avoid producing Zig code that doesn't compile due to mismatched
alignments between pointers.

Always emit a @alignOf instead of hardcoding the alignment value
returned by LLVM for portability sake of the generated code.
2019-04-29 21:30:19 -04:00
Andrew Kelley
712274997e
translate-c: unify API for self-hosted and C++ translate-c
See #1964
2019-04-25 00:06:57 -04:00
Andrew Kelley
3226b5315e
translate-c: move some code to the C API
See #1964
2019-04-16 04:32:48 -04:00
Andrew Kelley
5cb18e9c6f
translate-c: move some code to the C API
See #1964
2019-04-15 00:32:27 -04:00
Andrew Kelley
9d229791c6
translate-c: move some code to the C API
See #1964
2019-04-12 14:39:12 -04:00
Andrew Kelley
6284a4c534
translate-c: move some code to the C API
See #1964
2019-04-12 03:56:38 -04:00
Andrew Kelley
f860493f23
translate-c: move some code to the C API
See #1964
2019-04-12 03:12:22 -04:00
Andrew Kelley
6f34d08aed
translate-c: move some code to the C API
See #1964
2019-04-11 23:38:41 -04:00
Andrew Kelley
b960f1d922
translate-c: move some code to the C API
See #1964
2019-04-11 15:33:26 -04:00
Andrew Kelley
dff201540f
translate-c: move some code to the C API
See #1964
2019-04-11 03:59:12 -04:00
Andrew Kelley
6bc19b437c
updates to build with llvm 8.0.0rc3 2019-02-28 09:55:27 -05:00
LemonBoy
6cf38369d2 Silence gcc8 class-memaccess warnings
Use an explicit cast to tell gcc we know what we're doing.
2019-02-17 14:40:01 -05:00