Skip to content

Commit

Permalink
Merge pull request JuliaLang#7093 from carnaval/master
Browse files Browse the repository at this point in the history
jl_is_leaf_type static eval take 2
  • Loading branch information
JeffBezanson committed Jun 3, 2014
2 parents 86c7783 + 9a84b02 commit 0462f5c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/ccall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,13 +755,11 @@ static Value *emit_ccall(jl_value_t **args, size_t nargs, jl_codectx_t *ctx)
if (fptr == &jl_is_leaf_type ||
(f_lib==NULL && f_name && !strcmp(f_name, "jl_is_leaf_type"))) {
jl_value_t *arg = args[4];
if (jl_is_expr(arg) || jl_is_symbol(arg)) {
jl_value_t* ty = expr_type(arg, ctx);
if (jl_is_type_type(ty) && !jl_is_typevar(jl_tparam0(ty))) {
int isleaf = jl_is_leaf_type(jl_tparam0(ty));
JL_GC_POP();
return ConstantInt::get(T_int32, isleaf);
}
jl_value_t* ty = expr_type(arg, ctx);
if (jl_is_type_type(ty) && !jl_is_typevar(jl_tparam0(ty))) {
int isleaf = jl_is_leaf_type(jl_tparam0(ty));
JL_GC_POP();
return ConstantInt::get(T_int32, isleaf);
}
}

Expand Down

0 comments on commit 0462f5c

Please sign in to comment.