[PATCH] D90116: [clangd] Escape Unicode characters to fix Windows builds

2020-11-08 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev updated this revision to Diff 303754. kbobyrev added a comment. Rebase on top of master. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90116/new/ https://reviews.llvm.org/D90116 Files: llvm/CMakeLists.txt Index: llvm/CMakeLists.txt ==

[PATCH] D90116: [clangd] Escape Unicode characters to fix Windows builds

2020-11-08 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev updated this revision to Diff 303753. kbobyrev added a comment. Herald added subscribers: llvm-commits, mgorny. Herald added a project: LLVM. Force MSVC to read code as UTF-8 via CMake options. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D

[PATCH] D90116: [clangd] Escape Unicode characters to fix Windows builds

2020-11-05 Thread Ilya Golovenko via Phabricator via cfe-commits
ilya-golovenko added a comment. It is also possible to force MSVC to treat a certain source code files as UTF-8 by adding the following pragma to the beginning of the file: #ifdef _MSVC_VER #pragma execution_character_set("utf-8"); #endif Repository: rG LLVM Github Monorepo CHANGES SI

[PATCH] D90116: [clangd] Escape Unicode characters to fix Windows builds

2020-11-02 Thread Aleksandr Platonov via Phabricator via cfe-commits
ArcsinX added a comment. In D90116#2353440 , @kbobyrev wrote: > Hmm, I see. From the looks of it, the solution for several projects would be > > add_compile_options("$<$:/utf-8>") > add_compile_options("$<$:/utf-8>") > > But I'm not sure if it makes se

[PATCH] D90116: [clangd] Escape Unicode characters to fix Windows builds

2020-10-26 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev added a comment. Hmm, I see. From the looks of it, the solution for several projects would be add_compile_options("$<$:/utf-8>") add_compile_options("$<$:/utf-8>") But I'm not sure if it makes sense in our case and I don't see many `add_compile_options` in LLVM. Also, I don't have

[PATCH] D90116: [clangd] Escape Unicode characters to fix Windows builds

2020-10-26 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. This isn't the only place where we use such characters. While I'm not sure spelling these literally is a hill we want to die on, I think u8 literals are so poorly understood that trying to do this consistently isn't going to be that simple. As noted, clang is always

[PATCH] D90116: [clangd] Escape Unicode characters to fix Windows builds

2020-10-25 Thread Daniel Martín via Phabricator via cfe-commits
danielmartin added a comment. Using explicit UTF-8 string literals is a possible solution, but it makes the code a bit less readable. Another possible solution is to save the source file using UTF-8 with BOM, but this is confusing outside the Microsoft world (and it's very easy to remove the BO

[PATCH] D90116: [clangd] Escape Unicode characters to fix Windows builds

2020-10-25 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added a comment. I think we should update cmake rules to explicitly tell the compilers that the source code language is utf8. https://docs.microsoft.com/en-us/cpp/build/reference/utf-8-set-source-and-executable-character-sets-to-utf-8?view=vs-2019 seems to be the way for MSVC. I am not

[PATCH] D90116: [clangd] Escape Unicode characters to fix Windows builds

2020-10-25 Thread Aleksandr Platonov via Phabricator via cfe-commits
ArcsinX added a comment. I have face this problem long time ago. This happens only: - on non-English Windows (and could be fixed via system settings: Control Panel -> Clock,Language,and Region -> Region and Language -> Administrative ->Language for non-Unicode programs -> Change system locale -

[PATCH] D90116: [clangd] Escape Unicode characters to fix Windows builds

2020-10-25 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev updated this revision to Diff 300535. kbobyrev added a comment. Use u8 string literals. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90116/new/ https://reviews.llvm.org/D90116 Files: clang-tools-extra/clangd/CodeComplete.h clang-tool

[PATCH] D90116: [clangd] Escape Unicode characters to fix Windows builds

2020-10-25 Thread Kirill Bobyrev via Phabricator via cfe-commits
kbobyrev created this revision. kbobyrev added reviewers: kadircet, sammccall. Herald added subscribers: cfe-commits, usaxena95, arphaman. Herald added a project: clang. kbobyrev requested review of this revision. Herald added subscribers: MaskRay, ilya-biryukov. Fixes: https://github.com/clangd/c