JuliaCompilerPlugins / CodeInfoTools.jl
Showing 1 of 2 files from the diff.
Other files ignored by Codecov
test/misc.jl has changed.

@@ -570,8 +570,29 @@
Loading
570 570
##### Evaluation
571 571
#####
572 572
573 +
# Your scientists were so preoccupied with whether or not they could, they didn’t stop to think if they should.
574 +
function wipe(src::CodeInfo)
575 +
    b = Builder(src)
576 +
    for (v, st) in b
577 +
    end
578 +
    new = finish(b)
579 +
    if src.ssavaluetypes isa Vector
580 +
        new.ssavaluetypes = length(src.ssavaluetypes)
581 +
    end
582 +
    new.inferred = false
583 +
    new.parent = nothing
584 +
    if !(new.slottypes === nothing)
585 +
        new.slottypes = [Any for _ in new.slottypes]
586 +
    end
587 +
    new.slotflags = [0x0 for _ in new.slotflags]
588 +
    new.rettype = Any
589 +
    new.linetable = [Core.LineInfoNode(@__MODULE__, :λ, 
590 +
                    Symbol("Why have you done this?"), 0, 0)]
591 +
    return new
592 +
end
593 +
573 594
function lambda(m::Module, src::Core.CodeInfo)
574 -
    ci = copy(src)
595 +
    ci = wipe(copy(src))
575 596
    verify(ci)
576 597
    inds = findall(==(0x00), src.slotflags)
577 598
    @assert(inds !== nothing)
@@ -582,7 +603,7 @@
Loading
582 603
end
583 604
584 605
function lambda(m::Module, src::Core.CodeInfo, nargs::Int)
585 -
    ci = copy(src)
606 +
    ci = wipe(copy(src))
586 607
    verify(ci)
587 608
    @debug "Warning: using explicit `nargs` to construct the generated function. If this number does not match the correct number of arguments in the :slotflags field of `src::Core.CodeInfo`, this can lead to segfaults and other bad behavior."
588 609
    args = src.slotnames[2 : 1 + nargs]
Files Coverage
src/CodeInfoTools.jl 95.72%
Project Totals (1 files) 95.72%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading