[lld] r266942 - Revert unintentionally commited bits in r266935.

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 20 18:31:37 PDT 2016


Author: nico
Date: Wed Apr 20 20:31:37 2016
New Revision: 266942

URL: http://llvm.org/viewvc/llvm-project?rev=266942&view=rev
Log:
Revert unintentionally commited bits in r266935.

Modified:
    lld/trunk/COFF/DriverUtils.cpp
    lld/trunk/test/COFF/out.test

Modified: lld/trunk/COFF/DriverUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/DriverUtils.cpp?rev=266942&r1=266941&r2=266942&view=diff
==============================================================================
--- lld/trunk/COFF/DriverUtils.cpp (original)
+++ lld/trunk/COFF/DriverUtils.cpp Wed Apr 20 20:31:37 2016
@@ -559,7 +559,6 @@ static std::string getImplibPath() {
 }
 
 static std::unique_ptr<MemoryBuffer> createEmptyImportLibrary() {
-#if 0
   std::string S = (Twine("LIBRARY \"") +
                    llvm::sys::path::filename(Config->OutputFile) + "\"\n")
                       .str();
@@ -579,27 +578,6 @@ static std::unique_ptr<MemoryBuffer> cre
       MemoryBuffer::getFile(Path2, -1, false);
   error(BufOrErr, Twine("Failed to open ") + Path2);
   return MemoryBuffer::getMemBufferCopy((*BufOrErr)->getBuffer());
-#else
-  const char kMagic[] = "!<arch>\n";
-  size_t Size = sizeof(kMagic) + // Include trailing \0.
-                sizeof(object::ArchiveMemberHeader);
-  std::unique_ptr<MemoryBuffer> Buf = MemoryBuffer::getNewUninitMemBuffer(
-    Size, getImplibPath());
-  char* B = const_cast<char*>(Buf->getBufferStart());
-  memcpy(B, kMagic, sizeof(kMagic)); // Include trailing \0.
-
-  auto *Hdr =
-      reinterpret_cast<object::ArchiveMemberHeader *>(B + sizeof(kMagic));
-  sprintf(Hdr->Name, "%-12s", "/");
-  sprintf(Hdr->LastModified, "%-12d", 0);
-  sprintf(Hdr->UID, "%-6d", 0);
-  sprintf(Hdr->GID, "%-6d", 0);
-  sprintf(Hdr->AccessMode, "%-8d", 0644);
-  sprintf(Hdr->Size, "%-10d", 0);
-  memcpy(Hdr->Terminator, "\n", 2);
-
-  return Buf;
-#endif
 }
 
 static std::vector<NewArchiveIterator>
@@ -616,7 +594,7 @@ readMembers(const object::Archive &Archi
 }
 
 // This class creates short import files which is described in
-// PE/COFF spec 8. Import Library Format.
+// PE/COFF spec 7. Import Library Format.
 class ShortImportCreator {
 public:
   ShortImportCreator(object::Archive *A, StringRef S) : Parent(A), DLLName(S) {}
@@ -697,7 +675,6 @@ void writeImportLibrary() {
   for (Export &E : Config->Exports) {
     if (E.Private)
       continue;
-fprintf(stderr, "export %s\n", E.SymbolName.str().c_str());
     if (E.ExtName.empty()) {
       Members.push_back(ShortImport.create(
           E.SymbolName, E.Ordinal, getNameType(E.SymbolName, E.Name), E.Data));
@@ -709,7 +686,6 @@ fprintf(stderr, "export %s\n", E.SymbolN
   }
 
   std::string Path = getImplibPath();
-fprintf(stderr, "writing implib to %s\n", Path.c_str());
   std::pair<StringRef, std::error_code> Result =
       writeArchive(Path, Members, /*WriteSymtab*/ true, object::Archive::K_GNU,
                    /*Deterministic*/ true, /*Thin*/ false);

Modified: lld/trunk/test/COFF/out.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/out.test?rev=266942&r1=266941&r2=266942&view=diff
==============================================================================
--- lld/trunk/test/COFF/out.test (original)
+++ lld/trunk/test/COFF/out.test Wed Apr 20 20:31:37 2016
@@ -1,4 +1,3 @@
-# REQUIRES: winlib
 # RUN: yaml2obj < %p/Inputs/ret42.yaml > %t.obj
 
 # RUN: mkdir -p %T/out/tmp




More information about the llvm-commits mailing list