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

Method constStruct

cmd/ll2go/constant.go:118–127  ·  view source on GitHub ↗

constStruct converts the given LLVM IR struct constant to a corresponding Go expression.

(c *constant.Struct)

Source from the content-addressed store, hash-verified

116// constStruct converts the given LLVM IR struct constant to a corresponding Go
117// expression.
118func (d *decompiler) constStruct(c *constant.Struct) ast.Expr {
119 var fields []ast.Expr
120 for _, field := range c.Fields {
121 fields = append(fields, d.constant(field))
122 }
123 return &ast.CompositeLit{
124 Type: d.goType(c.Typ),
125 Elts: fields,
126 }
127}
128
129// constZeroInitializer converts the given LLVM IR zero initializer constant to
130// a corresponding Go expression.

Callers 1

constantMethod · 0.95

Calls 2

constantMethod · 0.95
goTypeMethod · 0.95

Tested by

no test coverage detected