This extends smart pointer support beyond the existing maybeDeref and
maybeAddressOf.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks!
clang/unittests/Tooling/StencilTest.cpp | ||
---|---|---|
410 | Hmm. Looks like we could use smart pointer support in tooling::buildAddressOf as well. If you're interested, the code is at |
clang/unittests/Tooling/StencilTest.cpp | ||
---|---|---|
410 | I don't think this particular output "(*x).field" is from buildAddressOf. Instead, it's in buildDot where *x is x.operator*() instead of UO_Deref. Yes, there's potential improvement but at least it's correct output comparing to this change which fixes "x->->field" so I'm leaving it along just adding the test case to highlight the potential. As for buildAddressOf, we shouldn't change &*x to x when x is a smart pointer -- the types don't match and may result in ill-typed expressions. |
Hmm. Looks like we could use smart pointer support in tooling::buildAddressOf as well. If you're interested, the code is at
clang/lib/Tooling/Transformer/SourceCodeBuilders.cpp line 94
but I understand if you want to stop here. :)