Adds combinators maybeDeref and maybeAddressOf to provide a uniform way to handle
nodes which may be bound to either a pointer or a value (most often in the
context of member expressions). Such polymorphism is already supported by
access; these combinators extend it to more general uses.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 41322 Build 41523: arc lint + arc unit
Event Timeline
clang/include/clang/Tooling/Transformer/Stencil.h | ||
---|---|---|
95 | Three slashes, please. | |
96 | Need more explanation to cover the cases when the expression is a pointer to a pointer (do we deref once or twice?), or a smart pointer (do we take care of that at all?) WDYT about calling it maybeDeref() or derefIfPointer()? | |
99 | Three slashes, please. | |
101 | Similarly, maybeAddressOf()? |
Thanks for the review!
clang/include/clang/Tooling/Transformer/Stencil.h | ||
---|---|---|
96 | I went with maybe... Given that, I didn't elaborate on pointer-to-pointer case because it never claims to result in a value. WDYT? also, I kind of like derefIfPointer better, but addressOfIfValue just seemed to clunky. So, went w/ maybe... |
clang/include/clang/Tooling/Transformer/Stencil.h | ||
---|---|---|
96 |
I think it is clear what happens with pointers to pointers given the current doc comment. |
"If the expression \p ExprId has pointer type ..."