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

Method term

cmd/ll2go/terminator.go:12–27  ·  view source on GitHub ↗

term converts the given LLVM IR terminator to a corresponding Go statement.

(term ir.Terminator)

Source from the content-addressed store, hash-verified

10
11// term converts the given LLVM IR terminator to a corresponding Go statement.
12func (d *decompiler) term(term ir.Terminator) ast.Stmt {
13 switch term := term.(type) {
14 case *ir.TermRet:
15 return d.termRet(term)
16 case *ir.TermBr:
17 return d.termBr(term)
18 case *ir.TermCondBr:
19 return d.termCondBr(term)
20 case *ir.TermSwitch:
21 return d.termSwitch(term)
22 case *ir.TermUnreachable:
23 return d.termUnreachable(term)
24 default:
25 panic(fmt.Sprintf("support for terminator %T not yet implemented", term))
26 }
27}
28
29// termRet converts the given LLVM IR ret terminator to a corresponding Go
30// statement.

Callers 2

primIfReturnMethod · 0.95
funcDeclMethod · 0.95

Calls 5

termRetMethod · 0.95
termBrMethod · 0.95
termCondBrMethod · 0.95
termSwitchMethod · 0.95
termUnreachableMethod · 0.95

Tested by

no test coverage detected