Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mir refresh #259

Merged
merged 5 commits into from
Jun 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ option(NO_JIT "Controls whether JIT should be disabled, default is OFF" OFF)
option(STATIC_BUILD "Build static version of Ravi, default is OFF" OFF)
option(COMPUTED_GOTO "Controls whether the interpreter switch will use computed gotos on gcc/clang, default is ON" ON)
option(LTESTS "Controls whether ltests are enabled in Debug mode; note requires Debug build" ON)
option(ASAN "Controls whether address sanitizer should be enabled" OFF)
option(ASAN "Controls whether address sanitizer should be enabled" ON)
option(RAVICOMP "Controls whether to link in RaviComp" ON)

# By we enable MIR JIT
Expand Down
1 change: 0 additions & 1 deletion mir/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ PointerAlignment: Right
BreakBeforeBinaryOperators: All
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 2
ContinuationIndentWidth: 2
PenaltyBreakBeforeFirstCallParameter: 10000
SortIncludes: false
BreakStringLiterals: true
Expand Down
2 changes: 1 addition & 1 deletion mir/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018-2020 Vladimir Makarov
Copyright (c) 2018-2024 Vladimir Makarov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
17 changes: 10 additions & 7 deletions mir/c2mir/aarch64/caarch64-ABI-code.c
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
/* This file is a part of MIR project.
Copyright (C) 2018-2023 Vladimir Makarov <[email protected]>.
Copyright (C) 2018-2024 Vladimir Makarov <[email protected]>.
aarch64 call ABI target specific code.
*/

typedef int target_arg_info_t;

static void target_init_arg_vars (c2m_ctx_t c2m_ctx, target_arg_info_t *arg_info) {}
static void target_init_arg_vars (c2m_ctx_t c2m_ctx MIR_UNUSED,
target_arg_info_t *arg_info MIR_UNUSED) {}

static int target_return_by_addr_p (c2m_ctx_t c2m_ctx, struct type *ret_type) {
return ((ret_type->mode == TM_STRUCT || ret_type->mode == TM_UNION)
&& type_size (c2m_ctx, ret_type) > 2 * 8);
}

static int reg_aggregate_size (c2m_ctx_t c2m_ctx, struct type *type) {
int size;
size_t size;

if (type->mode != TM_STRUCT && type->mode != TM_UNION) return -1;
return (size = type_size (c2m_ctx, type)) <= 2 * 8 ? size : -1;
return (size = type_size (c2m_ctx, type)) <= 2 * 8 ? (int) size : -1;
}

static void target_add_res_proto (c2m_ctx_t c2m_ctx, struct type *ret_type,
Expand Down Expand Up @@ -77,7 +78,8 @@ static void target_add_ret_ops (c2m_ctx_t c2m_ctx, struct type *ret_type, op_t r
gen_multiple_load_store (c2m_ctx, ret_type, VARR_ADDR (MIR_op_t, ret_ops), res.mir_op, TRUE);
}

static MIR_type_t target_get_blk_type (c2m_ctx_t c2m_ctx, struct type *arg_type) {
static MIR_type_t target_get_blk_type (c2m_ctx_t c2m_ctx MIR_UNUSED,
struct type *arg_type MIR_UNUSED) {
return MIR_T_BLK; /* one BLK is enough */
}

Expand All @@ -91,7 +93,8 @@ static void target_add_call_arg_op (c2m_ctx_t c2m_ctx, struct type *arg_type,
simple_add_call_arg_op (c2m_ctx, arg_type, arg_info, arg);
}

static int target_gen_gather_arg (c2m_ctx_t c2m_ctx, const char *name, struct type *arg_type,
decl_t param_decl, target_arg_info_t *arg_info) {
static int target_gen_gather_arg (c2m_ctx_t c2m_ctx MIR_UNUSED, const char *name MIR_UNUSED,
struct type *arg_type MIR_UNUSED, decl_t param_decl MIR_UNUSED,
target_arg_info_t *arg_info MIR_UNUSED) {
return FALSE;
}
5 changes: 3 additions & 2 deletions mir/c2mir/aarch64/caarch64-code.c
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-2023 Vladimir Makarov <[email protected]>.
Copyright (C) 2020-2024 Vladimir Makarov <[email protected]>.
*/

#include "../mirc.h"
Expand All @@ -19,7 +19,8 @@ static string_include_t standard_includes[]
#define ADJUST_VAR_ALIGNMENT(c2m_ctx, align, type) \
aarch64_adjust_var_alignment (c2m_ctx, align, type)

static int aarch64_adjust_var_alignment (c2m_ctx_t c2m_ctx, int align, struct type *type) {
static int aarch64_adjust_var_alignment (c2m_ctx_t c2m_ctx MIR_UNUSED, int align,
struct type *type MIR_UNUSED) {
return align;
}

Expand Down
2 changes: 1 addition & 1 deletion mir/c2mir/aarch64/caarch64.h
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-2023 Vladimir Makarov <[email protected]>.
Copyright (C) 2020-2024 Vladimir Makarov <[email protected]>.
*/

#include <stdint.h>
Expand Down
2 changes: 1 addition & 1 deletion mir/c2mir/aarch64/mirc_aarch64_float.h
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-2023 Vladimir Makarov <[email protected]>.
Copyright (C) 2020-2024 Vladimir Makarov <[email protected]>.
*/

/* See C11 5.2.4.2.2 */
Expand Down
2 changes: 1 addition & 1 deletion mir/c2mir/aarch64/mirc_aarch64_limits.h
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-2023 Vladimir Makarov <[email protected]>.
Copyright (C) 2020-2024 Vladimir Makarov <[email protected]>.
*/

/* See 5.2.4.2 */
Expand Down
2 changes: 1 addition & 1 deletion mir/c2mir/aarch64/mirc_aarch64_linux.h
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-2023 Vladimir Makarov <[email protected]>.
Copyright (C) 2020-2024 Vladimir Makarov <[email protected]>.
*/

static char aarch64_mirc[]
Expand Down
2 changes: 1 addition & 1 deletion mir/c2mir/aarch64/mirc_aarch64_stdarg.h
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-2023 Vladimir Makarov <[email protected]>.
Copyright (C) 2020-2024 Vladimir Makarov <[email protected]>.
*/

static char stdarg_str[]
Expand Down
2 changes: 1 addition & 1 deletion mir/c2mir/aarch64/mirc_aarch64_stddef.h
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-2023 Vladimir Makarov <[email protected]>.
Copyright (C) 2020-2024 Vladimir Makarov <[email protected]>.
*/

/* See C11 7.19 */
Expand Down
2 changes: 1 addition & 1 deletion mir/c2mir/aarch64/mirc_aarch64_stdint.h
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-2023 Vladimir Makarov <[email protected]>.
Copyright (C) 2020-2024 Vladimir Makarov <[email protected]>.
*/

/* See C11 7.20 */
Expand Down
Loading
Loading