wchar printer

This removes one FIXME by arranging for wide characters to be printed correctly.

wchar.patch (2.55 KB)

+ CharacterLiteral(unsigned value, bool iswide, QualType type, SourceLocation l)
+ : Expr(CharacterLiteralClass, type), Value(value), IsWide(iswide), Loc(l) {

You need to have "IsWide" the last in the initialization list. Otherwise, the compiler will complain with -Wall.

void CharacterLiteral::EmitImpl(Serializer& S) const {
    S.Emit(Value);
+ S.EmitBool(IsWide);
    S.Emit(Loc);
    S.Emit(getType());
  }

Why not emit in the same order that the variables are defined in the class?

  class CharacterLiteral : public Expr {
    unsigned Value;
    SourceLocation Loc;
+ bool IsWide;
  public:

Same below:

CharacterLiteral* CharacterLiteral::CreateImpl(Deserializer& D, ASTContext& C) {
    unsigned value = D.ReadInt();
+ bool iswide = D.ReadBool();
    SourceLocation Loc = SourceLocation::ReadVal(D);
    QualType T = QualType::ReadVal(D);
- return new CharacterLiteral(value,T,Loc);
+ return new CharacterLiteral(value,iswide,T,Loc);
  }

-bw

This removes one FIXME by arranging for wide characters to be printed correctly.

+ CharacterLiteral(unsigned value, bool iswide, QualType type, SourceLocation l)
+ : Expr(CharacterLiteralClass, type), Value(value), IsWide(iswide), Loc(l) {

You need to have "IsWide" the last in the initialization list.

Done.

void CharacterLiteral::EmitImpl(Serializer& S) const {
  S.Emit(Value);
+ S.EmitBool(IsWide);
  S.Emit(Loc);
  S.Emit(getType());
}

Why not emit in the same order that the variables are defined in the class?

Done.

Same below:

Done.

Thanks.

wchar-1a.patch (2.51 KB)

Applied, thanks Mike!
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080602/006068.html

-Chris