[PATCH] D61559: Fix the crash when formatting unsupported encodings

2019-05-08 Thread Owen Pan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL360257: [clang-format] Fix the crash when formatting unsupported encodings (authored by owenpan, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to

[PATCH] D61559: Fix the crash when formatting unsupported encodings

2019-05-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan marked an inline comment as done. owenpan added inline comments. Comment at: clang/tools/clang-format/ClangFormat.cpp:273 +.StartsWith("\xFF\xFE", "UTF-16 (LE)") +.StartsWith("\x2B\x2F\x76", "UTF-7") +.StartsWith("\xF7\x64\x4C", "UTF-1")

[PATCH] D61559: Fix the crash when formatting unsupported encodings

2019-05-08 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 198652. owenpan added a comment. Fixed the typo for SCSU. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61559/new/ https://reviews.llvm.org/D61559 Files: clang/tools/clang-format/ClangFormat.cpp Index:

[PATCH] D61559: Fix the crash when formatting unsupported encodings

2019-05-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. I copied the code from `clang/lib/Basic/SourceManager.cpp`. See D61628 . I will update this patch to correct the typo in SCSU or remove it along with the other rare BOMs. How do you add test cases for this kind of fixes that emit error

[PATCH] D61559: Fix the crash when formatting unsupported encodings

2019-05-06 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. You might want to add a test for one of these? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61559/new/ https://reviews.llvm.org/D61559 ___ cfe-commits mailing list

[PATCH] D61559: Fix the crash when formatting unsupported encodings

2019-05-06 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added inline comments. This revision is now accepted and ready to land. Comment at: clang/tools/clang-format/ClangFormat.cpp:273 +.StartsWith("\xFF\xFE", "UTF-16 (LE)") +.StartsWith("\x2B\x2F\x76", "UTF-7") +

[PATCH] D61559: Fix the crash when formatting unsupported encodings

2019-05-05 Thread Owen Pan via Phabricator via cfe-commits
owenpan updated this revision to Diff 198205. owenpan added a comment. Moved "UTF-32 (LE)" to before "UTF-16 (LE)" in `llvm::StringSwitch` so that the former BOM wouldn't be misnamed as the latter. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61559/new/

[PATCH] D61559: Fix the crash when formatting unsupported encodings

2019-05-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan created this revision. owenpan added reviewers: klimek, djasper, sammccall, MyDeveloperDay, krasimir. owenpan added a project: clang. Herald added a subscriber: cfe-commits. See PR33946 . Repository: rC Clang