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

Method constArray

cmd/ll2go/constant.go:84–96  ·  view source on GitHub ↗

constArray converts the given LLVM IR array constant to a corresponding Go expression.

(c *constant.Array)

Source from the content-addressed store, hash-verified

82// constArray converts the given LLVM IR array constant to a corresponding Go
83// expression.
84func (d *decompiler) constArray(c *constant.Array) ast.Expr {
85 if c.CharArray {
86 return d.constCharArray(c)
87 }
88 var elems []ast.Expr
89 for _, e := range c.Elems {
90 elems = append(elems, d.constant(e))
91 }
92 return &ast.CompositeLit{
93 Type: d.goType(c.Typ),
94 Elts: elems,
95 }
96}
97
98// constCharArray converts the given LLVM IR character array constant to a
99// corresponding Go expression.

Callers 1

constantMethod · 0.95

Calls 3

constCharArrayMethod · 0.95
constantMethod · 0.95
goTypeMethod · 0.95

Tested by

no test coverage detected