diff options
author | Nico Weber <nicolasweber@gmx.de> | 2015-07-13 00:55:26 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2015-07-13 00:55:26 +0000 |
commit | 9262da26d05018565f9d6c09d5788ce8a66ea08c (patch) | |
tree | c05e0790eb9dad416cf06f4c5823917fec82558b /lld | |
parent | b5785e07c45aba97170b619fb11e3ba9dc1d5c57 (diff) | |
download | llvm-9262da26d05018565f9d6c09d5788ce8a66ea08c.zip llvm-9262da26d05018565f9d6c09d5788ce8a66ea08c.tar.gz llvm-9262da26d05018565f9d6c09d5788ce8a66ea08c.tar.bz2 |
Make COFF linker work when it's built by clang again.
clang-cl doesn't compile std::atomic_flag correctly (PR24101). Since the COFF
linker doesn't use threads yet, just revert r241420 and r241481 for now to
work around this clang-cl bug.
llvm-svn: 242006
Diffstat (limited to 'lld')
-rw-r--r-- | lld/COFF/InputFiles.cpp | 9 | ||||
-rw-r--r-- | lld/COFF/InputFiles.h | 2 |
2 files changed, 3 insertions, 8 deletions
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp index 66d792b..be5c0ed 100644 --- a/lld/COFF/InputFiles.cpp +++ b/lld/COFF/InputFiles.cpp @@ -71,12 +71,6 @@ std::error_code ArchiveFile::parse() { if (B->getName() != "__NULL_IMPORT_DESCRIPTOR") LazySymbols.push_back(B); } - - // Seen is a map from member files to boolean values. Initially - // all members are mapped to false, which indicates all these files - // are not read yet. - for (const Archive::Child &Child : File->children()) - Seen[Child.getBuffer().data()].clear(); return std::error_code(); } @@ -90,7 +84,8 @@ ErrorOr<MemoryBufferRef> ArchiveFile::getMember(const Archive::Symbol *Sym) { // Return an empty buffer if we have already returned the same buffer. const char *StartAddr = It->getBuffer().data(); - if (Seen[StartAddr].test_and_set()) + auto Pair = Seen.insert(StartAddr); + if (!Pair.second) return MemoryBufferRef(); return It->getMemoryBufferRef(); } diff --git a/lld/COFF/InputFiles.h b/lld/COFF/InputFiles.h index 0d768c5..ade0b25 100644 --- a/lld/COFF/InputFiles.h +++ b/lld/COFF/InputFiles.h @@ -107,7 +107,7 @@ private: std::unique_ptr<Archive> File; std::string Filename; std::vector<Lazy *> LazySymbols; - std::map<const char *, std::atomic_flag> Seen; + std::set<const char *> Seen; llvm::MallocAllocator Alloc; }; |