[cfe-dev] patch for generalizing stdint for n-bit bytes

Ken Dyck Ken.Dyck at onsemi.com
Fri Nov 6 07:06:23 PST 2009


On Wednesday, November 04, 2009 6:04 PM, Chris Lattner wrote:
>
> On Oct 30, 2009, at 10:33 AM, Ken Dyck wrote:
> >
> > TargetInfo allows you to override the type, width, and alignment of 
> > several type definitions that are synonyms for the standard integer 
> > types (i.e. wchar_t, char16, char32, intmax_t). It is possible, for 
> > example, to specify int as 16-bits wide, define wchar_t as int, and 
> > wchar_t as 32-bits wide. This is exactly the situation with MSP430 
> > because it overrides the width of int but not of wchar_t, 
> and it leads 
> > to inconsistencies in limits.h and stdint.h.
> >
> > Are there any cases where you'd want to specify a width or 
> alignment 
> > for one of these typedefs that is different from the type that it 
> > denotes?
> > If not, I propose that we remove the width and alignment 
> members from 
> > TargetInfo and calculate their values from the type that 
> they denote.
> 
> Works for me!

Patch attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TargetInfo-type-width-overspecification.r86243.patch
Type: application/octet-stream
Size: 7759 bytes
Desc: TargetInfo-type-width-overspecification.r86243.patch
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20091106/e775d7d5/attachment.obj>


More information about the cfe-dev mailing list