mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[InterfacePrinting] Move utf8 sanitizer from SourceKit to ASTPrinter.
We sanitize comments by replacing invalid utf8 subsequence with � . Swift SVN r30031
This commit is contained in:
@@ -505,7 +505,7 @@ void ClangCommentPrinter::printDeclPre(const Decl *D) {
|
||||
void ClangCommentPrinter::printDeclPost(const Decl *D) {
|
||||
OtherPrinter.printDeclPost(D);
|
||||
for (auto CommentText : PendingComments) {
|
||||
*this << " " << CommentText;
|
||||
*this << " " << ASTPrinter::sanitizeUtf8(CommentText);
|
||||
}
|
||||
PendingComments.clear();
|
||||
if (auto ClangN = D->getClangNode())
|
||||
@@ -596,7 +596,7 @@ void ClangCommentPrinter::printComment(StringRef RawText, unsigned StartCol) {
|
||||
trimLeadingWhitespaceFromLines(RawText, WhitespaceToTrim, Lines);
|
||||
|
||||
for (auto Line : Lines) {
|
||||
*this << Line << "\n";
|
||||
*this << ASTPrinter::sanitizeUtf8(Line) << "\n";
|
||||
printIndent();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user