Skip to content

Commit

Permalink
restrict analyzer report_pass types a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed May 12, 2023
1 parent 7130008 commit 2636533
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/analyzers/jetanalyzer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ struct JETAnalyzer{RP<:ReportPass} <: AbstractAnalyzer
report_pass::RP
method_table::CachedMethodTable{OverlayMethodTable}

function JETAnalyzer(state::AnalyzerState, analysis_cache::AnalysisCache, report_pass::RP) where RP
function JETAnalyzer(state::AnalyzerState, analysis_cache::AnalysisCache, report_pass::RP) where RP<:ReportPass
method_table = CachedMethodTable(OverlayMethodTable(state.world, JET_METHOD_TABLE))
return new{RP}(state, analysis_cache, report_pass, method_table)
end
function JETAnalyzer(state::AnalyzerState, report_pass::RP) where RP
function JETAnalyzer(state::AnalyzerState, report_pass::RP) where RP<:ReportPass
if (@ccall jl_generating_output()::Cint) != 0
# XXX Avoid storing analysis results into a cache that persists across the
# precompilation, as pkgimage currently doesn't support serializing
Expand Down
6 changes: 3 additions & 3 deletions src/analyzers/optanalyzer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ that are specific to the optimization analysis.
---
"""
struct OptAnalyzer{RP,FF} <: AbstractAnalyzer
struct OptAnalyzer{RP<:ReportPass,FF} <: AbstractAnalyzer
state::AnalyzerState
analysis_cache::AnalysisCache
report_pass::RP
Expand All @@ -176,7 +176,7 @@ struct OptAnalyzer{RP,FF} <: AbstractAnalyzer
report_pass::RP,
function_filter::FF,
skip_noncompileable_calls::Bool,
skip_unoptimized_throw_blocks::Bool) where {RP,FF}
skip_unoptimized_throw_blocks::Bool) where {RP<:ReportPass,FF}
if (@ccall jl_generating_output()::Cint) != 0
# XXX Avoid storing analysis results into a cache that persists across the
# precompilation, as pkgimage currently doesn't support serializing
Expand Down Expand Up @@ -353,7 +353,7 @@ end

# the entry constructor
function OptAnalyzer(world::UInt = Base.get_world_counter();
report_pass = OptAnalysisPass(),
report_pass::ReportPass = OptAnalysisPass(),
function_filter = optanalyzer_function_filter,
skip_noncompileable_calls::Bool = true,
skip_unoptimized_throw_blocks::Bool = true,
Expand Down

0 comments on commit 2636533

Please sign in to comment.