[PATCH] D43494: [Modules] Fix creating fake definition data for lambdas.
Richard Smith - zygoloid via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 9 11:51:29 PST 2018
rsmith added inline comments.
================
Comment at: clang/lib/Serialization/ASTReaderDecl.cpp:1789
+ // set fake one.
+ if (!Canon->DefinitionData) {
+ Canon->DefinitionData = DD;
----------------
No braces around single-line `if` bodies, please.
================
Comment at: clang/lib/Serialization/ASTReaderDecl.cpp:1798
+ // already done some merging. Either way, just merge into it.
+ if (Canon->DefinitionData && Canon->DefinitionData != DD) {
MergeDefinitionData(Canon, std::move(*DD));
----------------
`Canon->DefinitionData` can't be null here, so the first half of this check is redundant. If you're concerned about that, you can add an assert that it's equal to `D->DefinitionData` (and that both are non-null).
================
Comment at: clang/lib/Serialization/ASTReaderDecl.cpp:1800
MergeDefinitionData(Canon, std::move(*DD));
D->DefinitionData = Canon->DefinitionData;
return;
----------------
This store is dead.
https://reviews.llvm.org/D43494
More information about the cfe-commits
mailing list