File: ssair.jl

package info (click to toggle)
julia 1.0.3%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 49,452 kB
  • sloc: lisp: 236,453; ansic: 55,579; cpp: 25,603; makefile: 1,685; pascal: 1,130; sh: 956; asm: 86; xml: 76
file content (33 lines) | stat: -rw-r--r-- 713 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# This file is a part of Julia. License is MIT: https://julialang.org/license

using Core.IR
const Compiler = Core.Compiler

let code = Any[
    Expr(:gotoifnot, SlotNumber(2), 4),
    Expr(:(=), SlotNumber(3), 2),
    # Test a SlotNumber as a value of a PhiNode
    PhiNode(Any[2,3], Any[1, SlotNumber(3)]),
    Expr(:return, SSAValue(3))
]

    ci = eval(Expr(:new, CodeInfo,
        code,
        nothing,
        Any[Any, Any, Any],
        Any[Any],
        UInt8[0, 0, 0],
        Any[Symbol("Self"), :arg, :slot],
        false, false, false, false
    ))

    Compiler.run_passes(ci, 1, Compiler.LineInfoNode[Compiler.NullLineInfo])
end

# test >:
let

f(a,b) = a >: b
code_typed(f, Tuple{Any, Any})

end