[PATCH] D24176: Remove temoprary files.

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 1 18:27:46 PDT 2016


rnk added a comment.

I don't think this works as in Windows


================
Comment at: COFF/DriverUtils.cpp:286
@@ +285,3 @@
+public:
+  explicit TemporaryFile(StringRef Extn) {
+    SmallString<128> S;
----------------
Let's thread through the other parameter, so that we get "resource-NNN.obj". That was somewhat helpful for my debugging purposes, and it will show up in the debug info too.

================
Comment at: COFF/DriverUtils.cpp:300
@@ +299,3 @@
+    if (!Path.empty())
+      sys::fs::remove(Path);
+  }
----------------
Can we assert success here?

================
Comment at: COFF/DriverUtils.cpp:584
@@ -570,3 +583,3 @@
   E.run();
-  return check(MemoryBuffer::getFile(Path), "could not open " + Path);
+  return check(MemoryBuffer::getFile(File.Path), "could not open " + File.Path);
 }
----------------
Won't this fail on Windows, where you cannot remove a file which has an open mapping?


https://reviews.llvm.org/D24176





More information about the llvm-commits mailing list