[PATCH] D25257: Use StringRef in Option library instead of raw pointers (NFC)

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 5 16:14:03 PDT 2016


mehdi_amini added inline comments.


> rnk wrote in Driver.cpp:97
> Hang on, nullptr is different from an empty string in the response file parsing logic. We have to be careful not to affect that.

Good to know, during a recent discussion about StringRef we were wondering about examples where we'd like to differentiate between empty and null.

It seems we don't have any test that rely on this different right now, and I don't know about the "response file" (what are they, how to use them), I so don't feel I can come up easily with a test without guidance.

> rnk wrote in CommandLine.h:1793-1798
> I don't think this is the same for MarkEOLs = true. Command lines can totally contain empty string arguments that do not mark response file line endings.
> 
> Probably the right way to do this is to have a second optional output vector that has the indices of all the response file line endings.

This is the same underlying issue as above right?
We "could" actually look through `.data()` to differentiate empty string from nullptr, but I'm not fan of this...

https://reviews.llvm.org/D25257





More information about the llvm-commits mailing list