-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2219,8 +2219,12 @@ static Value *emit_call(jl_value_t **args, size_t arglen, jl_codectx_t *ctx, | |
if (theFptr == NULL) { | ||
specialized = false; | ||
Value *theFunc = emit_expr(args[0], ctx); | ||
This comment has been minimized.
Sorry, something went wrong. |
||
if (theFunc->getType() != jl_pvalue_llvmt || jl_is_tuple(hdtype)) { | ||
// we know it's not a function | ||
if ((hdtype!=(jl_value_t*)jl_function_type && | ||
hdtype!=(jl_value_t*)jl_datatype_type && | ||
!(jl_is_type_type(hdtype) && | ||
jl_is_datatype(jl_tparam0(hdtype)))) || | ||
jl_is_tuple(hdtype) || theFunc->getType() != jl_pvalue_llvmt) { | ||
// it may not be a function, use call(f, ...) instead | ||
This comment has been minimized.
Sorry, something went wrong.
vtjnash
Member
|
||
headIsGlobal = true; | ||
Value *result = emit_known_call((jl_value_t*)jl_call_func, | ||
--args, ++nargs, ctx, | ||
|
@@ -2234,12 +2238,6 @@ static Value *emit_call(jl_value_t **args, size_t arglen, jl_codectx_t *ctx, | |
make_gcroot(boxed(theFunc,ctx), ctx); | ||
} | ||
#endif | ||
if (hdtype!=(jl_value_t*)jl_function_type && | ||
hdtype!=(jl_value_t*)jl_datatype_type && | ||
!(jl_is_type_type(hdtype) && | ||
jl_is_datatype(jl_tparam0(hdtype)))) { | ||
emit_func_check(theFunc, ctx); | ||
} | ||
// extract pieces of the function object | ||
// TODO: try extractvalue instead | ||
theFptr = builder.CreateBitCast(emit_nthptr(theFunc, 1, tbaa_func), jl_fptr_llvmt); | ||
|
3 comments
on commit 762a727
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what is going on here. After this patch, make clean && make
gives
int.jl
error during bootstrap: LoadError(at "sysimg.jl" line 42: LoadError(at "int.jl" line 280: UndefVarError(var=:start)))
@JeffBezanson or @vtjnash, any tips would be welcome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The --args, ++nargs seems suspicious, but I can't fully review that from a phone
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest of the code only accesses args[1] or later, so this just shifts the pointer to make args[0] the first argument.
Also, that part of the code seems to be working...it was used in the previous commit to implement call overloading, and worked fine until this patch.
This
theFunc = emit_expr(...)
can probably be moved into theelse
clause, since presumablytheFunc->getType() != jl_pvalue_llvmt
will always be false ifhdtype==(jl_value_t*)jl_function_type
?