[PATCH] D101855: [lld-macho] Check simulator platforms to avoid issuing false positive errors.

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 5 14:52:26 PDT 2021


int3 added inline comments.


================
Comment at: lld/MachO/InputFiles.cpp:162-163
+  if (config->platform() != platformInfo->target.Platform &&
+      !checkSimulatedPlatform(config->platform(),
+                              platformInfo->target.Platform)) {
     error(toString(input) + " has platform " +
----------------
int3 wrote:
> how about having a function that just canonicalizes the platform name, removing the simulator part? i.e. something like
> 
> `removeSimulator(config->platform()) != removeSimulator(platformInfo->target.Platform)`
> 
> pros: the map will only need half the entries, plus it's a bit more symmetric
> 
> either is fine though
another advantage of `removeSimulator()` is that we can have just one check here, i.e. no need for a separate `config->platform() != platformInfo->target.Platform`

With that in mind I think it's significantly nicer actually... could we do that? :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101855



More information about the llvm-commits mailing list