cl uses 'CL' and '_CL_' to prepend and append command line options to
the given argument vector. There is an additional quirk whereby '#' is
transformed into '='.
Details
Diff Detail
Event Timeline
lgtm
tools/driver/driver.cpp | ||
---|---|---|
464–466 | How about adjusting all the options in place and then inserting them all at once to avoid the N^2 complexity? |
Out of curiosity, did you run in to something that relies on this in the wild?
tools/driver/driver.cpp | ||
---|---|---|
452 | Maybe don't take the parameter as a const char* if the constness needs to be dropped for the adjusting to take place? The const_cast could just be moved to where you make the call below. |
tools/driver/driver.cpp | ||
---|---|---|
451 | I'd also rather factor this out of driver main, since it's really not important to most readers. | |
452 | I think TokenizeCommandLine builds you a list of const strings, unfortunately. We could avoid the cast if we hooked into the tokenization or StringSaver, but it didn't seem worth it. |
I'd also rather factor this out of driver main, since it's really not important to most readers.