[PATCH] D125311: [pseudo] Share the underly payload when stripping comments for a token stream

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 18 12:59:07 PDT 2022


hokein added a comment.

In D125311#3503452 <https://reviews.llvm.org/D125311#3503452>, @sammccall wrote:

> This looks good, but if that's the idiom we should add it to cook() also.

cook is more tricky, it takes a TokenStream, and returns a new one with an allocator payload:

- the input TokenStream doesn't have a payload, this is OK
- the input TokenStream has a payload, but what if the type of payload is not an allocator?

Possible solution: 1) always assert the input TokenStream doesn't have a payload or the payload is allocator type 2) merge the lex and cook function, it looks like we always use the cook one.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125311



More information about the cfe-commits mailing list