Skip to content

Commit 1c3320c

Browse files
authored
[clang-doc] add a JSON generator (#142483)
Adds a JSON generator backend to emit mapped information as JSON. This will enable a better testing format for upcoming changes. It can also potentially serve to feed our other backend generators in the future, like Mustache which already serializes information to JSON before emitting as HTML. This patch contains functionality to emit classes and provides most of the basis of the generator.
1 parent 610d057 commit 1c3320c

File tree

10 files changed

+956
-2
lines changed

10 files changed

+956
-2
lines changed

clang-tools-extra/clang-doc/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ add_clang_library(clangDoc STATIC
1717
Serialize.cpp
1818
YAMLGenerator.cpp
1919
HTMLMustacheGenerator.cpp
20+
JSONGenerator.cpp
2021

2122
DEPENDS
2223
omp_gen

clang-tools-extra/clang-doc/Generators.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,7 @@ static int LLVM_ATTRIBUTE_UNUSED HTMLGeneratorAnchorDest =
105105
HTMLGeneratorAnchorSource;
106106
static int LLVM_ATTRIBUTE_UNUSED MHTMLGeneratorAnchorDest =
107107
MHTMLGeneratorAnchorSource;
108+
static int LLVM_ATTRIBUTE_UNUSED JSONGeneratorAnchorDest =
109+
JSONGeneratorAnchorSource;
108110
} // namespace doc
109111
} // namespace clang

clang-tools-extra/clang-doc/Generators.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ extern volatile int YAMLGeneratorAnchorSource;
5858
extern volatile int MDGeneratorAnchorSource;
5959
extern volatile int HTMLGeneratorAnchorSource;
6060
extern volatile int MHTMLGeneratorAnchorSource;
61+
extern volatile int JSONGeneratorAnchorSource;
6162

6263
} // namespace doc
6364
} // namespace clang

0 commit comments

Comments
 (0)