Skip to content

Commit f94ea17

Browse files
committed
Fomatting
1 parent 6a221c2 commit f94ea17

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

src/copyable_task.jl

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ See also: [`Libtask.consume`](@ref)
2626
end
2727

2828
function callable_ret_type(sig)
29-
return Union{Base.code_ircode_by_type(sig)[1][2], ProducedValue}
29+
return Union{Base.code_ircode_by_type(sig)[1][2],ProducedValue}
3030
end
3131

3232
function build_callable(sig::Type{<:Tuple})
@@ -257,8 +257,6 @@ function stmt_might_produce(x)::Bool
257257
# return false
258258
end
259259

260-
get_function(x::Expr) = x.
261-
262260
"""
263261
produce_value(x::Expr)
264262
@@ -376,7 +374,7 @@ function derive_copyable_task_ir(ir::BBCode)::Tuple{BBCode,Tuple}
376374
# 1. Associate an ID to each split in each block, ensuring that the ID for the final
377375
# split of each block is the same ID as that of the original block.
378376
all_split_ids = map(zip(ir.blocks, all_splits)) do (block, splits)
379-
return vcat([ID() for _ in splits[1:end-1]], block.id)
377+
return vcat([ID() for _ in splits[1:(end - 1)]], block.id)
380378
end
381379

382380
# 2. Construct a map between the ID of each block and the ID associated to its split.
@@ -485,7 +483,10 @@ function derive_copyable_task_ir(ir::BBCode)::Tuple{BBCode,Tuple}
485483
deref_ids = map(phi_inds) do n
486484
id = bb.inst_ids[n]
487485
phi_id = phi_ids[n]
488-
push!(inst_pairs, (id, new_inst(Expr(:call, deref_phi, refs_id, phi_id))))
486+
push!(
487+
inst_pairs,
488+
(id, new_inst(Expr(:call, deref_phi, refs_id, phi_id))),
489+
)
489490
return id
490491
end
491492

@@ -502,8 +503,8 @@ function derive_copyable_task_ir(ir::BBCode)::Tuple{BBCode,Tuple}
502503
# Iterate every statement in the split other than the final one, replacing uses
503504
# of SSAs with de-referenced `Ref`s, and writing the results of statements to
504505
# the corresponding `Ref`s.
505-
_ids = view(bb.inst_ids, split.start:(split.last - 1))
506-
_insts = view(bb.insts, split.start:(split.last - 1))
506+
_ids = view(bb.inst_ids, (split.start):(split.last - 1))
507+
_insts = view(bb.insts, (split.start):(split.last - 1))
507508
for (id, inst) in zip(_ids, _insts)
508509
stmt = inst.stmt
509510
if Meta.isexpr(stmt, :invoke) ||
@@ -515,17 +516,17 @@ function derive_copyable_task_ir(ir::BBCode)::Tuple{BBCode,Tuple}
515516
# in the `Ref`s that they are associated to.
516517
for (n, arg) in enumerate(stmt.args)
517518
arg isa ID || continue
518-
519+
519520
new_id = ID()
520521
ref_ind = ssa_id_to_ref_index_map[arg]
521522
expr = Expr(:call, get_ref_at, refs_id, ref_ind)
522523
push!(inst_pairs, (new_id, new_inst(expr)))
523524
stmt.args[n] = new_id
524525
end
525-
526+
526527
# Push the target instruction to the list.
527528
push!(inst_pairs, (id, inst))
528-
529+
529530
# If we know it is not possible for this statement to contain any calls
530531
# to produce, then simply write out the result to its `Ref`.
531532
out_ind = ssa_id_to_ref_index_map[id]

src/test_utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function test_cases()
7070
Testcase("dynamic scope 2", 6, (dynamic_scope_tester_1,), [6]),
7171

7272
# Failing tests
73-
Testcase("nested", nothing, (nested_outer, ), [true, false]),
73+
Testcase("nested", nothing, (nested_outer,), [true, false]),
7474
]
7575
end
7676

0 commit comments

Comments
 (0)