[llvm] r374637 - [llvm-lipo] Pass ArrayRef by value.
Alexander Shaposhnikov via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 11 23:14:02 PDT 2019
Author: alexshap
Date: Fri Oct 11 23:14:02 2019
New Revision: 374637
URL: http://llvm.org/viewvc/llvm-project?rev=374637&view=rev
Log:
[llvm-lipo] Pass ArrayRef by value.
Pass ArrayRef by value, fix formatting. NFC.
Test plan: make check-all
Modified:
llvm/trunk/tools/llvm-lipo/llvm-lipo.cpp
Modified: llvm/trunk/tools/llvm-lipo/llvm-lipo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-lipo/llvm-lipo.cpp?rev=374637&r1=374636&r2=374637&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-lipo/llvm-lipo.cpp (original)
+++ llvm/trunk/tools/llvm-lipo/llvm-lipo.cpp Fri Oct 11 23:14:02 2019
@@ -441,10 +441,10 @@ readInputBinaries(ArrayRef<InputFile> In
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<Owning
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());
More information about the llvm-commits
mailing list