This is an archive of the discontinued LLVM Phabricator instance.

[NFC] Rename isPointerOffset to getPointerOffsetFrom and move to Value.h
ClosedPublic

Authored by Orlando on Apr 19 2023, 3:16 AM.

Details

Summary

Linking LLVMCore failed when building D148536 with shared libs enabled (bot).

Make isPointerOffset a Value method and rename it to getPointerOffsetFrom.

Diff Detail

Event Timeline

Orlando created this revision.Apr 19 2023, 3:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2023, 3:16 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
Orlando requested review of this revision.Apr 19 2023, 3:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2023, 3:16 AM
jmorse accepted this revision.Apr 19 2023, 3:43 AM

LGTM -- it makes me twitch a little to move more code into the 'Core' library area, but there's already precedent for there being GEP-examining methods there (the offset-stripping methods for example). The overall argument seems alright: "We're performing this pointer-examination operation as part of debug-info updating now, because we're also tracking variables when they're on the stack, thus we need this method in the 'Core' library".

llvm/include/llvm/IR/Value.h
777
777–780

I feel this would be better placed next to the earlier methods to do with constant-offsets and bounds checking -- those are dedicated to GEPs and the like. (i.e., 30 lines up)

This revision is now accepted and ready to land.Apr 19 2023, 3:43 AM
Orlando marked 2 inline comments as done.Apr 19 2023, 4:03 AM

I agree with everything you said. Thanks for the review! I'll make those changes before landing.

This revision was landed with ongoing or failed builds.Apr 19 2023, 4:24 AM
This revision was automatically updated to reflect the committed changes.