[PATCH] D43988: Fix processing of path names in response files on Windows

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 1 17:07:46 PST 2018


rnk added inline comments.


================
Comment at: llvm/lib/Support/CommandLine.cpp:1085
+  ExpandResponseFiles(Saver,
+         (Triple(sys::getProcessTriple()).getOS() == Triple::Win32) ?
+         cl::TokenizeWindowsCommandLine : cl::TokenizeGNUCommandLine,
----------------
I would say `Triple(sys::getProcessTriple()).isOSWindows()`


================
Comment at: llvm/unittests/Support/CommandLineTest.cpp:636
+TEST(CommandLineTest, ResponseFileWindows) {
+  if (Triple(sys::getProcessTriple()).getOS() != Triple::Win32)
+    return;
----------------
ditto


================
Comment at: llvm/unittests/Support/CommandLineTest.cpp:644
+  // Create response file.
+  std::ofstream RspFile("resp");
+  EXPECT_TRUE(RspFile.is_open());
----------------
This assumes a writable cwd. I think you want this pattern:
  int FileDescriptor;
  SmallString<64> TempPath;
  ASSERT_NO_ERROR(
      fs::createTemporaryFile("resp-", ".txt", FileDescriptor, TempPath));




https://reviews.llvm.org/D43988





More information about the llvm-commits mailing list