[PATCH] D90866: Fix bugs in EOL marking in command line tokenizers

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 5 10:43:36 PST 2020


MaskRay added inline comments.


================
Comment at: llvm/lib/Support/CommandLine.cpp:872
         NewArgv.push_back(Saver.save(StringRef(Token)).data());
+      // Mark the end of lines in response files
+      if (MarkEOLs && C == '\n')
----------------
Nit: full stop.


================
Comment at: llvm/unittests/Support/CommandLineTest.cpp:250
+TEST(CommandLineTest, TokenizeAndMarkEOLs) {
+  const char Input[] = "clang -Xclang foo\n\n foo\"bar\"baz\n x.cpp\n";
+  const char *const Output[] = {"clang", "-Xclang", "foo",
----------------
Could you add some comments what nullptr is used for?

As another interesting test, does `-Xclang\nfoo` work?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90866/new/

https://reviews.llvm.org/D90866



More information about the llvm-commits mailing list