[PATCH] D50948: lambdas in modules: change storage for LambdaDefinitionData

2018-09-19 Thread Steve O'Brien via Phabricator via cfe-commits
elsteveogrande added a comment. I did try a copy of https://reviews.llvm.org/D50949 again, locally and without this diff, to see if I can avoid messing with this structure altogether. But then I get a `SEGV`. The reason behind this diff is to try to make the logic a little safer, though it's

[PATCH] D50948: lambdas in modules: change storage for LambdaDefinitionData

2018-09-19 Thread Steve O'Brien via Phabricator via cfe-commits
elsteveogrande updated this revision to Diff 166148. elsteveogrande added a comment. Change `Optional` to `unique_ptr` instead, to at least save an allocation and keep the same semantics. Reverified with `ninja check-clang`. Repository: rC Clang https://reviews.llvm.org/D50948 Files:

[PATCH] D50948: lambdas in modules: change storage for LambdaDefinitionData

2018-09-18 Thread Steve O'Brien via Phabricator via cfe-commits
elsteveogrande added inline comments. Comment at: lib/Serialization/ASTReaderDecl.cpp:1771 auto *Def = DD.Definition; DD = std::move(MergeDD); DD.Definition = Def; Hi @rsmith, thanks again for looking! This is the part that I was concerned

[PATCH] D50948: lambdas in modules: change storage for LambdaDefinitionData

2018-09-18 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. We don't want to allocate storage for the lambda fields for non-lambda classes, which is why we use distinct base classes. Is the problem you're trying to solve here that we fake a definition in AST deserialization before we know whether the class is a lambda? If so,

[PATCH] D50948: lambdas in modules: change storage for LambdaDefinitionData

2018-09-18 Thread Steve O'Brien via Phabricator via cfe-commits
elsteveogrande updated this revision to Diff 165947. elsteveogrande added a comment. Rebase past dependency commit C341499, fix a conflict Repository: rC Clang https://reviews.llvm.org/D50948 Files: include/clang/AST/DeclCXX.h lib/AST/DeclCXX.cpp lib/Serialization/ASTReaderDecl.cpp