Add support for merging lifetime-extended temporaries
Details
- Reviewers
rsmith - Commits
- rG9ec6d7121132: [clang][modules] Add support for merging lifetime-extended temporaries
rGa3cbe1a202df: [clang][modules] Add support for merging lifetime-extended temporaries
rG85c743847789: [clang][modules] Add support for merging lifetime-extended temporaries
rG3c7f6b439699: [clang][modules] Add support for merging lifetime-extended temporaries
Diff Detail
Event Timeline
Functionally, this looks good, thanks.
clang/include/clang/Serialization/ASTReader.h | ||
---|---|---|
555 | Typos: "[...] merging. -> "[...] merging, | |
clang/lib/AST/TextNodeDumper.cpp | ||
1349–1350 | We shouldn't need this: the address of the declaration is dumped anyway by the infrastructure. (If you meant to dump the subexpression, I don't think that's what this does.) Traversing from the LifetimeExtendedTemporaryDecl to its subexpression for dumping purposes should be done by ASTNodeTraverser (in include/clang/AST/ASTNodeTraverser.h). | |
clang/lib/Serialization/ASTReaderDecl.cpp | ||
2591 | * on the right, please. | |
2599 | This case is essentially entirely different from the primary implementation of mergeMergeable. Consider adding an overload or explicit specialization for the LifetimeExtendedTemporaryDecl case instead; we don't need the branch on the dyn_cast result below, and we don't need the allowODRLikeMergeInC check above (because lifetime-extended temporaries only exist in C++). | |
2600 | We shouldn't be dumping from here :) | |
2602 | Prefer the normal container interface here -- insert or operator[] -- rather than the nonstandard extension FindAndConstruct. |
clang/lib/AST/TextNodeDumper.cpp | ||
---|---|---|
1349–1350 | I needed it during debugging and I thought i could be useful to others. but yes it is unreachable from -ast-dump
it dumps the value of the pointer which can be used to know which MaterializedTemporaryExpr it is associated with. |
clang/lib/AST/TextNodeDumper.cpp | ||
---|---|---|
1349–1350 | ill add the traversal in the previous patch and remove subexpr here because it is better |
clang/test/Modules/Inputs/merge-lifetime-extended-temporary/module.modulemap | ||
---|---|---|
15 | Add newline here. Dtto in other tests above. |
Typos:
"[...] merging.
containg the [...]"
->
"[...] merging,
containing the [...]"