# RUN: FileCheck %s --check-prefix=DUPLICATE-INPUT -DFILEA=%basename_t.tmp-input1.o \
# RUN: -DPATHA=%t-input1.o -DFILEB=%basename_t.tmp-x86_64.bc -DPATHB=%t-x86_64.bc -DPATHCORRECT=%t.correct.ar
-# DUPLICATE-INPUT: warning: file '[[FILEA]]' was specified multiple times.
-# DUPLICATE-INPUT-DAG: [[PATHA]]
-# DUPLICATE-INPUT-DAG: [[PATHCORRECT]]
-# DUPLICATE-INPUT: file '[[FILEB]]' was specified multiple times.
+# DUPLICATE-INPUT: warning: file '[[FILEB]]' was specified multiple times.
# DUPLICATE-INPUT-DAG: [[PATHB]]
# DUPLICATE-INPUT-DAG: [[PATHCORRECT]]
+# DUPLICATE-INPUT: file '[[FILEA]]' was specified multiple times.
+# DUPLICATE-INPUT-DAG: [[PATHA]]
+# DUPLICATE-INPUT-DAG: [[PATHCORRECT]]
## Cannot read archive:
# RUN: echo '!<arch>' > %t-invalid-archive.lib
//===----------------------------------------------------------------------===//
#include "DependencyInfo.h"
+#include "llvm/ADT/MapVector.h"
#include "llvm/BinaryFormat/Magic.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/Object/ArchiveWriter.h"
for (const auto &M : MembersPerArch) {
ArrayRef<NewArchiveMember> Members = M.second.getMembers();
ArrayRef<StringRef> Files = M.second.getFiles();
- StringMap<std::vector<StringRef>> MembersToFiles;
+ MapVector<StringRef, SmallVector<StringRef, 1>> MembersToFiles;
for (auto Iterators = std::make_pair(Members.begin(), Files.begin());
Iterators.first != Members.end();
++Iterators.first, ++Iterators.second) {
std::string ErrorData;
raw_string_ostream ErrorStream(ErrorData);
- for (const auto &MemberToFile : MembersToFiles) {
- if (MemberToFile.getValue().size() > 1) {
- ErrorStream << "file '" << MemberToFile.getKey().str()
- << "' was specified multiple times.\n";
+ for (const auto &[Key, Value] : MembersToFiles) {
+ if (Value.size() > 1) {
+ ErrorStream << "file '" << Key << "' was specified multiple times.\n";
- for (StringRef OriginalFile : MemberToFile.getValue())
+ for (StringRef OriginalFile : Value)
ErrorStream << "in: " << OriginalFile.str() << '\n';
ErrorStream << '\n';