[PATCH] D40962: [ELF] When a relocation is out of range print the value and the range

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 11 09:47:42 PST 2017


ruiu added inline comments.


================
Comment at: ELF/Target.h:171
+    // message instead of an extremely large unsigned number
+    reportRangeError(Loc, Type, (int64_t)V < 0 ? Twine((int64_t)V) : Twine(V),
+                     llvm::minIntN(N), llvm::maxUIntN(N));
----------------
arichardson wrote:
> ruiu wrote:
> > Why don't you just pass Twine((int64_t)V)?
> Since we only call this with values <= INT64_MAX that is much better, thanks.
But why INT64_MAX? It seems just inconsistent. If you sign-extend, you want to always do that, no?


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D40962





More information about the llvm-commits mailing list