Emit code to compute a GEP's offset from its base pointer.
Declared in <llvm/Analysis/Utils/Local.h>
Value*
emitGEPOffset(
IRBuilderBase* Builder,
DataLayout const& DL,
User* GEP,
bool NoAssumptions = false);
Given a getelementptr instruction or constant expression, emits the code necessary to compute the offset from the base pointer (without adding in the base pointer). Returns the result as a signed integer of intptr size. When NoAssumptions is true, no assumptions about index computation not overflowing are made.
The offset as a signed integer of intptr size.
| Name | Description |
|---|---|
| Builder | IR builder used to emit the offset computation. |
| DL | Data layout used for pointer and type sizes. |
| GEP | GetElementPtr instruction or constant expression to measure. |
| NoAssumptions | If true, do not assume index computations do not overflow. |