diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/AST/StmtPrinter.cpp | 3 | ||||
-rw-r--r-- | clang/lib/AST/StmtSerialization.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 3 |
3 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp index 5e347435b63..dc686f9bf59 100644 --- a/clang/lib/AST/StmtPrinter.cpp +++ b/clang/lib/AST/StmtPrinter.cpp @@ -513,8 +513,9 @@ void StmtPrinter::VisitPreDefinedExpr(PreDefinedExpr *Node) { } void StmtPrinter::VisitCharacterLiteral(CharacterLiteral *Node) { - // FIXME should print an L for wchar_t constants unsigned value = Node->getValue(); + if (Node->isWide()) + OS << "L"; switch (value) { case '\\': OS << "'\\\\'"; diff --git a/clang/lib/AST/StmtSerialization.cpp b/clang/lib/AST/StmtSerialization.cpp index 99a890946de..6fcc1ef4282 100644 --- a/clang/lib/AST/StmtSerialization.cpp +++ b/clang/lib/AST/StmtSerialization.cpp @@ -375,14 +375,16 @@ CastExpr* CastExpr::CreateImpl(Deserializer& D, ASTContext& C) { void CharacterLiteral::EmitImpl(Serializer& S) const { S.Emit(Value); S.Emit(Loc); + S.EmitBool(IsWide); S.Emit(getType()); } CharacterLiteral* CharacterLiteral::CreateImpl(Deserializer& D, ASTContext& C) { unsigned value = D.ReadInt(); SourceLocation Loc = SourceLocation::ReadVal(D); + bool iswide = D.ReadBool(); QualType T = QualType::ReadVal(D); - return new CharacterLiteral(value,T,Loc); + return new CharacterLiteral(value,iswide,T,Loc); } void CompoundAssignOperator::EmitImpl(Serializer& S) const { diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index e918572f35f..e84971062ed 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -183,7 +183,8 @@ Sema::ExprResult Sema::ActOnCharacterConstant(const Token &Tok) { QualType type = getLangOptions().CPlusPlus ? Context.CharTy : Context.IntTy; - return new CharacterLiteral(Literal.getValue(), type, Tok.getLocation()); + return new CharacterLiteral(Literal.getValue(), Literal.isWide(), type, + Tok.getLocation()); } Action::ExprResult Sema::ActOnNumericConstant(const Token &Tok) { |