This is an archive of the discontinued LLVM Phabricator instance.

[clang][cli] Port a CommaJoined option to the marshalling infrastructure
ClosedPublic

Authored by jansvoboda11 on Dec 22 2020, 6:46 AM.

Diff Detail

Event Timeline

jansvoboda11 created this revision.Dec 22 2020, 6:46 AM
jansvoboda11 requested review of this revision.Dec 22 2020, 6:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 22 2020, 6:46 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
dexonsmith accepted this revision.Dec 22 2020, 11:05 PM

LGTM, with one nit.

clang/lib/Frontend/CompilerInvocation.cpp
333–337

The comparison to .front is a bit subtle. I think this might be more direct / easy to read using drop_begin:

CommaJoinedValue.append(Values.front());
for (const std::string &Value : llvm::drop_begin(Values, 1)) {
  CommaJoinedValue.append(",");
  CommaJoinedValue.append(Value);
}
This revision is now accepted and ready to land.Dec 22 2020, 11:05 PM
This revision was landed with ongoing or failed builds.Jan 7 2021, 2:52 AM
This revision was automatically updated to reflect the committed changes.