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
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM (after a minor comment), thank you for fixing this!
clang/lib/Serialization/ASTReaderStmt.cpp | ||
---|---|---|
3623 | 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. |
Comment Actions
Address the comment: remove PathSize from BuiltinBitCastExpr's constructor and assert() it == 0.
Comment Actions
If this is OK, please commit it with --author "hyd-dev <yd-huang@outlook.com>". Thanks.
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.