[lld] r318062 - Try harder to delete the temporary file.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 13 10:15:22 PST 2017


Author: rafael
Date: Mon Nov 13 10:15:22 2017
New Revision: 318062

URL: http://llvm.org/viewvc/llvm-project?rev=318062&view=rev
Log:
Try harder to delete the temporary file.

This changes COFF to use the output buffer that is reset by the error
handler.

Modified:
    lld/trunk/COFF/Writer.cpp

Modified: lld/trunk/COFF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Writer.cpp?rev=318062&r1=318061&r2=318062&view=diff
==============================================================================
--- lld/trunk/COFF/Writer.cpp (original)
+++ lld/trunk/COFF/Writer.cpp Mon Nov 13 10:15:22 2017
@@ -108,6 +108,7 @@ public:
 // The writer writes a SymbolTable result to a file.
 class Writer {
 public:
+  Writer() : Buffer(errorHandler().OutputBuffer) {}
   void run();
 
 private:
@@ -137,7 +138,7 @@ private:
   uint32_t getSizeOfInitializedData();
   std::map<StringRef, std::vector<DefinedImportData *>> binImports();
 
-  std::unique_ptr<FileOutputBuffer> Buffer;
+  std::unique_ptr<FileOutputBuffer> &Buffer;
   std::vector<OutputSection *> OutputSections;
   std::vector<char> Strtab;
   std::vector<llvm::object::coff_symbol16> OutputSymtab;




More information about the llvm-commits mailing list