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

Method exprGetElementPtr

cmd/ll2go/constant.go:337–351  ·  view source on GitHub ↗

exprGetElementPtr converts the given LLVM IR getelementptr expression to a corresponding Go statement.

(expr *constant.ExprGetElementPtr)

Source from the content-addressed store, hash-verified

335// exprGetElementPtr converts the given LLVM IR getelementptr expression to a
336// corresponding Go statement.
337func (d *decompiler) exprGetElementPtr(expr *constant.ExprGetElementPtr) ast.Expr {
338 src := d.constant(expr.Src)
339 // TODO: Validate if index expressions should be added in reverse order.
340 for _, index := range expr.Indices {
341 src = &ast.IndexExpr{
342 X: src,
343 Index: d.constant(index),
344 }
345 }
346 e := &ast.UnaryExpr{
347 Op: token.AND,
348 X: src,
349 }
350 return e
351}
352
353// exprTrunc converts the given LLVM IR trunc expression to a corresponding Go
354// statement.

Callers 1

exprMethod · 0.95

Calls 1

constantMethod · 0.95

Tested by

no test coverage detected