[PATCH] D99409: [clang] Speedup line offset mapping computation

serge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 7 09:48:42 PDT 2021


serge-sans-paille added inline comments.


================
Comment at: clang/lib/Basic/SourceManager.cpp:1262
+                                           unsigned char n) {
+  return ((x - ~0UL / 255 * (n + 1)) & ~x &
+          (x & ~0UL / 255 * 127) + ~0UL / 255 * (127 - (m - 1))) &
----------------
thakis wrote:
> UL is 32-bit on windows but 64-bit on linux/mac in 64-bit builds (LP64 vs LLP64). Maybe you want 0ULL here?
> 
> If so, then you should be able to repro this on linux by building a 32-bit clang binary there.
That + some endianess issue on ppc64be, resubmit coming soon once I validate locally :-)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99409/new/

https://reviews.llvm.org/D99409



More information about the cfe-commits mailing list