git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314574
91177308-0d34-0410-b5e6-
96231b3b80d8
static bool filterArch(ObjectFile &Obj) {
if (ArchFilters.empty())
return true;
+
if (auto *MachO = dyn_cast<MachOObjectFile>(&Obj)) {
std::string ObjArch =
Triple::getArchTypeName(MachO->getArchTriple().getArch());
+
for (auto Arch : ArchFilters) {
+ // Match name.
if (Arch == ObjArch)
return true;
+
+ // Match architecture number.
unsigned Value;
if (!StringRef(Arch).getAsInteger(0, Value))
if (Value == getCPUType(*MachO))