[all-commits] [llvm/llvm-project] eaa7b3: [clang-doc] Add support for explicitly typed enums

Paul Kirth via All-commits all-commits at lists.llvm.org
Mon Sep 19 14:55:02 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: eaa7b324d5a272dc640cfc4162b746ac5341ccbd
      https://github.com/llvm/llvm-project/commit/eaa7b324d5a272dc640cfc4162b746ac5341ccbd
  Author: Brett Wilson <brettw at google.com>
  Date:   2022-09-19 (Mon, 19 Sep 2022)

  Changed paths:
    M clang-tools-extra/clang-doc/BitcodeReader.cpp
    M clang-tools-extra/clang-doc/BitcodeWriter.cpp
    M clang-tools-extra/clang-doc/BitcodeWriter.h
    M clang-tools-extra/clang-doc/HTMLGenerator.cpp
    M clang-tools-extra/clang-doc/MDGenerator.cpp
    M clang-tools-extra/clang-doc/Representation.h
    M clang-tools-extra/clang-doc/Serialize.cpp
    M clang-tools-extra/clang-doc/YAMLGenerator.cpp
    M clang-tools-extra/unittests/clang-doc/SerializeTest.cpp
    M clang-tools-extra/unittests/clang-doc/YAMLGeneratorTest.cpp

  Log Message:
  -----------
  [clang-doc] Add support for explicitly typed enums

Add support for explicitly typed enums:
  enum Foo : unsigned { ... };
to the internal representation and to the YAML output.

Add support for getting the value of an enum constant, as well as accessing the original expression that produced it. This changes the YAML output of enums from an array of strings for the enum members to an array of dictionaries. These dictionaries now report the name, value, and original expression.

The markdown and HTML outputs are unchanged, they still output the name from the new enhanced internal schema.

Reviewed By: paulkirth

Differential Revision: https://reviews.llvm.org/D134055




More information about the All-commits mailing list