diff options
author | Andy Yankovsky <weratt@gmail.com> | 2021-07-26 16:36:51 +0200 |
---|---|---|
committer | Andy Yankovsky <weratt@gmail.com> | 2021-08-02 11:36:04 +0200 |
commit | 307b1fddd4d84b559b154ff7744ae68bf9c6f503 (patch) | |
tree | 288505fb60a3a5df6f09606ed484166394404639 /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | 7c6cca4b6e75fb3feea5449325c9394ee87456c3 (diff) | |
download | llvm-307b1fddd4d84b559b154ff7744ae68bf9c6f503.zip llvm-307b1fddd4d84b559b154ff7744ae68bf9c6f503.tar.gz llvm-307b1fddd4d84b559b154ff7744ae68bf9c6f503.tar.bz2 |
[clang-tidy] Always open files using UTF-8 encoding
The encoding used for opening files depends on the OS and might be different
from UTF-8 (e.g. on Windows it can be CP-1252). The documentation files use
UTF-8 and might be incompatible with other encodings. For example, right now
`clang-tools-extra/docs/clang-tidy/checks/abseil-no-internal-dependencies.rst`
has non-ASCII quotes and running `add_new_check.py` fails on Windows, because
it tries to read the file with incompatible encoding.
Use `io.open` for compatibility with both Python 2 and Python 3.
Reviewed By: kbobyrev
Differential Revision: https://reviews.llvm.org/D106792
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions