mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-21 14:16:37 +00:00
My intent with `Push` is to make it easier to see the ordering relationship between output and , at least in some cases. I'm using a variant with `Push`, but that could've also been a function with variadic arguments. The `ArrayRef` approach felt useful in that it generates less code, and allows the `PushItem` construction in `FunctionTypeWithSelfType` handling. Note I didn't really use that elsewhere, but in theory it could be. Adds support for `llvm::ListSeparator` in order to help eliminate `llvm::seq` use. Also increases the variant use here. The discriminated `Step` union was added in #4511, and it's not clear to me from that PR why variant wasn't used. In general I'm trying not to change API choices that were made there. I considered renaming all the `PushString` etc functions to just be `Push` overloads, but I'm on the fence about whether that's just going to be a naming bikeshed, so I left them alone. Also considered a `WriteAndPush("foo", {...});`, but that'd require merging `StepStack` and `Stringifier` and I'm hesitant to go ahead with that. This PR I view as more objective refactoring that hopefully makes everyone happier. --------- Co-authored-by: Richard Smith <richard@metafoo.co.uk>