[PATCH] D43494: [Modules] Fix creating fake definition data for lambdas.

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 12 11:18:41 PDT 2018


vsapsai marked 6 inline comments as done.
vsapsai added inline comments.


================
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));
----------------
rsmith wrote:
> `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).
`MergeDefinitionData` already has assertion `Canon->DefinitionData` is not null so adding assertion here doesn't add safety. And I don't think it would improve readability or make it easier to understand the code.


https://reviews.llvm.org/D43494





More information about the cfe-commits mailing list