Skip to content

Commit

Permalink
still optimize top-level expressions with loops and global decls
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Jul 25, 2018
1 parent df5a6b0 commit 4969bdc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/toplevel.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,12 @@ static void expr_attributes(jl_value_t *v, int *has_intrinsics, int *has_defs)
if (head == toplevel_sym || head == thunk_sym) {
return;
}
else if (head == global_sym || head == const_sym || head == copyast_sym) {
else if (head == global_sym) {
// this could be considered has_defs, but loops that assign to globals
// might still need to be optimized.
return;
}
else if (head == const_sym || head == copyast_sym) {
// Note: `copyast` is included here since it indicates the presence of
// `quote` and probably `eval`.
*has_defs = 1;
Expand Down

0 comments on commit 4969bdc

Please sign in to comment.