aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineOperand.cpp
diff options
context:
space:
mode:
authorJez Ng <jezng@fb.com>2021-06-13 19:43:34 -0400
committerJez Ng <jezng@fb.com>2021-06-13 19:51:30 -0400
commitb2a0739012163f5433c0f069e842ee4cea3100f7 (patch)
tree1a4deec5c21d07d3b48753d9606db7d6f5dc1a81 /llvm/lib/CodeGen/MachineOperand.cpp
parentf09e200b31f443d972f6723fb9d78638bb38b45c (diff)
downloadllvm-b2a0739012163f5433c0f069e842ee4cea3100f7.zip
llvm-b2a0739012163f5433c0f069e842ee4cea3100f7.tar.gz
llvm-b2a0739012163f5433c0f069e842ee4cea3100f7.tar.bz2
[lld-macho][nfc] Remove InputSection::outSecFileOff
`outSecFileOff` and the associated `getFileOffset()` accessors were unnecessary. For all the cases we care about, `outSecFileOff` is the same as `outSecOff`. The only time they deviate is if there are zerofill sections within a given segment. But since zerofill sections are always at the end of a segment, the only sections where the two values deviate are zerofill sections themselves. And we never actually query the outSecFileOff of zerofill sections. As for `getFileOffset()`, the only place it was being used was to calculate the offset of the entry symbol. However, we can compute that value by just taking the difference between the address of the entry symbol and the address of the Mach-O header. In fact, this appears to be what ld64 itself does. This difference is the same as the file offset as long as there are no intervening zerofill sections, but since `__text` is the first section in `__TEXT`, this never happens, so our previous use of `getFileOffset()` was not wrong -- just inefficient. Reviewed By: #lld-macho, thakis Differential Revision: https://reviews.llvm.org/D104177
Diffstat (limited to 'llvm/lib/CodeGen/MachineOperand.cpp')
0 files changed, 0 insertions, 0 deletions