Skip to content

Commit

Permalink
update SnoopCompile
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Sep 19, 2020
1 parent 9479706 commit b4cc0d9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
9 changes: 5 additions & 4 deletions scripts/generate_precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ try
open(precompile_file, "w") do io
println(io, "# This file is mostly generated by `scripts/generate_precompile.jl`\n")
if any(str->occursin("__lookup", str), stmts)
println(io, SnoopCompile.SnoopCompileAnalysis.lookup_kwbody_str)
println(io, SnoopCompile.lookup_kwbody_str)
end
println(io, "function _precompile_()")
println(io, " ccall(:jl_generating_output, Cint, ()) == 1 || return nothing")
for stmt in sort(stmts)
if startswith(stmt, "isdefined")
println(io, " try; $stmt; catch err; @debug err; end") # don't assert on this
println(io, " try; $(stmt); catch err; @debug err; end") # don't assert on this
else
println(io, " try; @assert $stmt; catch err; @debug err; end")
println(io, " try; @assert($(stmt)); catch err; @debug err; end")
end
end
println(io, "end")
Expand All @@ -77,7 +77,7 @@ try
end
end
end
@debug "Commented in `_precompile_` call in $junojl_file for `precompile` statement assertion"
@debug "Commented in `_precompile_` call in $atomjl_file for `precompile` statement assertion"

run(pipeline(`julia --project=. --color=yes -e '
ENV["JULIA_DEBUG"] = "Juno"
Expand Down Expand Up @@ -118,5 +118,6 @@ end
# -------------------

@info "Removing temporary dependencies ..."
Pkg.activate(normpath(@__DIR__, ".."))
test_deps === nothing || Pkg.rm([PackageSpec(; name = name, uuid = uuid) for (name, uuid) in test_deps])
Pkg.rm("SnoopCompile")
22 changes: 11 additions & 11 deletions src/precompile.jl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b4cc0d9

Please sign in to comment.