[PATCH] D53408: [PPC64] Long branch thunks.
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 23 13:37:05 PDT 2018
MaskRay added inline comments.
================
Comment at: ELF/SyntheticSections.cpp:3060
+void LongBranchTargetSection::addEntry(Symbol &Sym) {
+ assert(Sym.LtIndex == -1U);
+ Sym.LtIndex = Entries.size();
----------------
sfertile wrote:
> MaskRay wrote:
> > LtIndex is `uint32_t` but -1U is undefined. Though they are usually the same type, `UINT32_C(-1)` or `(uint32_t)-1` may be better
> I initially changed this, but looking at it again I think -its interpreted as `-(1U)` which I believe is well defined. I'll see if I can verify that.
Yes, it is interpreted as -(1U) as there is no negative integer literal. It applies unary minus operator to 1U.
`(uint32_t)-1` LG.
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D53408
More information about the llvm-commits
mailing list