[all-commits] [llvm/llvm-project] bf1701: Add 'enum_select' diagnostic selection to clang. (...

Erich Keane via All-commits all-commits at lists.llvm.org
Wed Jan 15 12:59:29 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bf17016a92bc8a23d2cdd2b51355dd4eb5019c68
      https://github.com/llvm/llvm-project/commit/bf17016a92bc8a23d2cdd2b51355dd4eb5019c68
  Author: Erich Keane <ekeane at nvidia.com>
  Date:   2025-01-15 (Wed, 15 Jan 2025)

  Changed paths:
    M clang/docs/InternalsManual.rst
    M clang/include/clang/Basic/CMakeLists.txt
    M clang/include/clang/Basic/DiagnosticAST.h
    M clang/include/clang/Basic/DiagnosticAnalysis.h
    M clang/include/clang/Basic/DiagnosticComment.h
    M clang/include/clang/Basic/DiagnosticCrossTU.h
    M clang/include/clang/Basic/DiagnosticDriver.h
    M clang/include/clang/Basic/DiagnosticFrontend.h
    M clang/include/clang/Basic/DiagnosticInstallAPI.h
    M clang/include/clang/Basic/DiagnosticLex.h
    M clang/include/clang/Basic/DiagnosticParse.h
    M clang/include/clang/Basic/DiagnosticRefactoring.h
    M clang/include/clang/Basic/DiagnosticSema.h
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Basic/DiagnosticSerialization.h
    M clang/lib/Sema/SemaDeclCXX.cpp
    A clang/test/TableGen/select-enum-errors.td
    A clang/test/TableGen/select-enum.td
    M clang/utils/TableGen/ClangDiagnosticsEmitter.cpp
    M clang/utils/TableGen/TableGen.cpp
    M clang/utils/TableGen/TableGenBackends.h

  Log Message:
  -----------
  Add 'enum_select' diagnostic selection to clang. (#122505)

This causes us to generate an enum to go along with the select
diagnostic, which allows for clearer diagnostic error emit lines.

The syntax for this is:

%enum_select<EnumerationName>{%OptionalEnumeratorName{Text}|{Text2}}0

Where the curley brackets around the select-text are only required if an
Enumerator name is provided.

The TableGen here emits this as a normal 'select' to the frontend, which
permits us to reuse all of the existing 'select' infrastructure.
Documentation is the same as well.

---------

Co-authored-by: Aaron Ballman <aaron at aaronballman.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list