In theory, we should let the PPC target to determine how to lower the TOC Entry for globals. And the PPCTargetLowering require this query to do some optimization for TOC_Entry. I will commit another patch to do that.
|4901 ↗||(On Diff #175380)|
In this case we don't keep the address of the global in the .toc/.got so the comment is misleading, maybe something more like:
// Build the address relative to the TOC-pointer.
|13730 ↗||(On Diff #175380)|
I believe Non-Lazy-Pointer is strictly a mac-os construct (not sure exactly what it is). I think the comment here would be less confusing if it simply mentions that the NLP flag indicates that a global access has to use an extra indirection.
|793 ↗||(On Diff #175380)|
I would prefer to keep consistent with the V2 abi naming and call this 'GotIndirect' instead of TOCIndirect, but don't feel super strongly about it.