Skip to content

Commit

Permalink
Fix Cthulhu extension (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy authored Jul 23, 2024
1 parent 50f38e6 commit 34b419c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ext/CthulhuExt.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module CthulhuExt
import Cthulhu
using Core: MethodInstance
using SnoopCompile: InstanceNode, TriggerNode, Suggested, InferenceTrigger, countchildren
using SnoopCompile: InstanceNode, TriggerNode, Suggested, InferenceTrigger, countchildren, callingframe, callerinstance


# Originally from invalidations.jl
Expand All @@ -12,13 +12,13 @@ module CthulhuExt

# Originally from parcel_snoop_inference.jl

Cthulhu.descend(itrig::InferenceTrigger; kwargs...) = descend(callerinstance(itrig); kwargs...)
Cthulhu.descend(itrig::InferenceTrigger; kwargs...) = Cthulhu.descend(callerinstance(itrig); kwargs...)
Cthulhu.instance(itrig::InferenceTrigger) = MethodInstance(itrig.node)
Cthulhu.method(itrig::InferenceTrigger) = Method(itrig.node)
Cthulhu.specTypes(itrig::InferenceTrigger) = Cthulhu.specTypes(Cthulhu.instance(itrig))
Cthulhu.backedges(itrig::InferenceTrigger) = (itrig.callerframes,)
Cthulhu.nextnode(itrig::InferenceTrigger, edge) = (ret = callingframe(itrig); return isempty(ret.callerframes) ? nothing : ret)

Cthulhu.ascend(node::TriggerNode) = ascend(node.itrig)
Cthulhu.ascend(s::Suggested) = ascend(s.itrig)
Cthulhu.ascend(node::TriggerNode) = Cthulhu.ascend(node.itrig)
Cthulhu.ascend(s::Suggested) = Cthulhu.ascend(s.itrig)
end

0 comments on commit 34b419c

Please sign in to comment.