[PATCH] D105080: [lld-macho] Only enable `__DATA_CONST` for newer platforms

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 2 19:15:13 PDT 2021


thakis added inline comments.


================
Comment at: lld/MachO/Driver.cpp:852
+      {PlatformKind::watchOSSimulator, VersionTuple(6, 0)},
+      {PlatformKind::bridgeOS, VersionTuple(4, 0)}};
+  auto it = minVersion.find(config->platformInfo.target.Platform);
----------------
(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" :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105080/new/

https://reviews.llvm.org/D105080



More information about the llvm-commits mailing list