[PATCH] D23938: clang-cl: Accept MSVC 2015's `/execution-charset:utf-8` flag.

David Majnemer via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 26 12:49:54 PDT 2016


majnemer added a subscriber: majnemer.

================
Comment at: lib/Driver/Tools.cpp:5838-5846
@@ -5837,11 +5837,11 @@
     StringRef value = inputCharset->getValue();
     if (value.lower() != "utf-8")
       D.Diag(diag::err_drv_invalid_value) << inputCharset->getAsString(Args)
                                           << value;
   }
 
   // -fexec_charset=UTF-8 is default. Reject others
   if (Arg *execCharset = Args.getLastArg(options::OPT_fexec_charset_EQ)) {
     StringRef value = execCharset->getValue();
-    if (value != "UTF-8")
+    if (value.lower() != "utf-8")
       D.Diag(diag::err_drv_invalid_value) << execCharset->getAsString(Args)
----------------
I'd use `compare_lower` because `lower` introduces a `std::string`.


https://reviews.llvm.org/D23938





More information about the cfe-commits mailing list