Commit Graph

75 Commits (9a0a378e2f957f6acf5fbb37818d1cc0e3a38d33)

Author SHA1 Message Date
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
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
Vexu 41a67126a5
translate-c-2 typedef 2019-12-13 17:40:37 +02:00
Vexu eb057ef41c
translate-c-2 dont eval init expr 2019-12-13 15:07:10 +02:00
Vexu 0795f17db2
translate-c-2 incompleteArray 2019-12-12 21:39:04 +02:00
Vexu 48ac84db1b
translate-c-2 translate apvalue 2019-12-12 20:35:40 +02:00
Vexu ef361161e2
translate-c-2 add var decl 2019-12-12 16:12:19 +02:00
Merlyn Morgan-Graham fe415dae04 Add paren expression statements to self-hosted translate-C 2019-12-10 23:52:40 -08:00
Andrew Kelley 15d415e10b
make std.mem.toSlice use null terminated pointers
and fix the fallout
2019-11-24 21:21:05 -05:00
daurnimator ed956b5812 translate-c: add support for MacroQualified definitions 2019-11-19 01:05:17 +00:00
Andrew Kelley e816d592e8
update zig codebase to llvm 9 2019-07-17 17:47:39 -04:00
emekoi 0435026474 fixed size of ZigClangAPValue on mingw-w64 2019-07-16 09:34:02 -04:00
hryx 0e38f7215b
Define different struct size for APValue on Windows (thanks @Sahnvour) 2019-06-29 14:34:00 -07:00