Skip to content

Commit

Permalink
[Serialization] Use packed bits to initialize UserDefinedLiteral
Browse files Browse the repository at this point in the history
UserDefinedLiteral is also a sub class of CallExpr but we forgot to
initialize it in the same way as other sub classes of CallExpr.
  • Loading branch information
ChuanqiXu9 committed Dec 11, 2023
1 parent 276a024 commit 2ce9a79
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions clang/lib/Serialization/ASTReaderStmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3851,11 +3851,14 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
S = new (Context) BuiltinBitCastExpr(Empty);
break;

case EXPR_USER_DEFINED_LITERAL:
S = UserDefinedLiteral::CreateEmpty(
Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields],
/*HasFPFeatures=*/Record[ASTStmtReader::NumExprFields + 1], Empty);
case EXPR_USER_DEFINED_LITERAL: {
BitsUnpacker CallExprBits(Record[ASTStmtReader::NumExprFields]);
auto NumArgs = CallExprBits.getNextBits(/*Width=*/16);
auto HasFPFeatures = CallExprBits.getNextBit();
S = UserDefinedLiteral::CreateEmpty(Context, NumArgs, HasFPFeatures,
Empty);
break;
}

case EXPR_CXX_STD_INITIALIZER_LIST:
S = new (Context) CXXStdInitializerListExpr(Empty);
Expand Down

0 comments on commit 2ce9a79

Please sign in to comment.