Return true if C is a constant offset from a global.
Declared in <llvm/Analysis/ConstantFolding.h>
bool
IsConstantOffsetFromGlobal(
Constant* C,
GlobalValue*& GV,
APInt& Offset,
DataLayout const& DL,
DSOLocalEquivalent** DSOEquiv = nullptr);
Because of constantexprs, this function is recursive. If the global is part of a dso_local_equivalent constant, return it through DSOEquiv if it is provided.
True if C is a constant offset from a global.
| Name | Description |
|---|---|
| C | Constant to inspect for a global-plus-offset form. |
| GV | Set to the base global value on success. |
| Offset | Set to the constant byte offset from GV on success. |
| DL | Data layout used for type sizes and pointer widths. |
| DSOEquiv | Optional out-parameter for a dso_local_equivalent wrapper. |