Commit Graph

52 Commits

Author SHA1 Message Date
Vexu
2151f84d59 implement new async syntax in self-hosted compiler 2019-08-16 06:17:28 -07:00
hryx
247e567422
Don't return a slice pointing to a deceased stack address 2019-06-28 18:01:41 -07:00
hryx
102bf5200c
Fix string literal: not null-terminated (thanks @mikdusan) 2019-06-28 17:40:20 -07:00
hryx
cc74bf5136
Translate IntegralCast; add stage2 test coverage 2019-06-27 23:12:33 -07:00
hryx
646268875e
Use new width format option 2019-06-27 22:16:31 -07:00
hryx
3e0ff32bd8
Separate with space instead of LF to prevent rendering excessive indentation 2019-06-27 21:17:27 -07:00
hryx
b4bd52cc51
Create and render big.Int from IntegerLiteral; group BinaryOperator 2019-06-27 21:02:48 -07:00
hryx
8435351581
Escape C string literals 2019-06-24 22:37:19 -07:00
hryx
f845994839
transBinaryOperator: Add, Sub 2019-06-23 17:17:21 -07:00
hryx
69b90e0681
transStringLiteral 2019-06-23 15:06:16 -07:00
hryx
b2e06c3bf4
Observe translate mode in stage2 2019-06-23 14:32:45 -07:00
hryx
1c86a191da
Fix order of tokens; omit 'pub' for fn types 2019-06-23 01:03:28 -07:00
hryx
4c8b460fec
Fix recursive self-referential block 2019-06-22 22:30:15 -07:00
hryx
4ae95d7ffc
Translate assignment BinaryOperator statements 2019-06-22 17:29:36 -07:00
hryx
6325ffc3f1
Assign undefined literal (instead of null) when no init value 2019-06-22 17:29:10 -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
ad0f0562d8
Merge branch 'master' into translate-c-userland 2019-06-08 16:23:27 -07:00
hryx
ed5b8335b5
(broken) translate Paren type 2019-06-08 16:09:25 -07:00
hryx
1692a76d28
transImplictCastExpr: LValueToRValue 2019-06-08 15:57:43 -07:00
hryx
1f82c7ba22
transCStyleCastExpr 2019-06-08 15:54:15 -07:00
Andrew Kelley
bfc86776d5
run zig fmt to update use to usingnamespace 2019-05-29 19:09:58 -04:00
hryx
3e14f86f9e
Implement missing clang functions from last commit 2019-05-29 15:33:44 -07:00
hryx
e632c2ade3
(broken) port a bunch of stuff from stage1 translate-c 2019-05-27 23:55:48 -07:00
hryx
b558d0996a
expr: DeclRefExpr 2019-05-27 19:20:23 -07:00
hryx
e07888e54c
expr: FunctionToPointerDecay & ArrayToPointerDecay for ImplicitCastExpr 2019-05-27 18:18:27 -07:00
hryx
22299869ba
Prevent infinite recursion 2019-05-27 17:54:40 -07:00
hryx
e1f3eec9cc
Merge branch 'master' into translate-c-userland 2019-05-27 17:24:21 -07:00
Andrew Kelley
3fccc07479
self-hosted translate-c: fix bad memory arena references 2019-05-27 20:22:15 -04:00
hryx
2aa1c5da5d
Remove unused local struct type 2019-05-27 15:58:21 -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
5a57610039
clean up code now that #769 is implemented 2019-05-14 19:23:31 -04:00
Andrew Kelley
10e9d47b49
stage2 translate-c: implement functions with no prototype
stage1 translate-c actually has this wrong. When exporting a function,
it's ok to use empty parameters. But for prototypes, "no prototype"
means that it has to be emitted as a function that accepts anything,
e.g. extern fn foo(...) void;

See #1964
2019-05-11 12:09:11 -04:00
Andrew Kelley
5f4c3e6557
stage2 translate-c: simple function definitions
See #1964
2019-05-10 23:35:46 -04:00
Andrew Kelley
dbb5da14f4
stage2 translate-c: builtin types and pub
See #1964
2019-05-10 17:56:00 -04:00
Andrew Kelley
82219b1fd5
translate-c: better handling of restore points 2019-05-10 17:44:47 -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
46e1c34fcf
self-hosted translate-c progress on function decls
See #1964
2019-05-08 22:05:59 -04:00
Andrew Kelley
9bbd71c9ab
add --bundle-compiler-rt function to link options
and use it when building libuserland.a

The self-hosted part of stage1 relies on zig's compiler-rt, and so we
include it in libuserland.a.

This should potentially be the default, but for now it's behind a linker
option.

self-hosted translate-c: small progress on translating functions.
2019-05-08 20:51:49 -04:00
Andrew Kelley
a7f99c8ee9
self-hosted translate-c: iterate over top level decls
See #1964
2019-04-30 00:21:45 -04:00
Andrew Kelley
28071ac637
self-hosted translate-c emits a hello world AST
Also breaking std lib API change: the return value of
std.zig.parse returns `*ast.Tree` rather than `ast.Tree`.

See #1964
2019-04-26 15:43:36 -04:00
Andrew Kelley
535d419590
translate-c: self-hosted implementation can detect C errors
See #1964
2019-04-25 00:06:58 -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