[PATCH] non-Unicode response file support on Windows

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Thu Jan 22 19:24:40 PST 2015


The main issue I think is that there is not a lot of precedent for this on windows:

- GNU tools only use the local codepage, but that is probably a consequence of simplistically using the crt read function.
- Clang support UTF-16 and UTF-8.
- Microsoft own tools require UTF-16.

The part of this patch that I don't expect to be controversial is skipping the utf-8 bom if one is present. Can you move that to an independent patch?

Also, it needs a testcase. Something as simple an running llvm-as @file_with_utf8_bom should do.


================
Comment at: llvm/lib/Support/ConvertUTFWrapper.cpp:90
@@ +89,3 @@
+// by the host system's endianness.
+bool hasUTF8ByteOrderMark(ArrayRef<char> S) {
+  return (S.size() >= 3 &&
----------------
This can be a static helper in CommandLine.cpp.

================
Comment at: llvm/lib/Support/ConvertUTFWrapper.cpp:97
@@ +96,3 @@
+// Convert system-locale encoded string to UTF8
+bool convertANSIToUTF8String(ArrayRef<char> SrcBytes, std::string &Out) {
+  assert(Out.empty());
----------------
This can be a static helper in CommandLine.cpp

http://reviews.llvm.org/D7133

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list