-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#169 sync with latest v0.1.2 version of MIR
- Loading branch information
1 parent
2862027
commit f36430d
Showing
76 changed files
with
234 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2018-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2018-2023 Vladimir Makarov <[email protected]>. | ||
aarch64 call ABI target specific code. | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
#include "../mirc.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
#include <stdint.h> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
/* See C11 5.2.4.2.2 */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
/* See 5.2.4.2 */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
static char aarch64_mirc[] | ||
|
@@ -117,6 +117,17 @@ static char aarch64_mirc[] | |
"#define linux 1\n" | ||
"#define __unix 1\n" | ||
"#define __unix__ 1\n" | ||
#ifndef __GNU_LIBRARY__ | ||
"typedef struct {\n" | ||
" void *__stack;\n" | ||
" void *__gr_top;\n" | ||
" void *__vr_top;\n" | ||
" int __gr_offs;\n" | ||
" int __vr_offs;\n" | ||
"} __builtin_va_list[1];\n" | ||
"typedef __builtin_va_list va_list;\n" | ||
"#define __DEFINED_va_list\n" | ||
#endif | ||
#elif defined(__APPLE__) | ||
"#define __APPLE__ 1\n" | ||
"#define __arm64__\n" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
static char stdarg_str[] | ||
|
@@ -8,7 +8,7 @@ static char stdarg_str[] | |
"\n" | ||
#if defined(__APPLE__) | ||
"typedef __darwin_va_list va_list;\n" | ||
#else | ||
#elif defined(__GNU_LIBRARY__) | ||
"typedef struct {\n" | ||
" void *__stack;\n" | ||
" void *__gr_top;\n" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
/* See C11 7.19 */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
/* See C11 7.20 */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2018-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2018-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
/* C to MIR compiler. It is a four pass compiler: | ||
|
@@ -1702,7 +1702,7 @@ static token_t get_next_pptoken_1 (c2m_ctx_t c2m_ctx, int header_p) { | |
} else { | ||
VARR_PUSH (char, symbol_text, curr_c); | ||
VARR_PUSH (char, symbol_text, '\0'); | ||
return new_token_wo_uniq_repr (c2m_ctx, pos, VARR_ADDR (char, symbol_text), curr_c, | ||
return new_token_wo_uniq_repr (c2m_ctx, cs->pos, VARR_ADDR (char, symbol_text), curr_c, | ||
N_IGNORE); | ||
} | ||
} | ||
|
@@ -5914,7 +5914,12 @@ static int basic_type_size (enum basic_type bt) { | |
} | ||
} | ||
|
||
static int basic_type_align (enum basic_type bt) { return basic_type_size (bt); } | ||
static int basic_type_align (enum basic_type bt) { | ||
#ifdef MIR_LDOUBLE_ALIGN | ||
if (bt == TP_LDOUBLE) return MIR_LDOUBLE_ALIGN; | ||
#endif | ||
return basic_type_size (bt); | ||
} | ||
|
||
static int type_align (struct type *type) { | ||
assert (type->align >= 0); | ||
|
@@ -8250,9 +8255,15 @@ static void process_func_decls_for_allocation (c2m_ctx_t c2m_ctx) { | |
} | ||
} | ||
|
||
#define BUILTIN_VA_START "__builtin_va_start" | ||
#define BUILTIN_VA_ARG "__builtin_va_arg" | ||
#define ALLOCA "alloca" | ||
#define BUILTIN_VA_START (const char *[]){"__builtin_va_start", NULL} | ||
#define BUILTIN_VA_ARG (const char *[]){"__builtin_va_arg", NULL} | ||
#define ALLOCA (const char *[]){"alloca", "__builtin_alloca", NULL} | ||
|
||
static int str_eq_p (const char *str, const char *v[]) { | ||
for (int i = 0; v[i] != NULL; i++) | ||
if (strcmp (v[i], str) == 0) return TRUE; | ||
return FALSE; | ||
} | ||
|
||
static void check (c2m_ctx_t c2m_ctx, node_t r, node_t context) { | ||
check_ctx_t check_ctx = c2m_ctx->check_ctx; | ||
|
@@ -8969,10 +8980,10 @@ static void check (c2m_ctx_t c2m_ctx, node_t r, node_t context) { | |
int builtin_call_p, alloca_p, va_arg_p = FALSE, va_start_p = FALSE; | ||
|
||
op1 = NL_HEAD (r->u.ops); | ||
alloca_p = op1->code == N_ID && strcmp (op1->u.s.s, ALLOCA) == 0; | ||
alloca_p = op1->code == N_ID && str_eq_p (op1->u.s.s, ALLOCA); | ||
if (op1->code == N_ID && find_def (c2m_ctx, S_REGULAR, op1, curr_scope, NULL) == NULL) { | ||
va_arg_p = strcmp (op1->u.s.s, BUILTIN_VA_ARG) == 0; | ||
va_start_p = strcmp (op1->u.s.s, BUILTIN_VA_START) == 0; | ||
va_arg_p = str_eq_p (op1->u.s.s, BUILTIN_VA_ARG); | ||
va_start_p = str_eq_p (op1->u.s.s, BUILTIN_VA_START); | ||
if (!va_arg_p && !va_start_p && !alloca_p) { | ||
/* N_SPEC_DECL (N_SHARE (N_LIST (N_INT)), N_DECL (N_ID, N_FUNC (N_LIST)), N_IGNORE) */ | ||
spec_list = new_node (c2m_ctx, N_LIST); | ||
|
@@ -9010,11 +9021,11 @@ static void check (c2m_ctx_t c2m_ctx, node_t r, node_t context) { | |
} | ||
ret_type = &res_type; | ||
if (va_start_p && NL_LENGTH (arg_list->u.ops) != 1) { | ||
error (c2m_ctx, POS (op1), "wrong number of arguments in %s call", BUILTIN_VA_START); | ||
error (c2m_ctx, POS (op1), "wrong number of arguments in %s call", op1->u.s.s); | ||
} else if (alloca_p && NL_LENGTH (arg_list->u.ops) != 1) { | ||
error (c2m_ctx, POS (op1), "wrong number of arguments in %s call", ALLOCA); | ||
error (c2m_ctx, POS (op1), "wrong number of arguments in %s call", op1->u.s.s); | ||
} else if (va_arg_p && NL_LENGTH (arg_list->u.ops) != 2) { | ||
error (c2m_ctx, POS (op1), "wrong number of arguments in %s call", BUILTIN_VA_ARG); | ||
error (c2m_ctx, POS (op1), "wrong number of arguments in %s call", op1->u.s.s); | ||
} else { | ||
/* first argument type ??? */ | ||
if (va_arg_p) { | ||
|
@@ -9258,8 +9269,8 @@ static void check (c2m_ctx_t c2m_ctx, node_t r, node_t context) { | |
symbol_t sym; | ||
struct node_scope *ns; | ||
|
||
if (strcmp (id->u.s.s, ALLOCA) == 0 || strcmp (id->u.s.s, BUILTIN_VA_START) == 0 | ||
|| strcmp (id->u.s.s, BUILTIN_VA_ARG) == 0) { | ||
if (str_eq_p (id->u.s.s, ALLOCA) || str_eq_p (id->u.s.s, BUILTIN_VA_START) | ||
|| str_eq_p (id->u.s.s, BUILTIN_VA_ARG)) { | ||
error (c2m_ctx, POS (id), "%s is a builtin function", id->u.s.s); | ||
break; | ||
} | ||
|
@@ -12129,9 +12140,9 @@ static op_t gen (c2m_ctx_t c2m_ctx, node_t r, MIR_label_t true_label, MIR_label_ | |
MIR_item_t proto_item; | ||
MIR_insn_t call_insn; | ||
mir_size_t saved_call_arg_area_offset_before_args, arg_area_offset; | ||
int va_arg_p = call_expr->builtin_call_p && strcmp (func->u.s.s, BUILTIN_VA_ARG) == 0; | ||
int va_start_p = call_expr->builtin_call_p && strcmp (func->u.s.s, BUILTIN_VA_START) == 0; | ||
int alloca_p = call_expr->builtin_call_p && strcmp (func->u.s.s, ALLOCA) == 0; | ||
int va_arg_p = call_expr->builtin_call_p && str_eq_p (func->u.s.s, BUILTIN_VA_ARG); | ||
int va_start_p = call_expr->builtin_call_p && str_eq_p (func->u.s.s, BUILTIN_VA_START); | ||
int alloca_p = call_expr->builtin_call_p && str_eq_p (func->u.s.s, ALLOCA); | ||
int builtin_call_p = alloca_p || va_arg_p || va_start_p, inline_p = FALSE; | ||
node_t block = NL_EL (curr_func_def->u.ops, 3); | ||
struct node_scope *ns = block->attr; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
#ifndef C2MIR_H | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
static const char mirc[] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
/* See C11 7.9 */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
/* See C11 7.15 */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
/* See C11 7.18 */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
/* See C11 7.23 */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2018-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2018-2023 Vladimir Makarov <[email protected]>. | ||
ppc64 call ABI target specific code. | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
#include "../mirc.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
#include <stdint.h> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
/* See C11 5.2.4.2.2 */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
/* See 5.2.4.2 */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
static char ppc64_mirc[] | ||
|
@@ -113,6 +113,11 @@ static char ppc64_mirc[] | |
"#define linux 1\n" | ||
"#define __unix 1\n" | ||
"#define __unix__ 1\n" | ||
#ifndef __GNU_LIBRARY__ | ||
"typedef void *__builtin_va_list[1];\n" | ||
"typedef __builtin_va_list va_list;\n" | ||
"#define __DEFINED_va_list\n" | ||
#endif | ||
#endif | ||
"\n" | ||
"void *alloca (unsigned long);\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
static char stdarg_str[] | ||
= "#ifndef __STDARG_H\n" | ||
"#define __STDARG_H\n" | ||
"\n" | ||
#if defined(__GNU_LIBRARY__) | ||
"typedef void *va_list[1];\n" | ||
"\n" | ||
#endif | ||
"#define va_start(ap, param) __builtin_va_start (ap)\n" | ||
"#define va_arg(ap, type) __builtin_va_arg(ap, (type *) 0)\n" | ||
"#define va_end(ap) 0\n" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
/* See C11 7.19 */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
/* See C11 7.20 */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2018-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2018-2023 Vladimir Makarov <[email protected]>. | ||
riscv64 call ABI target specific code. | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
#include "../mirc.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
#include <stdint.h> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
/* See C11 5.2.4.2.2 */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
/* See 5.2.4.2 */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
static char riscv64_mirc[] | ||
|
@@ -109,5 +109,12 @@ static char riscv64_mirc[] | |
"#define linux 1\n" | ||
"#define __unix 1\n" | ||
"#define __unix__ 1\n" | ||
#ifndef __GNU_LIBRARY__ | ||
"typedef struct {\n" | ||
" void *arg_area;\n" | ||
"} __builtin_va_list;\n" | ||
"typedef __builtin_va_list va_list;\n" | ||
"#define __DEFINED_va_list\n" | ||
#endif | ||
"\n" | ||
"void *alloca (unsigned long);\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
static char stdarg_str[] | ||
= "#ifndef __STDARG_H\n" | ||
"#define __STDARG_H\n" | ||
"\n" | ||
#if defined(__GNU_LIBRARY__) | ||
"typedef struct {\n" | ||
" void *arg_area;\n" | ||
"} va_list;\n" | ||
"\n" | ||
#endif | ||
"#define va_start(ap, param) __builtin_va_start (ap)\n" | ||
"#define va_arg(ap, type) __builtin_va_arg(ap, (type *) 0)\n" | ||
"#define va_end(ap) 0\n" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* This file is a part of MIR project. | ||
Copyright (C) 2020-2021 Vladimir Makarov <[email protected]>. | ||
Copyright (C) 2020-2023 Vladimir Makarov <[email protected]>. | ||
*/ | ||
|
||
/* See C11 7.19 */ | ||
|
Oops, something went wrong.