[cfe-dev] Codegen for Character Literals and Conditional Operator

Chris Lattner clattner at apple.com
Fri Jul 13 17:01:28 PDT 2007


On Jul 13, 2007, at 4:44 PM, Keith Bauer wrote:

> Attached are patches to fix character literal printing (though there's
> still a slightly-less-than-desirable case that maybe should use a \u
> escape?) and assert when you try to ?: with an aggregate type, as
> requested.
>
> -Keith
> <CharacterLiteralPrinting.diff>
> <ConditionalAggregateAssert.diff>

Thanks, I applied the first one:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of- 
Mon-20070709/001243.html

The second one isn't quite right.  "Scalar" types in C include  
complex numbers, which are "aggregate" types according to LLVM (and  
to the LLVM lowering stuff).  The correct predicate would be  
RValue::isScalar() (which checks to see whether it's an LLVM scalar  
type).

However, getVal() already checks this, so this is already checked.  I  
don't think it's worth adding another explicit check.  I did add this  
fixme though:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of- 
Mon-20070709/001244.html

Thanks for the patches!

-Chris



More information about the cfe-dev mailing list