This is an archive of the discontinued LLVM Phabricator instance.

[clang][Diagnostics] Simplify emitSnippet()
ClosedPublic

Authored by tbaeder on May 22 2023, 3:32 AM.

Details

Summary
Don't try to minimize the times we invoke operator<< on the output
stream by keeping a ToPrint string around. Instead, just print the
characters as we iterate over them.

Diff Detail

Event Timeline

tbaeder created this revision.May 22 2023, 3:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 22 2023, 3:32 AM
tbaeder requested review of this revision.May 22 2023, 3:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 22 2023, 3:32 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
tbaeder updated this revision to Diff 524216.May 22 2023, 3:34 AM
aaron.ballman accepted this revision.May 22 2023, 8:19 AM

I think this logic is the same (it's a bit tricky to tell, so it's unfortunate that precommit CI isn't running for this to help validate), so LGTM.

This revision is now accepted and ready to land.May 22 2023, 8:19 AM
This revision was landed with ongoing or failed builds.May 31 2023, 12:41 AM
This revision was automatically updated to reflect the committed changes.