[PATCH] D150990: [split-file] Add flags to support comments and adding extension to output files

Vlad Serebrennikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 23 14:48:43 PDT 2023


Endill added a comment.

In D150990#4365708 <https://reviews.llvm.org/D150990#4365708>, @MaskRay wrote:

>> I go into more details on motivation in Discourse thread.
>
> Thanks for the link, but it seems that the thread doesn't give examples how `--allow-comments` and `--add-file-extension` are supposed to be used.

It does. Here's the link I used there: https://gist.github.com/Endilll/1d8035d42bdf0dc73eaaf8a8c343bf8c/revisions?diff=unified
There I diff current notation and notation we strive for.

>> `// dr164: 16 becomes //--- dr164: 16, which produces dr164.cpp file with the corresponding test.`
>
> I am confused by this comment. Does the option ignore everything starting from the `:`? Why?

Yes, it ignores everything starting from the `:`, because in our use case that's where part name ends, and where additional data begins (which clang version implements the DR).

> The Discourse thread gives a link to https://github.com/llvm/llvm-project/blob/main/clang/test/CXX/drs/dr5xx.cpp which uses this notation, but the discourse thread doesn't elaborate on the syntax. This kind of detail is actually what I expect from the commit message/Phabricator summary, instead of some information embedded in a very long C++ DR specific forum post.

What you can see today in `dr5xx.cpp` is a notation that we've been using for years and happy about. In that thread I go into why we need the change this patch is a part of, and why in this particular form. Explaining that would be copy-pasting large chunks from "Use case" section of that thread. I can do that for commit description if you find that helpful.

> For testing, use `llvm/test/tools/split-file/` and `ninja check-llvm-tools-split-file`.

Thank you, I'll try that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150990



More information about the llvm-commits mailing list