[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:

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  

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:

Thanks for the patches!


More information about the cfe-dev mailing list