A Chromium developer reported a bug which turned out to be a mangling collision between these two literals:
char s[] = "foo"; char t[32] = "foo";
They may look the same, but for the initialization of t we will (under some circumstances) use a literal that's extended with zeros, and both the length and those zeros should be accounted for by the mangling.
This actually makes the mangling code simpler: where it previously had special logic for null terminators, which are not part of the StringLiteral, that is now covered by the general algorithm.
nit: Also do unsigned StingByteLength = StringLength * SL->getCharByteWidth() here and use it the 3 times you have that computation below