[all-commits] [llvm/llvm-project] d64a22: [LiveDebugValues] Prevent some misuse of LocIndex:...

Vedant Kumar via All-commits all-commits at lists.llvm.org
Mon Mar 2 16:59:15 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d64a22a2add97ff1ae28acb18c9f6ea76a26ecf3
      https://github.com/llvm/llvm-project/commit/d64a22a2add97ff1ae28acb18c9f6ea76a26ecf3
  Author: Vedant Kumar <vsk at apple.com>
  Date:   2020-03-02 (Mon, 02 Mar 2020)

  Changed paths:
    M llvm/lib/CodeGen/LiveDebugValues.cpp

  Log Message:
  -----------
  [LiveDebugValues] Prevent some misuse of LocIndex::fromRawInteger, NFC

Make it a compile-time error to pass an int/unsigned/etc to
fromRawInteger.

Hopefully this prevents errors of the form:

```
for (unsigned ID : getVarLocs()) {
  auto VL = LocMap[LocIndex::fromRawInteger(ID)];
  ...
```




More information about the All-commits mailing list