Just mutatis mutandis for the Foundation changes. The current NSIndexSet test fails on Sonoma w/o this patch and exercise the different forms, so no new tests are required.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lldb/source/Plugins/Language/ObjC/Cocoa.cpp | ||
---|---|---|
294 | Do we want to overwrite the count read previously ? |
lldb/source/Plugins/Language/ObjC/Cocoa.cpp | ||
---|---|---|
278 | I'm pretty sure __builtin_popcount and friends are GNU extensions not supported by MSVC. You'll probably need to abstract this out with C preprocessor macro guards. Alternatively, I think llvm has its own popcount implementation with llvm::popcount in include/llvm/ADT/bit.h. |
lldb/source/Plugins/Language/ObjC/Cocoa.cpp | ||
---|---|---|
278 | Good catch. The llvm one is just a wrapper for the builtin when available and a by-hand version otherwise, so might as well use that one. | |
294 | This code was originally written by Sean, who loved to write any code with complex logic in the form: do { /// Complex Logic here } while (0); so that he could exit the whole construct with a "break". After we get the bit mask value from the tagged pointer we break which sends us immediately to line 343. So that setting and this one are on non-intersecting code paths. |
It would be nice if we could clean up what mode is. There's a lot of bit-wise operations and setting it to 1 and 2 and it's not clear what each one might mean in each case... Some kind of enum or semantic meaning for each number would be nice. Either way, I think I'm on board with the logic in general. Just one question though.
lldb/source/Plugins/Language/ObjC/Cocoa.cpp | ||
---|---|---|
303 | This clobbers the previously set count on line 294. What of that count? |
lldb/source/Plugins/Language/ObjC/Cocoa.cpp | ||
---|---|---|
303 | Oh, that's me saying it was bad to use a variable called count when it should be bitfield, adding the new one and then forgetting to delete the count version. |
I'm pretty sure __builtin_popcount and friends are GNU extensions not supported by MSVC. You'll probably need to abstract this out with C preprocessor macro guards.
Alternatively, I think llvm has its own popcount implementation with llvm::popcount in include/llvm/ADT/bit.h.