This is an archive of the discontinued LLVM Phabricator instance.

[clang][cli] Accept option spelling as `Twine`
ClosedPublic

Authored by jansvoboda11 on Aug 3 2023, 2:12 PM.

Details

Summary

This will make it possible to accept the spelling as StringLiteral in D157029 and avoid some unnecessary allocations in a later patch.

Diff Detail

Event Timeline

jansvoboda11 created this revision.Aug 3 2023, 2:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2023, 2:12 PM
Herald added a subscriber: ributzka. · View Herald Transcript
jansvoboda11 requested review of this revision.Aug 3 2023, 2:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2023, 2:12 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

This code asserts that the Twine is a single stringref, but it's also relying on the fact it's null-terminated; can we check for that as well, or at least document it?

Assert that spelling is null-terminated

That's a good point. Updated.

benlangmuir accepted this revision.Aug 3 2023, 3:08 PM
This revision is now accepted and ready to land.Aug 3 2023, 3:08 PM
This revision was landed with ongoing or failed builds.Aug 3 2023, 3:10 PM
This revision was automatically updated to reflect the committed changes.