[PATCH] D48928: [ms] Fix mangling of string literals used to initialize arrays larger or smaller than the literal

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 5 23:47:46 PDT 2018


hans marked 3 inline comments as done.
hans added inline comments.


================
Comment at: lib/AST/MicrosoftMangle.cpp:3198
+                              ->getSize()
+                              .getZExtValue();
+
----------------
thakis wrote:
> nit: Also do `unsigned StingByteLength = StringLength * SL->getCharByteWidth()` here and use it the 3 times you have that computation below
Good idea, thanks!


================
Comment at: lib/AST/MicrosoftMangle.cpp:3210
 
-  auto GetLittleEndianByte = [&SL](unsigned Index) {
+  auto GetLittleEndianByte = [&SL, StringLength](unsigned Index) {
     unsigned CharByteWidth = SL->getCharByteWidth();
----------------
thakis wrote:
> You're capturing StringLength here, but then you don't use it in the lambda body.
Oops, a leftover from an older version of the patch. Removed.


https://reviews.llvm.org/D48928





More information about the cfe-commits mailing list