[PATCH] D152090: [clang][Driver] Add -fcaret-diagnostics-max-lines= as a driver option

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 11 10:54:20 PDT 2023


MaskRay accepted this revision.
MaskRay added a comment.
This revision is now accepted and ready to land.

LGTM.



================
Comment at: clang/include/clang/Driver/Options.td:2303
+  Group<f_Group>, Flags<[NoXarchOption, CC1Option, CoreOption]>,
+  HelpText<"Set the maximum number of source lines to show in a caret diagnostic">,
+  MarshallingInfoInt<DiagnosticOpts<"SnippetLineLimit">, "DiagnosticOptions::DefaultSnippetLineLimit">;
----------------
MaskRay wrote:
> Add ` (0 = no limit)` if useful
`NoXarchOption` emits an error if an option is used after `-Xarch_*`. The feature only applies to a small set of options (e.g. `-o`) and is not very useful for most options, but `NoXarchOption` was improperly named `DriverOption` and lured some contributors to add `NoXarchOption` to options that should not have the flag.

For `fcaret-diagnostics-max-lines=`, we should remove `NoXarchOption`.


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

https://reviews.llvm.org/D152090



More information about the cfe-commits mailing list