[cfe-commits] r163863 - in /cfe/trunk: lib/Serialization/ASTWriterDecl.cpp test/PCH/cxx_exprs.cpp test/PCH/cxx_exprs.h

Eli Friedman eli.friedman at gmail.com
Thu Sep 13 17:51:37 PDT 2012


Author: efriedma
Date: Thu Sep 13 19:51:36 2012
New Revision: 163863

URL: http://llvm.org/viewvc/llvm-project?rev=163863&view=rev
Log:
Fix abbreviation for CharacterLiteral in AST serialization.  PR13806.


Modified:
    cfe/trunk/lib/Serialization/ASTWriterDecl.cpp
    cfe/trunk/test/PCH/cxx_exprs.cpp
    cfe/trunk/test/PCH/cxx_exprs.h

Modified: cfe/trunk/lib/Serialization/ASTWriterDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterDecl.cpp?rev=163863&r1=163862&r2=163863&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTWriterDecl.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTWriterDecl.cpp Thu Sep 13 19:51:36 2012
@@ -1619,7 +1619,7 @@
   //Character Literal
   Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // getValue
   Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Location
-  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); //IsWide
+  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2)); // getKind
   CharacterLiteralAbbrev = Stream.EmitAbbrev(Abv);
 
   Abv = new BitCodeAbbrev();

Modified: cfe/trunk/test/PCH/cxx_exprs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/cxx_exprs.cpp?rev=163863&r1=163862&r2=163863&view=diff
==============================================================================
--- cfe/trunk/test/PCH/cxx_exprs.cpp (original)
+++ cfe/trunk/test/PCH/cxx_exprs.cpp Thu Sep 13 19:51:36 2012
@@ -37,3 +37,9 @@
 // CXXTypeidExpr
 typeid_result1 typeid_1 = 0;
 typeid_result2 typeid_2 = 0;
+
+// CharacterLiteral variants
+static_assert(char_value == 97, "char_value is correct");
+static_assert(wchar_t_value == 305, "wchar_t_value is correct");
+static_assert(char16_t_value == 231, "char16_t_value is correct");
+static_assert(char32_t_value == 8706, "char32_t_value is correct");

Modified: cfe/trunk/test/PCH/cxx_exprs.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/cxx_exprs.h?rev=163863&r1=163862&r2=163863&view=diff
==============================================================================
--- cfe/trunk/test/PCH/cxx_exprs.h (original)
+++ cfe/trunk/test/PCH/cxx_exprs.h Thu Sep 13 19:51:36 2012
@@ -81,3 +81,8 @@
   return CtorStruct(1, 3.14f); // CXXTemporaryObjectExpr
 };
 
+// CharacterLiteral variants
+const char char_value = 'a';
+const wchar_t wchar_t_value = L'ı';
+const char16_t char16_t_value = u'ç';
+const char32_t char32_t_value = U'∂';





More information about the cfe-commits mailing list