On Tue, Apr 30, 2013 at 5:44 PM, Howard Hinnant <[email protected]> wrote:
> Author: hhinnant > Date: Tue Apr 30 16:44:48 2013 > New Revision: 180811 > > URL: http://llvm.org/viewvc/llvm-project?rev=180811&view=rev > Log: > This patch introduces an alternative layout for basic_string which when > the string is short, the data pointer will be word-aligned. It can be > activated with -D_LIBCPP_ALTERNATE_STRING_LAYOUT. These two different > layouts (the default and _LIBCPP_ALTERNATE_STRING_LAYOUT) are not ABI > compatible with each other. Once one is chosen for a given platform, it is > disruptive to change it. > > Maybe the name of the #define name should contain "ABI" in it somewhere just to make it extra clear that it tampers with ABI? It seems a lot less likely for someone to slip up a flag called _LIBCPP_ALTERNATE_STRING_LAYOUT_ABI. There aren't many ways to interpret "layout" other than being ABI breaking, but still, having an easy mental pattern-match on "ABI" seems a lot less error-prone (the fact that you explicitly had to mention that this was an ABI choice in the commit message suggests that it's not entirely obvious). Also, "alternate" is really vague (and what will you call the next layout change, "extra alternate"?). Why not _LIBCPP_WORD_ALIGNED_STRING_LAYOUT_ABI, which is self-documenting? -- Sean Silva
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
