[cfe-dev] Adding more info to builtin source types.
zaffanella at cs.unipr.it
Sat Jan 16 06:05:43 PST 2010
Douglas Gregor wrote:
> I actually like the idea of using 3 bits to say which of
> type/signedness/width were specified in the type, then just making sure
> that the SourceLocation points to something that makes sense... the type
> specifier location if it's there, otherwise the signedness or width
> location. That gives us a lot more information in the AST without
> costing much at all.
> Ah, okay. Let's not worry about the source range; a single *useful*
> location is good enough.
Here is a revised patch.
We store a single location for all builtin types where you cannot write
a width/sign specifier (void, char16, etc.).
For the others builtins, we have additional 4 bytes that are used to
store a total of 10 bits (instead of the 3 mentioned above): we found
that out initial analysis was incomplete in that we were not
considering, e.g., the possibility of having a 'mode' attribute
specifying the width of the builtin. Hence now we store:
- the TST (5 bits), TSW (2 bits) and TSS (2 bits) fields
**before** these are modified by the semantic analysis done
- in the 10th bit, whether or not the ModeAttr was given
**before** this is taken away by TakeAttributes().
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 11816 bytes
Desc: not available
More information about the cfe-dev