[clang] [llvm] [clang][Driver] Support Trailing Comments in Config Files (PR #213765)

Sam Elliott via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 5 00:18:23 PDT 2026


================
@@ -1116,10 +1116,17 @@ void cl::tokenizeConfigFile(StringRef Source, StringSaver &Saver,
         ++Cur;
       continue;
     }
-    // Find end of the current line.
+    // Find end of the current line, splicing backslash-newline continuations.
+    // A '#' that begins a new unquoted token starts a comment running to the
+    // next literal newline; escapes and continuations are not honored inside
+    // the comment.
     const char *Start = Cur;
----------------
lenary wrote:

Somehow that got pushed to my PR as well, but this does seem more efficient than lots of rounds of review. Left one comment on your commit, feel free to push more commits here, and I'll endeavour to remember a co-authored-by when I land this.

https://github.com/llvm/llvm-project/pull/213765


More information about the llvm-commits mailing list