[PATCH] D44504: COFF: Implement string tail merging.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 14 19:36:16 PDT 2018


pcc added a comment.

> Do you have a test to make sure that a wide string literal doesn't point into a misaligned offset into a narrow string literal?

I will add one.

> Also, does the standard allow aliasing string literals of different underlying types together?

That's an interesting question. The standardese is:

> Whether all string literals are distinct (that is, are stored in nonoverlapping objects) and whether successive evaluations of a string-literal yield the same or a different object is unspecified.

This doesn't make any distinction between different kinds of string literal, so I think the answer is "yes". In any event, this seems to be the intent of the standard.


https://reviews.llvm.org/D44504





More information about the llvm-commits mailing list