[PCH] Support writing BuiltinBitCastExprs to PCHs
eee944e7f adds the new BuiltinBitCastExpr, but does not set the Code member of
ASTStmtWriter. This is not correct and causes an assertion failue in
ASTStmtWriter::emit() when building PCHs that contain __builtin_bit_cast. This
commit adds serialization::EXPR_BUILTIN_BIT_CAST and handles
ASTStmtWriter::Code properly.
Differential revision: https://reviews.llvm.org/D80360
diff --git a/clang/lib/Serialization/ASTReaderStmt.cpp b/clang/lib/Serialization/ASTReaderStmt.cpp
index 5c7bc7a..86895c3 100644
--- a/clang/lib/Serialization/ASTReaderStmt.cpp
+++ b/clang/lib/Serialization/ASTReaderStmt.cpp
@@ -3618,6 +3618,11 @@
/*PathSize*/ Record[ASTStmtReader::NumExprFields]);
break;
+ case EXPR_BUILTIN_BIT_CAST:
+ assert(Record[ASTStmtReader::NumExprFields] == 0 && "Wrong PathSize!");
+ S = new (Context) BuiltinBitCastExpr(Empty);
+ break;
+
case EXPR_USER_DEFINED_LITERAL:
S = UserDefinedLiteral::CreateEmpty(
Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields], Empty);