D62825 adds the new BuiltinBitCastExpr, but does not set the Code member of ASTStmtWriter. This is not correct and causes an assertion failue (assert(Code != serialization::STMT_NULL_PTR && "unhandled sub-statement writing AST file")) in ASTStmtWriter::emit() when building PCHs that contain __builtin_bit_cast. This patch adds serialization::EXPR_BUILTIN_BIT_CAST and handles ASTStmtWriter::Code properly.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM (after a minor comment), thank you for fixing this!
clang/lib/Serialization/ASTReaderStmt.cpp | ||
---|---|---|
3598 | PathSize should always be zero, so I think it makes more sense to assert(Record[ASTStmtReader::NumExprFields] == 0); here and remove the PathSize parameter from the BuiltinBitCastExpr constructor. |
Address the comment: remove PathSize from BuiltinBitCastExpr's constructor and assert() it == 0.
If this is OK, please commit it with --author "hyd-dev <yd-huang@outlook.com>". Thanks.
clang-format: please reformat the code
6 diff lines are omitted. See full diff.