From bb2dc6619155dfeb2cac34084eb3a8693d61636f Mon Sep 17 00:00:00 2001 From: Timo Paulssen Date: Thu, 7 Mar 2019 14:08:30 +0100 Subject: [PATCH] Fix warnings about const from prev commit --- src/spesh/inline.c | 6 +++--- src/spesh/inline.h | 4 ++-- src/spesh/optimize.c | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/spesh/inline.c b/src/spesh/inline.c index 9c7ebbf6a0..6b1658f048 100644 --- a/src/spesh/inline.c +++ b/src/spesh/inline.c @@ -91,7 +91,7 @@ static int is_static_frame_inlineable(MVMThreadContext *tc, MVMSpeshGraph *inlin * and returns zero. Optionally builds up usage counts on the graph. */ static int is_graph_inlineable(MVMThreadContext *tc, MVMSpeshGraph *inliner, MVMStaticFrame *target_sf, MVMSpeshIns *invoke_ins, - MVMSpeshGraph *ig, char **no_inline_reason, MVMOpInfo **no_inline_info) { + MVMSpeshGraph *ig, char **no_inline_reason, MVMOpInfo const **no_inline_info) { MVMSpeshBB *bb = ig->entry; MVMint32 same_hll = target_sf->body.cu->body.hll_config == inliner->sf->body.cu->body.hll_config; @@ -220,7 +220,7 @@ MVMSpeshGraph * MVM_spesh_inline_try_get_graph(MVMThreadContext *tc, MVMSpeshGra MVMSpeshIns *invoke_ins, char **no_inline_reason, MVMuint32 *effective_size, - MVMOpInfo **no_inline_info) { + MVMOpInfo const **no_inline_info) { MVMSpeshGraph *ig; MVMSpeshIns **deopt_usage_ins = NULL; @@ -268,7 +268,7 @@ MVMSpeshGraph * MVM_spesh_inline_try_get_graph(MVMThreadContext *tc, MVMSpeshGra /* Tries to get a spesh graph for a particular unspecialized candidate. */ MVMSpeshGraph * MVM_spesh_inline_try_get_graph_from_unspecialized(MVMThreadContext *tc, MVMSpeshGraph *inliner, MVMStaticFrame *target_sf, MVMSpeshIns *invoke_ins, - MVMSpeshCallInfo *call_info, MVMSpeshStatsType *type_tuple, char **no_inline_reason, MVMOpInfo **no_inline_info) { + MVMSpeshCallInfo *call_info, MVMSpeshStatsType *type_tuple, char **no_inline_reason, MVMOpInfo const **no_inline_info) { MVMSpeshGraph *ig; /* Cannot inline with flattening args. */ diff --git a/src/spesh/inline.h b/src/spesh/inline.h index 21923dbe45..4384f06462 100644 --- a/src/spesh/inline.h +++ b/src/spesh/inline.h @@ -48,10 +48,10 @@ struct MVMSpeshInline { MVMSpeshGraph * MVM_spesh_inline_try_get_graph(MVMThreadContext *tc, MVMSpeshGraph *inliner, MVMStaticFrame *target_sf, MVMSpeshCandidate *cand, - MVMSpeshIns *invoke_ins, char **no_inline_reason, MVMuint32 *effective_size, MVMOpInfo **no_inline_info); + MVMSpeshIns *invoke_ins, char **no_inline_reason, MVMuint32 *effective_size, MVMOpInfo const **no_inline_info); MVMSpeshGraph * MVM_spesh_inline_try_get_graph_from_unspecialized(MVMThreadContext *tc, MVMSpeshGraph *inliner, MVMStaticFrame *target_sf, MVMSpeshIns *invoke_ins, - MVMSpeshCallInfo *call_info, MVMSpeshStatsType *type_tuple, char **no_inline_reason, MVMOpInfo **no_inline_info); + MVMSpeshCallInfo *call_info, MVMSpeshStatsType *type_tuple, char **no_inline_reason, MVMOpInfo const **no_inline_info); void MVM_spesh_inline(MVMThreadContext *tc, MVMSpeshGraph *inliner, MVMSpeshCallInfo *call_info, MVMSpeshBB *invoke_bb, MVMSpeshIns *invoke, MVMSpeshGraph *inlinee, MVMStaticFrame *inlinee_sf, diff --git a/src/spesh/optimize.c b/src/spesh/optimize.c index 8b59a4739a..dc8314ccde 100644 --- a/src/spesh/optimize.c +++ b/src/spesh/optimize.c @@ -8,7 +8,7 @@ static void optimize_bigint_bool_op(MVMThreadContext *tc, MVMSpeshGraph *g, MVMS /* Logging of whether we can or can't inline. */ static void log_inline(MVMThreadContext *tc, MVMSpeshGraph *g, MVMStaticFrame *target_sf, MVMSpeshGraph *inline_graph, MVMuint32 bytecode_size, - char *no_inline_reason, MVMint32 unspecialized, MVMOpInfo *no_inline_info) { + char *no_inline_reason, MVMint32 unspecialized, const MVMOpInfo *no_inline_info) { if (tc->instance->spesh_inline_log) { char *c_name_i = MVM_string_utf8_encode_C_string(tc, target_sf->body.name); char *c_cuid_i = MVM_string_utf8_encode_C_string(tc, target_sf->body.cuuid); @@ -1966,7 +1966,7 @@ static void optimize_call(MVMThreadContext *tc, MVMSpeshGraph *g, MVMSpeshBB *bb if (spesh_cand >= 0) { /* Yes. Will we be able to inline? */ char *no_inline_reason = NULL; - MVMOpInfo *no_inline_info = NULL; + const MVMOpInfo *no_inline_info = NULL; MVMuint32 effective_size; MVMSpeshGraph *inline_graph = MVM_spesh_inline_try_get_graph(tc, g, target_sf, target_sf->body.spesh->body.spesh_candidates[spesh_cand], @@ -2052,7 +2052,7 @@ static void optimize_call(MVMThreadContext *tc, MVMSpeshGraph *g, MVMSpeshBB *bb * to us. If it's small, then we could produce one and inline it. */ else if (target_sf->body.bytecode_size < MVM_SPESH_MAX_INLINE_SIZE) { char *no_inline_reason = NULL; - MVMOpInfo *no_inline_info = NULL; + const MVMOpInfo *no_inline_info = NULL; MVMSpeshGraph *inline_graph = MVM_spesh_inline_try_get_graph_from_unspecialized( tc, g, target_sf, ins, arg_info, stable_type_tuple, &no_inline_reason, &no_inline_info); log_inline(tc, g, target_sf, inline_graph, target_sf->body.bytecode_size,