[PATCH] D14320: Fix createUniqueFile() to do what it is documented to do: create the unique file in a temporary directory if the model isn't absolute. Fix the callers of createUniqueFile() which were affected by this change. Add test cases to verify patch.

Paweł Bylica via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 4 00:17:12 PST 2015


chfast added a comment.

I'm not sure about the change. I think both cases (creating a file in the current and in the system temp directory) should be supported.

The example in createUniqueFile() docs should be updated too.


================
Comment at: unittests/Support/Path.cpp:509
@@ +508,3 @@
+  // path should still be absolute.
+  Twine absolutePath = Twine(TDir, "unique%%%%%%.txt");
+  ASSERT_NO_ERROR(fs::createUniqueFile(absolutePath, UniquePath));
----------------
You need to use path::append here. A path returned by system_temp_directory() never has trailing separator.


http://reviews.llvm.org/D14320





More information about the llvm-commits mailing list