hamzasood added inline comments.

================
Comment at: lib/Driver/ToolChains/MSVC.cpp:487-488
+      if (!llvm::convertUTF16ToUTF8String(
+             llvm::ArrayRef<char>(reinterpret_cast<char *>(EnvBlockWide.get()),
+                                  EnvBlockLen * sizeof(EnvBlockWide[0])),
+             EnvBlock))
----------------
hamzasood wrote:
> zturner wrote:
> > There's an overload of `convertUTF16ToUTF8String` that takes an 
> > `ArrayRef<UTF16>`.  So I think you can just write this:
> > 
> > ```
> > if (!llvm::convertUTF16ToUTF8String(makeArrayRef(EnvBlockWide.get(), 
> > EnvBlockLen)))
> > ```
> Using that overload would involve casting wchar_t* to UTF16* (i.e. unsigned 
> char*), which I think breaks aliasing rules.
Sorry, I meant unsigned short.


https://reviews.llvm.org/D30991



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to