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

Chandler Carruth chandlerc at google.com
Thu May 3 15:05:07 PDT 2012


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/c6114064/attachment.html>


More information about the cfe-commits mailing list