Skip to content

Commit

Permalink
Generate c signature when possible. Fix #11304
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyichao committed Oct 9, 2015
1 parent c842e86 commit 5bf0652
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4280,19 +4280,11 @@ static Function *emit_function(jl_lambda_info_t *lam)
Function *f = NULL;

bool specsig = false;
if (!va && !hasCapt && lam->specTypes != jl_anytuple_type && lam->inferred) {
// no captured vars and not vararg
// consider specialized signature
for(size_t i=0; i < jl_nparams(lam->specTypes); i++) {
if (isbits_spec(jl_tparam(lam->specTypes, i))) { // assumes !va
specsig = true;
break;
}
}
if (jl_nparams(lam->specTypes) == 0)
specsig = true;
if (isbits_spec(jlrettype))
specsig = true;
if (!va && !hasCapt && lam->specTypes != jl_anytuple_type &&
lam->inferred && jl_nparams(lam->specTypes) <= 64) {
// Specialize signature if there's no captured vars, not vararg
// and if the number of arguments is reasonable. #11304
specsig = true;
}

std::stringstream funcName;
Expand Down

0 comments on commit 5bf0652

Please sign in to comment.