thakis added a comment.

Thanks for the test!

I think moving TextDiagnosticsPrinter to Basic is much better than making 
Format depend on Frontend. If you just want to fix your crash and be done with 
it, then doing that (and adding your test) is fine.

I think the best fix would be to change Basic to never emit diagnostics though. 
That would also fix this crash, and it'd completely remove clang-format's 
dependency on the huge array with all of clang's diag, which would 
significantly reduce the size of clang-format (iirc it'd cut it in half or 
something). This would need some reorganizing -- Basic would have to call some 
callback on errors instead, and in clang these callbacks would emit normal 
diags but in clang-format they'd do something else. If you wanted to look into 
that, that'd be amazing :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D90121

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

Reply via email to