[PATCH] D137996: Add support for a backdoor driver option that enables emitting header usage information in JSON to a file

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 6 12:06:29 PST 2022


ahatanak added inline comments.


================
Comment at: clang/lib/Frontend/HeaderIncludeGen.cpp:161
+  case HIF_Textual: {
+    assert(!DepOpts.HeaderIncludeFiltering &&
+           "header filtering is currently always disabled when output format is"
----------------
jansvoboda11 wrote:
> I don't think asserting on invalid user input is a good strategy. Let's emit a diagnostic and exit gracefully instead.
The combination of `(textual,filtering)` is rejected by the driver, so the assertion should always succeed if the user invoked the driver and set the environment variables. Do we need a diagnostic for the case where `-header-include-format` and `-header-include-filtering` are passed on the CC1 command line by the user?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137996



More information about the cfe-commits mailing list