sammccall added a comment.

Oh dear, this seems like a design bug.

TokenBuffer only attempts to record "top-level" expansions, i.e. 
`FOO(BAR(BAZ))` will record the expansion of FOO, and say the tokens `FOO ( BAR 
( BAZ ) )` were expanded into `some other thing` in an essentially-opaque way.
The problem is this conflates two notions of "top-level"

- macro use is in main file (this is what the PPCallbacks checks)
- tokens emitted by the expansion are in the final expanded token stream (this 
is what makes the code correct, and I think what we're asserting)

The second seems more fundamental, so we should try patching the code to avoid 
the former. But I worry there are subtle assumptions of this scattered 
through...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77507



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to