[PATCH] D126796: [clang][driver] adds `-print-diagnostics`

2022-06-08 Thread Christopher Di Bella via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG288c1bff96fc: [clang][driver] adds `-print-diagnostics` (authored by cjdb). Changed prior to commit: https://reviews.llvm.org/D126796?vs=435223&id

[PATCH] D126796: [clang][driver] adds `-print-diagnostics`

2022-06-08 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Comment at: clang/lib/Basic/DiagnosticIDs.cpp:656 std::vector DiagnosticIDs::getDiagnosticFlags() { - std::vector Res; + std::vector Res{"-W", "-Wno-"}

[PATCH] D126796: [clang][driver] adds `-print-diagnostics`

2022-06-08 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added inline comments. Comment at: clang/include/clang/Driver/Options.td:829 def Xoffload_linker : JoinedAndSeparate<["-"], "Xoffload-linker">, - HelpText<"Pass to the offload linkers or the ones idenfied by -">, + HelpText<"Pass to the offload linkers or the ones ide

[PATCH] D126796: [clang][driver] adds `-print-diagnostics`

2022-06-08 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 435223. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126796/new/ https://reviews.llvm.org/D126796 Files: clang/include/clang/Driver/Options.td clang/lib/Basic/DiagnosticIDs.cpp clang/lib/Driver/Driver.cpp clang/test/Driver/print-diagnostic-opti

[PATCH] D126796: [clang][driver] adds `-print-diagnostics`

2022-06-08 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Thanks for this! Just some fairly minor nits from me. FWIW, the changes should also come with a release note so users know about the new command line option. Comment at: clang/include/clang/Driver/Options.td:829 def Xoffload_linker : JoinedAndSe

[PATCH] D126796: [clang][driver] adds `-print-diagnostics`

2022-06-02 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 433901. cjdb added a comment. - simplifies code - minimises test to only a handful of cases CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126796/new/ https://reviews.llvm.org/D126796 Files: clang/include/clang/Driver/Options.td clang/lib/Basic/Dia

[PATCH] D126796: [clang][driver] adds `-print-diagnostics`

2022-06-02 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. Okay, I understand why `-W` isn't being printed now, but the missing ones are still a bit baffling. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126796/new/ https://reviews.llvm.org/D126796 ___ cfe-commits mailing list

[PATCH] D126796: [clang][driver] adds `-print-diagnostics`

2022-06-02 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 433823. cjdb added a comment. Herald added subscribers: sstefan1, mgrang, aheejin. Herald added a reviewer: jdoerfert. - renames flag to `-print-diagnostic-options` - adds test - adds logic to get as many options to be visible as possible I'm very unhappy with t

[PATCH] D126796: [clang][driver] adds `-print-diagnostics`

2022-06-02 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D126796#3553708 , @MaskRay wrote: > If you still decide to add an option to clang, I think "diagnostics" is > better than "warnings". There are many diagnostics which are errors by > default. Good point about warnings

[PATCH] D126796: [clang][driver] adds `-print-diagnostics`

2022-06-02 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. If you still decide to add an option to clang, I think "diagnostics" is better than "warnings". There are many diagnostics which are errors by default. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126796/new/ https://revi

[PATCH] D126796: [clang][driver] adds `-print-diagnostics`

2022-06-02 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. In D126796#3551288 , @aaron.ballman wrote: > In D126796#3551280 , @MaskRay wrote: > >> In D126796#3551261 , @cjdb wrote: >> >>> In D126796#3550848 <

[PATCH] D126796: [clang][driver] adds `-print-diagnostics`

2022-06-02 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D126796#3551996 , @cjdb wrote: > In D126796#3551834 , @tschuett > wrote: > >> In D126796#3551781 , @cjdb wrote: >> >>> In D126796#355131

[PATCH] D126796: [clang][driver] adds `-print-diagnostics`

2022-06-01 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. In D126796#3551834 , @tschuett wrote: > In D126796#3551781 , @cjdb wrote: > >> In D126796#3551312 , @tschuett >> wrote: >> >>> Would a JSON dump hel

[PATCH] D126796: [clang][driver] adds `-print-diagnostics`

2022-06-01 Thread Thorsten via Phabricator via cfe-commits
tschuett added a comment. In D126796#3551781 , @cjdb wrote: > In D126796#3551312 , @tschuett > wrote: > >> Would a JSON dump help you for your tools? > > Do you think a JSON dump would be more appropriate? I was

[PATCH] D126796: [clang][driver] adds `-print-diagnostics`

2022-06-01 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. In D126796#3551312 , @tschuett wrote: > Would a JSON dump help you for your tools? Do you think a JSON dump would be more appropriate? I was just going for something not unlike `--help` here. Repository: rG LLVM Github Monorepo

[PATCH] D126796: [clang][driver] adds `-print-diagnostics`

2022-06-01 Thread Thorsten via Phabricator via cfe-commits
tschuett added a comment. Would a JSON dump help you for your tools? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126796/new/ https://reviews.llvm.org/D126796 ___ cfe-commits mailing list cfe-commits@li

[PATCH] D126796: [clang][driver] adds `-print-diagnostics`

2022-06-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D126796#3551280 , @MaskRay wrote: > In D126796#3551261 , @cjdb wrote: > >> In D126796#3550848 , @MaskRay >> wrote: >> >>> FYI `diagtool

[PATCH] D126796: [clang][driver] adds `-print-diagnostics`

2022-06-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D126796#3551261 , @cjdb wrote: > In D126796#3550848 , @MaskRay wrote: > >> FYI `diagtool tree` dumps the diagnostics. You can even provide -W options >> and observe the differenc

[PATCH] D126796: [clang][driver] adds `-print-diagnostics`

2022-06-01 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D126796#3551261 , @cjdb wrote: > In D126796#3550848 , @MaskRay wrote: > >> FYI `diagtool tree` dumps the diagnostics. You can even provide -W options >> and observe the differences. >

[PATCH] D126796: [clang][driver] adds `-print-diagnostics`

2022-06-01 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. In D126796#3550848 , @MaskRay wrote: > FYI `diagtool tree` dumps the diagnostics. You can even provide -W options > and observe the differences. Is `diagtool tree` something that users widely know about? Repository: rG LLVM Git

[PATCH] D126796: [clang][driver] adds `-print-diagnostics`

2022-06-01 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. FYI `diagtool tree` dumps the diagnostics. You can even provide -W options and observe the differences. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126796/new/ https://reviews.llvm.org/D126796 __

[PATCH] D126796: [clang][driver] adds `-print-diagnostics`

2022-06-01 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. I haven't added a test because I'm not sure how we can reasonably test this without keeping a file that holds all the warnings and using FileCheck. I'm okay with that, but want to make sure it's the best thing to do. Repository: rG LLVM Github Monorepo CHANGES SINCE LA

[PATCH] D126796: [clang][driver] adds `-print-diagnostics`

2022-06-01 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb created this revision. cjdb added a reviewer: aaron.ballman. Herald added a project: All. cjdb requested review of this revision. Herald added subscribers: cfe-commits, MaskRay. Herald added a project: clang. Prints a list of all the warnings that Clang offers. Repository: rG LLVM Github