Skip to content

Commit

Permalink
Merge pull request #18334 from JuliaLang/yyc/warnings
Browse files Browse the repository at this point in the history
Fix `jl_get_specialization` signature mismatch
  • Loading branch information
yuyichao authored Sep 3, 2016
2 parents 06c0ba6 + b7c25d1 commit 7126d89
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
12 changes: 5 additions & 7 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1036,8 +1036,6 @@ void jl_extern_c(jl_function_t *f, jl_value_t *rt, jl_value_t *argt, char *name)
// for use in reflection from Julia.
// this is paired with jl_dump_function_ir and jl_dump_function_asm in particular ways:
// misuse will leak memory or cause read-after-free
extern "C" JL_DLLEXPORT jl_lambda_info_t *jl_get_specialized(jl_method_t *m, jl_tupletype_t *types, jl_svec_t *sp);

extern "C" JL_DLLEXPORT
void *jl_get_llvmf_defn(jl_lambda_info_t *linfo, bool getwrapper)
{
Expand All @@ -1053,7 +1051,7 @@ void *jl_get_llvmf_defn(jl_lambda_info_t *linfo, bool getwrapper)
// first copy the linfo to avoid corrupting it and
// confusing the compiler about the
// validity of the code it already generated
temp = jl_get_specialized(linfo->def, linfo->specTypes, linfo->sparam_vals);
temp = jl_get_specialized(linfo->def, linfo->specTypes, linfo->sparam_vals, 1);
jl_type_infer(temp, 0);
if (temp->code == jl_nothing || temp->inInference) {
// something went wrong: abort!
Expand Down Expand Up @@ -1142,7 +1140,7 @@ void *jl_get_llvmf_decl(jl_lambda_info_t *linfo, bool getwrapper)
if (linfo->functionObjectsDecls.functionObject == NULL) {
jl_lambda_info_t *temp = NULL;
JL_GC_PUSH1(&temp);
temp = jl_get_specialized(linfo->def, linfo->specTypes, linfo->sparam_vals);
temp = jl_get_specialized(linfo->def, linfo->specTypes, linfo->sparam_vals, 1);
jl_type_infer(temp, 0);
temp->jlcall_api = 0;
temp->constval = jl_nothing;
Expand Down Expand Up @@ -4521,7 +4519,7 @@ static std::unique_ptr<Module> emit_function(jl_lambda_info_t *lam, jl_llvm_func
jl_expr_t *expr = jl_is_expr(stmt) ? (jl_expr_t*)stmt : nullptr;
#ifndef NDEBUG
if (jl_is_labelnode(stmt)) {
int lname = jl_labelnode_label(stmt);
size_t lname = jl_labelnode_label(stmt);
if (lname != i + 1) {
jl_safe_printf("Label number mismatch.\n");
jl_(stmts);
Expand Down Expand Up @@ -4652,7 +4650,7 @@ static std::unique_ptr<Module> emit_function(jl_lambda_info_t *lam, jl_llvm_func
// `seq_next` is the next statement we want to emit
// i.e. if it exists, it's the next one following control flow and
// should be emitted into the current insert point.
if (seq_next >= 0 && seq_next < stmtslen) {
if (seq_next >= 0 && (unsigned)seq_next < stmtslen) {
cursor = seq_next;
return;
}
Expand All @@ -4667,7 +4665,7 @@ static std::unique_ptr<Module> emit_function(jl_lambda_info_t *lam, jl_llvm_func
cursor = item.first;
workstack.pop_back();
};
auto add_to_list = [&] (int pos, BasicBlock *bb) {
auto add_to_list = [&] (unsigned pos, BasicBlock *bb) {
if (pos >= stmtslen)
return;
workstack.push_back({pos, bb});
Expand Down
2 changes: 0 additions & 2 deletions src/gf.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ static int8_t jl_cachearg_offset(jl_methtable_t *mt)

/// ----- Insertion logic for special entries ----- ///

JL_DLLEXPORT jl_lambda_info_t *jl_get_specialized(jl_method_t *m, jl_tupletype_t *types, jl_svec_t *sp, int allow_exec);

// get or create the LambdaInfo for a specialization
JL_DLLEXPORT jl_lambda_info_t *jl_specializations_get_linfo(jl_method_t *m, jl_tupletype_t *type, jl_svec_t *sparams)
{
Expand Down
1 change: 1 addition & 0 deletions src/julia_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ JL_DLLEXPORT jl_array_t *jl_idtable_rehash(jl_array_t *a, size_t newsz);
JL_DLLEXPORT jl_methtable_t *jl_new_method_table(jl_sym_t *name, jl_module_t *module);
jl_lambda_info_t *jl_get_specialization1(jl_tupletype_t *types);
JL_DLLEXPORT int jl_has_call_ambiguities(jl_tupletype_t *types, jl_method_t *m);
JL_DLLEXPORT jl_lambda_info_t *jl_get_specialized(jl_method_t *m, jl_tupletype_t *types, jl_svec_t *sp, int allow_exec);

uint32_t jl_module_next_counter(jl_module_t *m);
void jl_fptr_to_llvm(jl_fptr_t fptr, jl_lambda_info_t *lam, int specsig);
Expand Down

2 comments on commit 7126d89

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels

Please sign in to comment.