[PATCH] D147875: [clang][Diagnostics] WIP: Show line numbers when printing code snippets

2023-04-20 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. CCing @njames93 since I have no idea how to properly fix the clang-tidy test failures. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147875/new/ https://reviews.llvm.org/D147875 ___ cfe-commits mailing list cfe-commi

[PATCH] D147875: [clang][Diagnostics] WIP: Show line numbers when printing code snippets

2023-04-20 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 515242. tbaeder added a comment. Fix all existing tests CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147875/new/ https://reviews.llvm.org/D147875 Files: clang/include/clang/Basic/DiagnosticOptions.def clang/include/clang/Basic/DiagnosticOption

[PATCH] D147875: [clang][Diagnostics] WIP: Show line numbers when printing code snippets

2023-04-19 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 514954. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147875/new/ https://reviews.llvm.org/D147875 Files: clang/include/clang/Basic/DiagnosticOptions.def clang/include/clang/Basic/DiagnosticOptions.h clang/include/clang/Driver/Options.td clan

[PATCH] D147875: [clang][Diagnostics] WIP: Show line numbers when printing code snippets

2023-04-19 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147875/new/ https://reviews.llvm.org/D147875 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D147875: [clang][Diagnostics] WIP: Show line numbers when printing code snippets

2023-04-13 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 513144. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147875/new/ https://reviews.llvm.org/D147875 Files: clang/include/clang/Basic/DiagnosticOptions.def clang/include/clang/Basic/DiagnosticOptions.h clang/include/clang/Driver/Options.td clan

[PATCH] D147875: [clang][Diagnostics] WIP: Show line numbers when printing code snippets

2023-04-12 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Since basically nobody has seen multiple snippet lines being printed, we probably need to fix up a bunch of diagnostics afterwards to be more useful, e.g. ./array.cpp:111:5: error: no matching function for call to 'func' 111 | func(1, 2, 3, 4), "hah, reason!")

[PATCH] D147875: [clang][Diagnostics] WIP: Show line numbers when printing code snippets

2023-04-12 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 512795. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147875/new/ https://reviews.llvm.org/D147875 Files: clang/include/clang/Basic/DiagnosticOptions.def clang/include/clang/Basic/DiagnosticOptions.h clang/include/clang/Driver/Options.td clan

[PATCH] D147875: [clang][Diagnostics] WIP: Show line numbers when printing code snippets

2023-04-12 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 512785. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147875/new/ https://reviews.llvm.org/D147875 Files: clang/include/clang/Basic/DiagnosticOptions.def clang/include/clang/Basic/DiagnosticOptions.h clang/include/clang/Driver/Options.td clan

[PATCH] D147875: [clang][Diagnostics] WIP: Show line numbers when printing code snippets

2023-04-12 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 512784. tbaeder set the repository for this revision to rG LLVM Github Monorepo. Herald added a subscriber: MaskRay. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147875/new/ https://reviews.llvm.org/D147875 Fil

[PATCH] D147875: [clang][Diagnostics] WIP: Show line numbers when printing code snippets

2023-04-11 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder marked an inline comment as done. tbaeder added a comment. Wow, in `FixIt/fixits-function-call`, this output: ./array.cpp:123:3: error: no matching function for call to 'f1' f1(a + 1); ^~ ./array.cpp:114:6: note: candidate function not viable: no known conversion from 'intTy2

[PATCH] D147875: [clang][Diagnostics] WIP: Show line numbers when printing code snippets

2023-04-10 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. I have no opinion on this addition. If folks find it useful in GCC, happy to see it added. Comment at: clang/lib/Frontend/TextDiagnostic.cpp:1139 +return 7; + return 0; +} I'd prefer this to be an assert rather than returning a value

[PATCH] D147875: [clang][Diagnostics] WIP: Show line numbers when printing code snippets

2023-04-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. GCC emits line numbers by default these days, so it seems reasonable for Clang to do so as well. Having a way to disable the feature is important though as some folks have scripts that scrap diagnostic results and changing the format may break those scripts in cha

[PATCH] D147875: [clang][Diagnostics] WIP: Show line numbers when printing code snippets

2023-04-09 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 512024. tbaeder edited the summary of this revision. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147875/new/ https://reviews.llvm.org/D147875 Files: clang/include/clang/Frontend/TextDiagnostic.h clang/lib/Frontend/TextDiagnostic.cpp Index: cla

[PATCH] D147875: [clang][Diagnostics] WIP: Show line numbers when printing code snippets

2023-04-09 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/Frontend/TextDiagnostic.cpp:1141 +} + /// Emit a code snippet and caret line. Wrote this just to get things going but I hope there's something better than this...? Repository: rG LLVM Github Monorepo CHA

[PATCH] D147875: [clang][Diagnostics] WIP: Show line numbers when printing code snippets

2023-04-09 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, cjdb. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Just putting this here because it's a pretty simple patch as it turns out. Ca