[PATCH] D50948: Change how LambdaDefinitionData is stored
Steve O'Brien via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Aug 19 13:37:18 PDT 2018
elsteveogrande created this revision.
Herald added a subscriber: cfe-commits.
Previously `LambdaDefinitionData` extended `DefinitionData` and either might have been used interchangably in a `CXXRecordDecl`'s `DefinitionData` field.
However there are cases where `LambdaDefinitionData` ("LDD") aren't copied or moved completely, into this `DefinitionData` ("DD") field, as it has additional members of its own.
This patch:
- makes LDD a separate structure, no longer using DD as the base class, but otherwise kept the same so as to encapsulate lambda stuff properly
- stores lambda data within an `Optional` called `LambdaData`
- replaces `IsLambda` bit with `bool isLambda() const`, true IFF lambda data are present in that optional field
- as the formerly-subclass's LDD constructor set some members on DD, this is now done in a new method `SetLambdaData`; this sets those fields to values sensible for lambdas, and emplaces lambda data in the optional field
This solves one case where lambda data were not handled quite properly.
Note that this doesn't solve all lambda-handling in `pcm`'s (clang modules) but is more of a refactoring pre-step.
Test Plan: `ninja check-clang-modules`
Repository:
rC Clang
https://reviews.llvm.org/D50948
Files:
include/clang/AST/DeclCXX.h
lib/AST/DeclCXX.cpp
lib/Serialization/ASTReaderDecl.cpp
lib/Serialization/ASTWriter.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50948.161405.patch
Type: text/x-patch
Size: 12761 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180819/dcb9bd6f/attachment-0001.bin>
More information about the cfe-commits
mailing list