dexonsmith added a comment.

Another thing to consider: a client that wants the minimized source to be "no 
bigger than" the original source can use the original source if it ends up 
growing. For example, https://reviews.llvm.org/D104462 could check the 
resulting size, and just return the original source in the (extremely 
unlikely?) corner case where the minimized sources are bigger.

In that case, we wouldn't need this patch's assertion.

I bet some of these changes are good to do anyway (like dropping the 
`/*invalid*/` comment, which was useful as a canary-in-the-coal-mine when 
testing the prototype on large bodies of sources (and maybe has outlived its 
usefulness)), but you could skip the fiddly changes here that complicate the 
logic and make the output less canonical and harder to read, like "maintain 0 
whitespace after macro names" and "maintain missing newline at EOF".


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104459

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D104459: [... Jan Svoboda via Phabricator via cfe-commits
    • [PATCH] D1044... Jan Svoboda via Phabricator via cfe-commits
    • [PATCH] D1044... Duncan P. N. Exon Smith via Phabricator via cfe-commits
    • [PATCH] D1044... Duncan P. N. Exon Smith via Phabricator via cfe-commits

Reply via email to