This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Adds a canonical delimiter to raw string formatting
ClosedPublic

Authored by krasimir on Jan 17 2018, 10:16 AM.

Details

Summary

This patch adds canonical delimiter support to the raw string formatting.
This allows matching delimiters to be updated to the canonical one.

Diff Detail

Repository
rC Clang

Event Timeline

krasimir created this revision.Jan 17 2018, 10:16 AM
bkramer accepted this revision.Jan 18 2018, 10:33 AM

lg

lib/Format/ContinuationIndenter.cpp
1336

Can this be a StringRef? Can RawText outlive the Current token?

This revision is now accepted and ready to land.Jan 18 2018, 10:33 AM
krasimir updated this revision to Diff 130587.Jan 19 2018, 4:20 AM
krasimir marked an inline comment as done.
  • Add a comment about std::string
krasimir added inline comments.Jan 19 2018, 4:21 AM
lib/Format/ContinuationIndenter.cpp
1336

Nice catch! The reformatting code creates a virtual source code environment which expects a null-terminated string. Added a comment why this is necessary.

This revision was automatically updated to reflect the committed changes.