[PATCH] D79668: [lld-macho] Support -order_file

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 18 15:12:23 PDT 2020


smeenai accepted this revision.
smeenai added a comment.
This revision is now accepted and ready to land.

Thanks for changing the parsing! LGTM with the comments addressed.



================
Comment at: lld/MachO/Driver.cpp:131
 
+static std::vector<StringRef> archNames{"arm",    "arm64", "i386",
+                                        "x86_64", "ppc",   "ppc64"};
----------------
I *think* this'll end up creating a global constructor, which is unfortunate. Would a `std::array` suffice, either globally or as a function `static`? I think it'd let us avoid that. Or even an `llvm::ArrayRef`, perhaps? (Haven't thought about that too much.)

Also, I'm assuming the DenseSet can't just be directly constructed with the names :(


================
Comment at: lld/MachO/Driver.cpp:182
+    case 2:
+      objectFile = fields[0];
+      symbol = fields[1];
----------------
This could either be the object file or the architecture. We'll need some additional checking here (I think assuming it's an architecture if it doesn't end with `.o` will just do the right thing, cos then the later check will bail out).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79668





More information about the llvm-commits mailing list