Revert "Make COFF linker work when it's built by clang again."

This reverts commit r242006. The original issue in Clang was fixed in r242009,
so we can now safely use std::atomic_flag.

llvm-svn: 242112
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp
index be5c0ed..66d792b 100644
--- a/lld/COFF/InputFiles.cpp
+++ b/lld/COFF/InputFiles.cpp
@@ -71,6 +71,12 @@
     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();
 }
 
@@ -84,8 +90,7 @@
 
   // Return an empty buffer if we have already returned the same buffer.
   const char *StartAddr = It->getBuffer().data();
-  auto Pair = Seen.insert(StartAddr);
-  if (!Pair.second)
+  if (Seen[StartAddr].test_and_set())
     return MemoryBufferRef();
   return It->getMemoryBufferRef();
 }