[clang] [clang] Do not serialize function definitions without a body (PR #121550)
Alejandro Álvarez Ayllón via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 6 00:28:10 PST 2025
================
@@ -6092,9 +6092,10 @@ void ASTWriter::WriteDeclUpdatesBlocks(ASTContext &Context,
// An updated body is emitted last, so that the reader doesn't need
// to skip over the lazy body to reach statements for other records.
- if (Kind == UPD_CXX_ADDED_FUNCTION_DEFINITION)
- HasUpdatedBody = true;
- else if (Kind == UPD_CXX_ADDED_VAR_DEFINITION)
+ if (Kind == UPD_CXX_ADDED_FUNCTION_DEFINITION) {
+ assert(isa<FunctionDecl>(D) && "expected FunctionDecl");
+ HasUpdatedBody = dyn_cast<FunctionDecl>(D)->hasBody();
+ } else if (Kind == UPD_CXX_ADDED_VAR_DEFINITION)
HasAddedVarDefinition = true;
else
----------------
alejandro-alvarez-sonarsource wrote:
Added
https://github.com/llvm/llvm-project/pull/121550
More information about the cfe-commits
mailing list