Skip to content

Commit

Permalink
More robust detection of user code
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Jan 3, 2015
1 parent b365c36 commit 0dcaba4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3734,7 +3734,7 @@ static Function *emit_function(jl_lambda_info_t *lam, bool cstyle)
ctx.f = f;

// step 5. set up debug info context and create first basic block
bool in_user_code = lam->module != jl_base_module && lam->module != jl_core_module;
bool in_user_code = !is_submodule(jl_base_module, lam->module);
bool do_coverage = jl_compileropts.code_coverage == JL_LOG_ALL || (jl_compileropts.code_coverage == JL_LOG_USER && in_user_code);
bool do_malloc_log = jl_compileropts.malloc_log == JL_LOG_ALL || (jl_compileropts.malloc_log == JL_LOG_USER && in_user_code);
jl_value_t *stmt = jl_cellref(stmts,0);
Expand Down
2 changes: 1 addition & 1 deletion src/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ static void jl_update_all_fptrs()
delayed_fptrs = NULL;
}

static int is_submodule(jl_module_t *parent, jl_module_t *child)
int is_submodule(jl_module_t *parent, jl_module_t *child)
{
while (1) {
if (parent == child)
Expand Down
1 change: 1 addition & 0 deletions src/julia.h
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,7 @@ STATIC_INLINE jl_function_t *jl_get_function(jl_module_t *m, const char *name)
}
DLLEXPORT void jl_module_run_initializer(jl_module_t *m);
jl_function_t *jl_module_call_func(jl_module_t *m);
int is_submodule(jl_module_t *parent, jl_module_t *child);

This comment has been minimized.

Copy link
@vtjnash

vtjnash Jan 4, 2015

Member

this should be DLLEXPORT if it is going in this file. otherwise, it should be in julia_internal.h

This comment has been minimized.

Copy link
@timholy

timholy Jan 4, 2015

Author Member

OK, thanks. See 3576665 for the latest. Any thought about which is more appropriate? Seems potentially useful to be able to ccall it, so I guess we should add the DLLEXPORT?


// eq hash tables
DLLEXPORT jl_array_t *jl_eqtable_put(jl_array_t *h, void *key, void *val);
Expand Down

0 comments on commit 0dcaba4

Please sign in to comment.