[PATCH] D138939: [WIP][clang] adds a way to provide user-oriented reasons

Christopher Di Bella via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 29 12:21:32 PST 2022


cjdb created this revision.
cjdb added reviewers: aaron.ballman, erichkeane, shafik.
Herald added subscribers: carlosgalvezp, kadircet, arphaman.
Herald added a reviewer: njames93.
Herald added projects: Flang, All.
cjdb requested review of this revision.
Herald added subscribers: cfe-commits, libcxx-commits, lldb-commits, jdoerfert.
Herald added projects: clang, LLDB, libc++abi, clang-tools-extra.
Herald added a reviewer: libc++abi.

Part of the [revised diagnostic model][1] is to provide users with
diagnostics that explain what's going wrong from their perspective,
as opposed to from the compiler's perspective. This may be achieved
through a rewording of the reason, or by provididng more info, or both.

This commit also changes the diagnostic for an explicit template
parameter gone wrong to demonstrate how it works.

NOTE: this is a work-in-progress. Most of the work has been fleshed out,
but the note needs to be provided with the kind of template argument it
is given. I'm looking into doing this, but it seems to require a lot of
tedious manual changes, and I'd prefer to get input on the changes that
are currently in the diff before making those extra changes (which will
distract from the current stuff, and may ultimately be unnecessary if
the current direction is undesirable).

[1]: https://discourse.llvm.org/t/rfc-improving-clang-s-diagnostics/62584


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138939

Files:
  clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
  clang-tools-extra/clangd/Compiler.cpp
  clang-tools-extra/clangd/Diagnostics.cpp
  clang/include/clang/Basic/Diagnostic.h
  clang/include/clang/Basic/Diagnostic.td
  clang/include/clang/Basic/DiagnosticAST.h
  clang/include/clang/Basic/DiagnosticAnalysis.h
  clang/include/clang/Basic/DiagnosticComment.h
  clang/include/clang/Basic/DiagnosticCrossTU.h
  clang/include/clang/Basic/DiagnosticDriver.h
  clang/include/clang/Basic/DiagnosticFrontend.h
  clang/include/clang/Basic/DiagnosticIDs.h
  clang/include/clang/Basic/DiagnosticLex.h
  clang/include/clang/Basic/DiagnosticParse.h
  clang/include/clang/Basic/DiagnosticRefactoring.h
  clang/include/clang/Basic/DiagnosticSema.h
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/include/clang/Basic/DiagnosticSerialization.h
  clang/include/clang/Basic/PartialDiagnostic.h
  clang/include/clang/Frontend/ASTUnit.h
  clang/include/clang/Frontend/DiagnosticRenderer.h
  clang/lib/Basic/Diagnostic.cpp
  clang/lib/Basic/DiagnosticIDs.cpp
  clang/lib/Format/TokenAnalyzer.cpp
  clang/lib/Frontend/ASTUnit.cpp
  clang/lib/Frontend/LogDiagnosticPrinter.cpp
  clang/lib/Frontend/SARIFDiagnosticPrinter.cpp
  clang/lib/Frontend/SerializedDiagnosticPrinter.cpp
  clang/lib/Frontend/TextDiagnosticBuffer.cpp
  clang/lib/Frontend/TextDiagnosticPrinter.cpp
  clang/lib/Sema/SemaOverload.cpp
  clang/test/Frontend/sarif-reason.cpp
  clang/test/TableGen/DiagnosticBase.inc
  clang/test/TableGen/deferred-diag.td
  clang/tools/clang-format/ClangFormat.cpp
  clang/tools/clang-import-test/clang-import-test.cpp
  clang/tools/diagtool/DiagnosticNames.cpp
  clang/unittests/Driver/SimpleDiagnosticConsumer.h
  clang/unittests/Driver/ToolChainTest.cpp
  clang/unittests/Frontend/FrontendActionTest.cpp
  clang/unittests/Tooling/RewriterTestContext.h
  clang/utils/TableGen/ClangDiagnosticsEmitter.cpp
  flang/lib/Frontend/TextDiagnosticBuffer.cpp
  flang/lib/Frontend/TextDiagnosticPrinter.cpp
  libcxxabi/test/test_demangle.pass.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
  lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138939.478675.patch
Type: text/x-patch
Size: 74929 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221129/24696df1/attachment-0001.bin>


More information about the cfe-commits mailing list