[PATCH] D70554: [libTooling] Add stencil combinators for nodes that may be pointers or values.

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 22 07:18:21 PST 2019


gribozavr2 marked an inline comment as done.
gribozavr2 added inline comments.


================
Comment at: clang/include/clang/Tooling/Transformer/Stencil.h:96
+// Constructs an expression that idiomatically represents a value, taking into
+// account whether `ExprId` is a pointer or already a value.
+Stencil asValue(llvm::StringRef ExprId);
----------------
ymandel wrote:
> gribozavr2 wrote:
> > 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()`?
> 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...
> Given that, I didn't elaborate on pointer-to-pointer case because it never claims to result in a value. WDYT?

I think it is clear what happens with pointers to pointers given the current doc comment.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70554/new/

https://reviews.llvm.org/D70554





More information about the cfe-commits mailing list