[cfe-commits] [PATCH] Improved handling of 128-bit integer literals

Stephen Canon scanon at apple.com
Wed Nov 21 13:27:54 PST 2012


Hi all --

This patch attempts to clean up the situation for 128-bit and MS-style integer literals, as discussed on cfe-dev back in September ("MS 128-bit literals don't always have the correct type").

Here is the brief overview of the intended changes:

	- The MS suffixes i32 and i64 now mean "give me an integer of exactly this size" rather than "of at least this size", as indicated by tests performed by various people and reported in the September thread.
	- The i128 suffix has been eliminated, as MSVC never actually supported it; it seems to have snuck into the clang codebase at some point in the hazy past.
	- On targets that support i128 (LP64 targets), literals that are too large to fit into [unsigned] long long become [unsigned] i128, as allowed by the paragraphs on "extended integer types" in the C and C++ standards.  We issue a warning in such cases because clang will differ from GCC.

As fallout from this, a few tests and StmtPrinter have also been updated to match, and attribute parsing had to be modified to handle non-int64 literals as well.

Thanks for reviewing (and happy American thanksgiving!)
- Steve

-------------- next part --------------
A non-text attachment was scrubbed...
Name: literal-128.patch
Type: application/octet-stream
Size: 21274 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121121/8e2323a8/attachment.obj>


More information about the cfe-commits mailing list