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

split SourceInfo out of LambdaInfo #18413

Merged
merged 9 commits into from
Sep 14, 2016
Prev Previous commit
Next Next commit
be more aggressive at type-inferring cfunction than is generally a go…
…od idea

this is required by the threadcall function
vtjnash committed Sep 13, 2016
commit 2bc2a103486789fd0534a43d6b6a40005d45e2d4
14 changes: 10 additions & 4 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
@@ -3532,11 +3532,17 @@ static Function *gen_cfun_wrapper(jl_function_t *ff, jl_value_t *jlrettype, jl_t
// infer it first, if necessary
if (lam) {
name = jl_symbol_name(lam->def->name);
jl_llvm_functions_t decls = jl_compile_linfo(lam, NULL);
if (decls.functionObject == NULL || lam->jlcall_api != 1) {
lam = NULL; // TODO: use emit_invoke framework to dispatch these
jl_source_info_t *src = NULL;
if (!lam->inferred) // TODO: this isn't ideal to be unconditionally calling type inference from here
src = jl_type_infer(lam, 0);
jl_compile_linfo(lam, src);
if (lam->jlcall_api != 2) {
if (lam->functionObjectsDecls.functionObject == NULL ||
jl_jlcall_api(lam->functionObjectsDecls.functionObject) != 1) {
lam = NULL; // TODO: use emit_invoke framework to dispatch these
}
}
else {
if (lam) {
astrt = lam->rettype;
if (astrt != (jl_value_t*)jl_bottom_type &&
jl_type_intersection(astrt, declrt) == jl_bottom_type) {