| author | |
| committer | |
| log | 9ce36ba0ccd5d7de076e688423862d315ef4233f |
| tree | 24be8536eba04042e04995aa8d89951b8cc4fbe1 |
| parent | e21369a1539063773734432993bc2c23680f0913 |
4 files changed, 8 insertions(+), 8 deletions(-)
doc/langref.md+1-1| ... | @@ -84,7 +84,7 @@ AsmOutput : token(Colon) list(AsmOutputItem, token(Comma)) option(AsmInput) | ... | @@ -84,7 +84,7 @@ AsmOutput : token(Colon) list(AsmOutputItem, token(Comma)) option(AsmInput) |
| 84 | 84 | ||
| 85 | AsmInput : token(Colon) list(AsmInputItem, token(Comma)) option(AsmClobbers) | 85 | AsmInput : token(Colon) list(AsmInputItem, token(Comma)) option(AsmClobbers) |
| 86 | 86 | ||
| 87 | AsmOutputItem : token(LBracket) token(Symbol) token(RBracket) token(String) token(LParen) (token(Symbol) | token(Return) Type) token(RParen) | 87 | AsmOutputItem : token(LBracket) token(Symbol) token(RBracket) token(String) token(LParen) (token(Symbol) | token(Arrow) Type) token(RParen) |
| 88 | 88 | ||
| 89 | AsmInputItem : token(LBracket) token(Symbol) token(RBracket) token(String) token(LParen) Expression token(RParen) | 89 | AsmInputItem : token(LBracket) token(Symbol) token(RBracket) token(String) token(LParen) Expression token(RParen) |
| 90 | 90 |
src/parser.cpp+2-2| ... | @@ -1761,7 +1761,7 @@ static void ast_parse_asm_input_item(ParseContext *pc, int *token_index, AstNode | ... | @@ -1761,7 +1761,7 @@ static void ast_parse_asm_input_item(ParseContext *pc, int *token_index, AstNode |
| 1761 | } | 1761 | } |
| 1762 | 1762 | ||
| 1763 | /* | 1763 | /* |
| 1764 | AsmOutputItem : token(LBracket) token(Symbol) token(RBracket) token(String) token(LParen) (token(Symbol) | token(Return) Type) token(RParen) | 1764 | AsmOutputItem : token(LBracket) token(Symbol) token(RBracket) token(String) token(LParen) (token(Symbol) | token(Arrow) Type) token(RParen) |
| 1765 | */ | 1765 | */ |
| 1766 | static void ast_parse_asm_output_item(ParseContext *pc, int *token_index, AstNode *node) { | 1766 | static void ast_parse_asm_output_item(ParseContext *pc, int *token_index, AstNode *node) { |
| 1767 | ast_eat_token(pc, token_index, TokenIdLBracket); | 1767 | ast_eat_token(pc, token_index, TokenIdLBracket); |
| ... | @@ -1778,7 +1778,7 @@ static void ast_parse_asm_output_item(ParseContext *pc, int *token_index, AstNod | ... | @@ -1778,7 +1778,7 @@ static void ast_parse_asm_output_item(ParseContext *pc, int *token_index, AstNod |
| 1778 | *token_index += 1; | 1778 | *token_index += 1; |
| 1779 | if (token->id == TokenIdSymbol) { | 1779 | if (token->id == TokenIdSymbol) { |
| 1780 | ast_buf_from_token(pc, token, &asm_output->variable_name); | 1780 | ast_buf_from_token(pc, token, &asm_output->variable_name); |
| 1781 | } else if (token->id == TokenIdKeywordReturn) { | 1781 | } else if (token->id == TokenIdArrow) { |
| 1782 | asm_output->return_type = ast_parse_type(pc, token_index); | 1782 | asm_output->return_type = ast_parse_type(pc, token_index); |
| 1783 | } else { | 1783 | } else { |
| 1784 | ast_invalid_token_error(pc, token); | 1784 | ast_invalid_token_error(pc, token); |
std/bootstrap.zig+3-3| ... | @@ -2,8 +2,8 @@ use "std.zig"; | ... | @@ -2,8 +2,8 @@ use "std.zig"; |
| 2 | 2 | ||
| 3 | #attribute("naked") | 3 | #attribute("naked") |
| 4 | export fn _start() -> unreachable { | 4 | export fn _start() -> unreachable { |
| 5 | const argc = asm("mov (%%rsp), %[argc]" : [argc] "=r" (return isize)); | 5 | const argc = asm("mov (%%rsp), %[argc]" : [argc] "=r" (-> isize)); |
| 6 | const argv = asm("lea 0x8(%%rsp), %[argv]" : [argv] "=r" (return &&u8)); | 6 | const argv = asm("lea 0x8(%%rsp), %[argv]" : [argv] "=r" (-> &&u8)); |
| 7 | const env = asm("lea 0x10(%%rsp,%%rdi,8), %[env]" : [env] "=r" (return &&u8)); | 7 | const env = asm("lea 0x10(%%rsp,%%rdi,8), %[env]" : [env] "=r" (-> &&u8)); |
| 8 | exit(main(argc, argv, env)) | 8 | exit(main(argc, argv, env)) |
| 9 | } | 9 | } |
std/std.zig+2-2| ... | @@ -4,14 +4,14 @@ const stdout_fileno : isize = 1; | ... | @@ -4,14 +4,14 @@ const stdout_fileno : isize = 1; |
| 4 | 4 | ||
| 5 | fn syscall1(number: isize, arg1: isize) -> isize { | 5 | fn syscall1(number: isize, arg1: isize) -> isize { |
| 6 | asm volatile ("syscall" | 6 | asm volatile ("syscall" |
| 7 | : [ret] "={rax}" (return isize) | 7 | : [ret] "={rax}" (-> isize) |
| 8 | : [number] "{rax}" (number), [arg1] "{rdi}" (arg1) | 8 | : [number] "{rax}" (number), [arg1] "{rdi}" (arg1) |
| 9 | : "rcx", "r11") | 9 | : "rcx", "r11") |
| 10 | } | 10 | } |
| 11 | 11 | ||
| 12 | fn syscall3(number: isize, arg1: isize, arg2: isize, arg3: isize) -> isize { | 12 | fn syscall3(number: isize, arg1: isize, arg2: isize, arg3: isize) -> isize { |
| 13 | asm volatile ("syscall" | 13 | asm volatile ("syscall" |
| 14 | : [ret] "={rax}" (return isize) | 14 | : [ret] "={rax}" (-> isize) |
| 15 | : [number] "{rax}" (number), [arg1] "{rdi}" (arg1), [arg2] "{rsi}" (arg2), [arg3] "{rdx}" (arg3) | 15 | : [number] "{rax}" (number), [arg1] "{rdi}" (arg1), [arg2] "{rsi}" (arg2), [arg3] "{rdx}" (arg3) |
| 16 | : "rcx", "r11") | 16 | : "rcx", "r11") |
| 17 | } | 17 | } |