mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
0e63c46930
After a replacement, check if the replaced value feeds into an IndirectionOp. If the "rich" pre-bitcast value has a ptr<ptr<T>> type, create a new typed IndirectionOp and insert a fixup bitcast for existing non-lvalue uses. Lvalue uses (assign LHS) stay on the old indirection to preserve type and lvalue constraints. Returns true if propagation occurred, signaling the EFA driver to rerun and discover new rewriting opportunities.
17 lines
641 B
C
17 lines
641 B
C
#pragma once
|
|
|
|
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
#include "BestTraversal.h"
|
|
#include "PointerArithmetic.h"
|
|
|
|
/// Perform the replacement of the pointer arithmetic access
|
|
/// (`PointerToReplace`), with operations equivalent to the `BestTraversal`.
|
|
/// Returns `true` if a type was propagated through an `indirection`, signaling
|
|
/// that a subsequent EFA pass may find new rewriting opportunities.
|
|
bool replaceFieldAccess(mlir::clift::ExpressionOpInterface PointerToReplace,
|
|
const PointerArithmetic &Arithmetic,
|
|
const Traversal &BestTraversal);
|