[libTooling] Simplify type structure of `Stencil`s.
Summary: Currently, stencils are defined as a sequence of `StencilParts`. This differentiation adds an unneeded layer of complexity to the definition of Stencils. This change significantly simplifies the type structure: a stencil is now conceptually any object implementing `StencilInterface` and `Stencil` is just a thin wrapper for pointers to this interface. To account for the sequencing that was supported by the old `Stencil` type, we introduce a sequencing class that implements `StencilInterface`. That is, sequences are just another kind of Stencil and no longer have any special status. Corresponding to this change in the type structure, we change the way `cat` is used (and defined). `cat` bundles multiple features: it builds a stencil from a sequence of subcomponents and admits multiple different types for its arguments, while coercing them into the right type. Previously, `cat` was also used to coerce a single `StencilPart` into a `Stencil`. With that distinction gone, many uses of `cat` (e.g. in the tests) are unnecessary and have, therefore, been removed. Reviewers: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69613
Loading
Please register or sign in to comment