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

Ken Dyck Ken.Dyck at onsemi.com
Fri Oct 30 05:41:32 PDT 2009


On Friday, October 30, 2009 1:06 AM, Chris Lattner wrote:
> On Oct 29, 2009, at 7:52 AM, Ken Dyck wrote:
> >> This is a great start, applied as r85481.  Removing the 
> rest would be 
> >> even better :)
> >
> > One obstacle I found to simplifying the code is that the 
> char type is 
> > not included in the TargetInfo::IntTy enumeration, making 
> it necessary 
> > to always add a special case for characters. What is the 
> rational for 
> > excluding characters? Would there be any objection to adding a Char 
> > type to the enum?
> 
> It probably was just not needed yet, so noone added it.

Alright. If there aren't any objections, then, I'll add it and do a more
thorough scrub of InitPreprocessor.cpp. 

> > FYI, this is the plan I'll be working from for future patches:
> >
> > 1. A simple reordering of typedefs in stdint.h (and 
> corresponding test
> > cases) in anticipation of the next patch, which defines the 
> types in 
> > order of decreasing width.
> 
> > 2. Generalization of stdint.h for non-power-of-2 widths, along with 
> > necessary modifications to InitPreprocessor.cpp. Only minor 
> changes to 
> > test cases (where long is replaced by int in some typedefs 
> on targets 
> > where they are the same width).
> > 3. Parameterization of SIG_ATOMIC
> > 4. Parameterization of limits on types that can be either signed or 
> > unsigned.
> > 5. Replace use of vector<char> for the definition buffer with a 
> > raw_ostream.

Stage #1 patch attached. It is a simple reordering of the definitions in
stdint.h and introduces no new function changes. 

-Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stdint-reorder.r85522.patch
Type: application/octet-stream
Size: 26324 bytes
Desc: stdint-reorder.r85522.patch
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20091030/a4edb772/attachment.obj>


More information about the cfe-dev mailing list