HomePhabricator

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

Authored by vsk on Mar 2 2020, 4:56 PM.

Description

[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)];
  ...

Details

Committed
vskMar 2 2020, 4:59 PM
Parents
rG29a4239d31c6: [Sema] Fix a crash when attaching comments to an implicit decl
Branches
Unknown
Tags
Unknown