thakis accepted this revision. thakis added a comment. This revision is now accepted and ready to land.
Nice! ================ Comment at: lib/AST/MicrosoftMangle.cpp:3198 + ->getSize() + .getZExtValue(); + ---------------- nit: Also do `unsigned StingByteLength = StringLength * SL->getCharByteWidth()` here and use it the 3 times you have that computation below ================ Comment at: lib/AST/MicrosoftMangle.cpp:3210 - auto GetLittleEndianByte = [&SL](unsigned Index) { + auto GetLittleEndianByte = [&SL, StringLength](unsigned Index) { unsigned CharByteWidth = SL->getCharByteWidth(); ---------------- You're capturing StringLength here, but then you don't use it in the lambda body. ================ Comment at: lib/AST/MicrosoftMangle.cpp:3219 - auto GetBigEndianByte = [&SL](unsigned Index) { + auto GetBigEndianByte = [&SL, StringLength](unsigned Index) { unsigned CharByteWidth = SL->getCharByteWidth(); ---------------- likewise ================ Comment at: test/CodeGen/mangle-ms-string-literals.c:7 + struct {int x; char s[2]; } truncatedAscii = {x, "hello"}; + // CHECK: "??_C@_01CONKJJHI@he@" + struct {int x; char s[16]; } paddedAscii = {x, "hello"}; ---------------- Nice, we used to mismangle this. MSVC matches the string here: https://godbolt.org/g/dbm6jT (old clang: https://godbolt.org/g/Yy7iCK) https://reviews.llvm.org/D48928 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits