MCPcopy Create free account
hub / github.com/decomp/decomp / inst

Method inst

cmd/ll2go/instruction.go:36–140  ·  view source on GitHub ↗

inst converts the given LLVM IR instruction to a corresponding Go statement.

(inst ir.Instruction)

Source from the content-addressed store, hash-verified

34
35// inst converts the given LLVM IR instruction to a corresponding Go statement.
36func (d *decompiler) inst(inst ir.Instruction) ast.Stmt {
37 switch inst := inst.(type) {
38 // Binary instructions
39 case *ir.InstAdd:
40 return d.instAdd(inst)
41 case *ir.InstFAdd:
42 return d.instFAdd(inst)
43 case *ir.InstSub:
44 return d.instSub(inst)
45 case *ir.InstFSub:
46 return d.instFSub(inst)
47 case *ir.InstMul:
48 return d.instMul(inst)
49 case *ir.InstFMul:
50 return d.instFMul(inst)
51 case *ir.InstUDiv:
52 return d.instUDiv(inst)
53 case *ir.InstSDiv:
54 return d.instSDiv(inst)
55 case *ir.InstFDiv:
56 return d.instFDiv(inst)
57 case *ir.InstURem:
58 return d.instURem(inst)
59 case *ir.InstSRem:
60 return d.instSRem(inst)
61 case *ir.InstFRem:
62 return d.instFRem(inst)
63 // Bitwise instructions
64 case *ir.InstShl:
65 return d.instShl(inst)
66 case *ir.InstLShr:
67 return d.instLShr(inst)
68 case *ir.InstAShr:
69 return d.instAShr(inst)
70 case *ir.InstAnd:
71 return d.instAnd(inst)
72 case *ir.InstOr:
73 return d.instOr(inst)
74 case *ir.InstXor:
75 return d.instXor(inst)
76 // Vector instructions
77 case *ir.InstExtractElement:
78 return d.instExtractElement(inst)
79 case *ir.InstInsertElement:
80 return d.instInsertElement(inst)
81 case *ir.InstShuffleVector:
82 return d.instShuffleVector(inst)
83 // Aggregate instructions
84 case *ir.InstExtractValue:
85 return d.instExtractValue(inst)
86 case *ir.InstInsertValue:
87 return d.instInsertValue(inst)
88 // Memory instructions
89 case *ir.InstAlloca:
90 return d.instAlloca(inst)
91 case *ir.InstLoad:
92 return d.instLoad(inst)
93 case *ir.InstStore:

Callers 1

instsMethod · 0.95

Calls 15

instAddMethod · 0.95
instFAddMethod · 0.95
instSubMethod · 0.95
instFSubMethod · 0.95
instMulMethod · 0.95
instFMulMethod · 0.95
instUDivMethod · 0.95
instSDivMethod · 0.95
instFDivMethod · 0.95
instURemMethod · 0.95
instSRemMethod · 0.95
instFRemMethod · 0.95

Tested by

no test coverage detected