[PATCH] D120360: [libTooling] Generalize string explanation as Any metadata

Eric Li via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 23 12:28:05 PST 2022


li.zhe.hua marked an inline comment as done.
li.zhe.hua added a comment.

In D120360#3341118 <https://reviews.llvm.org/D120360#3341118>, @ymandel wrote:

> High level question: why use `Any` rather than templating?

(Aside: Not sure how to "respond" to comments... just quote in a new comment?)

So, I had a version of this, but I ended up bifurcating the type into `RewriteRule` (with no metadata) and `RewriteRuleWith<T>` (with `T` metadata). I wasn't sure if the cost of having two types here was worth it. For interfaces that didn't care about the metadata generation, there wasn't an easy way to accept a `RewriteRule`-like parameter.

Finally, there was a question of migration. All uses of `RewriteRule` with `TransformerClangTidyCheck` would need to switch over to `RewriteRuleWith<std::string>`, and I wasn't sure how pervasive that might be. I'm not set on `Any`, but splitting the type does seem rather costly.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120360



More information about the cfe-commits mailing list