[llvm-lipo] Pass ArrayRef by value.
authorAlexander Shaposhnikov <shal1t712@gmail.com>
Sat, 12 Oct 2019 06:14:02 +0000 (06:14 +0000)
committerAlexander Shaposhnikov <shal1t712@gmail.com>
Sat, 12 Oct 2019 06:14:02 +0000 (06:14 +0000)
Pass ArrayRef by value, fix formatting. NFC.

Test plan: make check-all

llvm-svn: 374637

llvm/tools/llvm-lipo/llvm-lipo.cpp

index e746db4..ba413b1 100644 (file)
@@ -441,10 +441,10 @@ readInputBinaries(ArrayRef<InputFile> InputFiles) {
     if (IF.ArchType && (B->isMachO() || B->isArchive())) {
       const auto S = B->isMachO() ? Slice(cast<MachOObjectFile>(B))
                                   : Slice(cast<Archive>(B));
-      const auto SpecifiedCPUType =
-          MachO::getCPUTypeFromArchitecture(
-              MachO::mapToArchitecture(Triple(*IF.ArchType)))
-              .first;
+      const auto SpecifiedCPUType = MachO::getCPUTypeFromArchitecture(
+                                        MachO::getArchitectureFromName(
+                                            Triple(*IF.ArchType).getArchName()))
+                                        .first;
       // For compatibility with cctools' lipo the comparison is relaxed just to
       // checking cputypes.
       if (S.getCPUType() != SpecifiedCPUType)
@@ -583,7 +583,7 @@ static void extractSlice(ArrayRef<OwningBinary<Binary>> InputBinaries,
   exit(EXIT_SUCCESS);
 }
 
-static void checkArchDuplicates(const ArrayRef<Slice> &Slices) {
+static void checkArchDuplicates(ArrayRef<Slice> Slices) {
   DenseMap<uint64_t, const Binary *> CPUIds;
   for (const auto &S : Slices) {
     auto Entry = CPUIds.try_emplace(S.getCPUID(), S.getBinary());