Files
swift-mirror/lib/AST/AccessRequests.cpp
Evan Wilde b0e454f682 Fix broken access levels
I had an off-by-one in
`DefaultAndMaxAccessLevelRequest::getCachedResult`. The original code
added 1 to the last and first set bits when computing the `Max` and
`Default` access levels:

AccessLevel Max = static_cast<AccessLevel>(llvm::findLastSet(Bits) + 1);
AccessLevel Default = static_cast<AccessLevel>(llvm::findFirstSet(Bits) + 1);

LLVM got rid of `findLastSet`, so in the fun of figuring out the
replacements (llvm::countl_zero and llvm::countl_zero), I missed adding
the one to the result.
2023-07-27 11:40:15 -07:00

14 KiB