exprGetElementPtr converts the given LLVM IR getelementptr expression to a corresponding Go statement.
(expr *constant.ExprGetElementPtr)
| 335 | // exprGetElementPtr converts the given LLVM IR getelementptr expression to a |
| 336 | // corresponding Go statement. |
| 337 | func (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. |