Matches ld64.
Details
- Reviewers
gkm alexander-shaposhnikov - Group Reviewers
Restricted Project - Commits
- rGb41b4148e7b9: [lld-macho] Only enable `__DATA_CONST` for newer platforms
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lld/MachO/Driver.cpp | ||
---|---|---|
852 | (Please feel free to ignore!) PlatformKind is an enum with sequential numbers. The code as is at first execution creates a red-black tree with 8 entries, then walks it. A switch statement on the other hand should produce much smaller and simpler machine code, without being more verbose. I doubt it matters in practice, but it's a good opportunity for more "silicon sympathy" :) |
lld/MachO/Driver.cpp | ||
---|---|---|
852 | a switch statement would put every VersionTuple on a different line than the case, and would also require another line for the breaks, so it's considerably more verbose... good point about the sequential numbers though, a lookup array would probably be better here. |
(Please feel free to ignore!)
PlatformKind is an enum with sequential numbers.
The code as is at first execution creates a red-black tree with 8 entries, then walks it.
A switch statement on the other hand should produce much smaller and simpler machine code, without being more verbose.
I doubt it matters in practice, but it's a good opportunity for more "silicon sympathy" :)