[PATCH] D140412: [DebugInfo] Unify location selection logic for values in InstrRefBasedImpl

Stephen Tozer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 20 09:47:53 PST 2022


StephenTozer added a comment.

In D140412#4008377 <https://reviews.llvm.org/D140412#4008377>, @jmorse wrote:

> Slightly twitchy about there being a zero LocIdx -- I think I tried to suppress there being any default-constructed LocIdxes out there. On the other hand, it comes with a sentinel value attached, so it's no big deal.

In this case the reasoning was that `LocIdx` is 32 bits that only uses 24 for the location, so the sentinel value can be `UINT_MAX`; since `LocationAndQuality` uses just 24 bits for the location, I figured there wasn't //any// good value that could be assigned to the location bits, while the quality bits already tell us whether the location bits mean anything or not.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140412



More information about the llvm-commits mailing list