[cfe-commits] [PATCH] fix support for 128-bit integer literals

Stephen Canon scanon at apple.com
Thu May 3 15:32:45 PDT 2012


Done and done.


On May 3, 2012, at 6:05 PM, Chandler Carruth wrote:

> On Thu, May 3, 2012 at 3:02 PM, David Blaikie <dblaikie at gmail.com> wrote:
> On Thu, May 3, 2012 at 2:56 PM, Stephen Canon <scanon at apple.com> wrote:
> > Clang already supports the microsoft suffixes for integer literals "i128" and "Ui128" with -fms-extensions.  However, these literals are currently truncated to 64 bits with a warning.
> >
> > This patch adds support for full-width 128-bit integer literals with the ms suffixes.
> 
> Could you include some test cases (& verify that the existing cases
> (the truncation warnings when the suffix isn't used, for example) are
> appropriately tested so that you're not regressing them)?
> 
> Also, a style nit in the patch:
> 
> +    unsigned maxWidth = Context.getTargetInfo().getIntMaxTWidth();
> 
> The LLVM coding conventions suggest 'MaxWidth' for the variable name.
> 
> +    // The microsoft literal suffix extensions support 128-bit literals, which
> +    // may be wider than [u]intmax_t.
> +    if (Literal.isMicrosoftInteger && maxWidth < 128)
> +      maxWidth = 128;
> +    llvm::APInt ResultVal(maxWidth, 0);
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120503/9247ea72/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 128-bit-literals.patch
Type: application/octet-stream
Size: 3098 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120503/9247ea72/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120503/9247ea72/attachment-0001.html>


More information about the cfe-commits mailing list