[PATCH] D74985: [LiveDebugValues] Encode a location in VarLoc IDs, NFC [2/3]

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 24 13:43:34 PST 2020


probinson added inline comments.


================
Comment at: llvm/lib/CodeGen/LiveDebugValues.cpp:133
+  uint64_t getAsRawInteger() const {
+    return (static_cast<uint64_t>(Location) << 32) | Index;
+  }
----------------
aprantl wrote:
> Out of curiosity: This data structure looks like a hand-written implementation of `union { uint64_t ; struct {int32_t; int32_t}}` are there some UB-related problems with doing just that?
(Drive-by comment) There are definitely endian-ness problems with a simple union.


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

https://reviews.llvm.org/D74985





More information about the llvm-commits mailing list