[clang-tools-extra] [clang-doc] Add a top-level index.html page (PR #171899)
Erick Velez via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 16 18:16:02 PST 2025
https://github.com/evelez7 updated https://github.com/llvm/llvm-project/pull/171899
>From 115483f82b2c54139af1710d35eec2cb0a0ef6db Mon Sep 17 00:00:00 2001
From: Erick Velez <erickvelez7 at gmail.com>
Date: Fri, 14 Nov 2025 21:43:34 -0800
Subject: [PATCH] fix USR
---
clang-tools-extra/clang-doc/Generators.cpp | 4 ++
clang-tools-extra/clang-doc/HTMLGenerator.cpp | 12 ++++
clang-tools-extra/clang-doc/JSONGenerator.cpp | 64 +++++++++++++++++--
.../clang-doc/assets/index-template.mustache | 41 ++++++++++++
clang-tools-extra/clang-doc/support/Utils.cpp | 3 +
.../clang-doc/tool/CMakeLists.txt | 1 +
clang-tools-extra/test/clang-doc/index.cpp | 62 ++++++++++++++++++
.../test/clang-doc/json/class-requires.cpp | 1 -
.../test/clang-doc/json/class.cpp | 1 -
.../clang-doc/json/compound-constraints.cpp | 11 ----
.../test/clang-doc/json/function-requires.cpp | 2 -
.../test/clang-doc/json/namespace.cpp | 1 -
.../unittests/clang-doc/JSONGeneratorTest.cpp | 1 -
13 files changed, 180 insertions(+), 24 deletions(-)
create mode 100644 clang-tools-extra/clang-doc/assets/index-template.mustache
create mode 100644 clang-tools-extra/test/clang-doc/index.cpp
diff --git a/clang-tools-extra/clang-doc/Generators.cpp b/clang-tools-extra/clang-doc/Generators.cpp
index d6c1cc948ce30..fafe41eebb779 100644
--- a/clang-tools-extra/clang-doc/Generators.cpp
+++ b/clang-tools-extra/clang-doc/Generators.cpp
@@ -164,6 +164,10 @@ Error MustacheGenerator::generateDocumentation(
Expected<std::string> MustacheGenerator::getInfoTypeStr(Object *Info,
StringRef Filename) {
+ // Checking for a USR ensures that only the special top-level index file is
+ // caught here, since it is not an Info.
+ if (Filename == "index" && !Info->get("USR"))
+ return "index";
auto StrValue = (*Info)["InfoType"];
if (StrValue.kind() != json::Value::Kind::String)
return createStringError("JSON file '%s' does not contain key: 'InfoType'.",
diff --git a/clang-tools-extra/clang-doc/HTMLGenerator.cpp b/clang-tools-extra/clang-doc/HTMLGenerator.cpp
index 77b287476423e..3fc89311749ad 100644
--- a/clang-tools-extra/clang-doc/HTMLGenerator.cpp
+++ b/clang-tools-extra/clang-doc/HTMLGenerator.cpp
@@ -29,6 +29,8 @@ static std::unique_ptr<MustacheTemplateFile> NamespaceTemplate = nullptr;
static std::unique_ptr<MustacheTemplateFile> RecordTemplate = nullptr;
+static std::unique_ptr<MustacheTemplateFile> IndexTemplate = nullptr;
+
class HTMLGenerator : public MustacheGenerator {
public:
static const char *Format;
@@ -60,6 +62,8 @@ Error HTMLGenerator::setupTemplateFiles(const ClangDocContext &CDCtx) {
ConvertToNative(CDCtx.MustacheTemplates.lookup("namespace-template"));
std::string ClassFilePath =
ConvertToNative(CDCtx.MustacheTemplates.lookup("class-template"));
+ std::string IndexFilePath =
+ ConvertToNative(CDCtx.MustacheTemplates.lookup("index-template"));
std::string CommentFilePath =
ConvertToNative(CDCtx.MustacheTemplates.lookup("comment-template"));
std::string FunctionFilePath =
@@ -83,6 +87,9 @@ Error HTMLGenerator::setupTemplateFiles(const ClangDocContext &CDCtx) {
if (Error Err = setupTemplate(RecordTemplate, ClassFilePath, Partials))
return Err;
+ if (Error Err = setupTemplate(IndexTemplate, IndexFilePath, Partials))
+ return Err;
+
return Error::success();
}
@@ -130,6 +137,11 @@ Error HTMLGenerator::generateDocForJSON(json::Value &JSON, raw_fd_ostream &OS,
return Err;
assert(RecordTemplate && "RecordTemplate is nullptr.");
RecordTemplate->render(JSON, OS);
+ } else if (ObjTypeStr == "index") {
+ if (auto Err = setupTemplateResources(CDCtx, JSON, RelativeRootPath))
+ return Err;
+ assert(IndexTemplate && "IndexTemplate is nullptr.");
+ IndexTemplate->render(JSON, OS);
}
return Error::success();
}
diff --git a/clang-tools-extra/clang-doc/JSONGenerator.cpp b/clang-tools-extra/clang-doc/JSONGenerator.cpp
index 8828414cb3925..f63a7d8689242 100644
--- a/clang-tools-extra/clang-doc/JSONGenerator.cpp
+++ b/clang-tools-extra/clang-doc/JSONGenerator.cpp
@@ -44,6 +44,11 @@ static auto SerializeReferenceLambda = [](const auto &Ref, Object &Object) {
serializeReference(Ref, Object);
};
+static void insertNonEmpty(StringRef Key, StringRef Value, Object &Obj) {
+ if (!Value.empty())
+ Obj[Key] = Value;
+}
+
static std::string infoTypeToString(InfoType IT) {
switch (IT) {
case InfoType::IT_default:
@@ -276,11 +281,11 @@ serializeCommonAttributes(const Info &I, json::Object &Obj,
Obj["Name"] = I.Name;
Obj["USR"] = toHex(toStringRef(I.USR));
Obj["InfoType"] = infoTypeToString(I.IT);
- if (!I.DocumentationFileName.empty())
- Obj["DocumentationFileName"] = I.DocumentationFileName;
-
- if (!I.Path.empty())
- Obj["Path"] = I.Path;
+ // Conditionally insert fields.
+ // Empty properties are omitted because Mustache templates use existence
+ // to conditionally render content.
+ insertNonEmpty("DocumentationFileName", I.DocumentationFileName, Obj);
+ insertNonEmpty("Path", I.Path, Obj);
if (!I.Namespace.empty()) {
Obj["Namespace"] = json::Array();
@@ -318,7 +323,7 @@ serializeCommonAttributes(const Info &I, json::Object &Obj,
}
static void serializeReference(const Reference &Ref, Object &ReferenceObj) {
- ReferenceObj["Path"] = Ref.Path;
+ insertNonEmpty("Path", Ref.Path, ReferenceObj);
ReferenceObj["Name"] = Ref.Name;
ReferenceObj["QualName"] = Ref.QualName;
ReferenceObj["USR"] = toHex(toStringRef(Ref.USR));
@@ -656,6 +661,51 @@ static SmallString<16> determineFileName(Info *I, SmallString<128> &Path) {
return FileName;
}
+// Creates a JSON file above the global namespace directory.
+// An index can be used to create the top-level HTML index page or the Markdown
+// index file.
+static Error serializeIndex(const ClangDocContext &CDCtx, StringRef RootDir) {
+ if (CDCtx.Idx.Children.empty())
+ return Error::success();
+
+ json::Value ObjVal = Object();
+ Object &Obj = *ObjVal.getAsObject();
+ insertNonEmpty("ProjectName", CDCtx.ProjectName, Obj);
+
+ auto IndexCopy = CDCtx.Idx;
+ IndexCopy.sort();
+ json::Value IndexArray = json::Array();
+ auto &IndexArrayRef = *IndexArray.getAsArray();
+
+ if (IndexCopy.Children.empty()) {
+ // If the index is empty, default to displaying the global namespace.
+ IndexCopy.Children.emplace_back(GlobalNamespaceID, "",
+ InfoType::IT_namespace, "GlobalNamespace");
+ } else {
+ IndexArrayRef.reserve(CDCtx.Idx.Children.size());
+ }
+
+ for (auto &Idx : IndexCopy.Children) {
+ if (Idx.Children.empty())
+ continue;
+ std::string TypeStr = infoTypeToString(Idx.RefType);
+ json::Value IdxVal = Object();
+ auto &IdxObj = *IdxVal.getAsObject();
+ serializeReference(Idx, IdxObj);
+ IndexArrayRef.push_back(IdxVal);
+ }
+ Obj["Index"] = IndexArray;
+
+ SmallString<128> IndexFilePath(RootDir);
+ sys::path::append(IndexFilePath, "/json/index.json");
+ std::error_code FileErr;
+ raw_fd_ostream RootOS(IndexFilePath, FileErr, sys::fs::OF_Text);
+ if (FileErr)
+ return createFileError("cannot open file " + IndexFilePath, FileErr);
+ RootOS << llvm::formatv("{0:2}", ObjVal);
+ return Error::success();
+}
+
Error JSONGenerator::generateDocumentation(
StringRef RootDir, llvm::StringMap<std::unique_ptr<doc::Info>> Infos,
const ClangDocContext &CDCtx, std::string DirName) {
@@ -694,7 +744,7 @@ Error JSONGenerator::generateDocumentation(
return Err;
}
- return Error::success();
+ return serializeIndex(CDCtx, RootDir);
}
Error JSONGenerator::generateDocForInfo(Info *I, raw_ostream &OS,
diff --git a/clang-tools-extra/clang-doc/assets/index-template.mustache b/clang-tools-extra/clang-doc/assets/index-template.mustache
new file mode 100644
index 0000000000000..de64da4d709ee
--- /dev/null
+++ b/clang-tools-extra/clang-doc/assets/index-template.mustache
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+{{>HeadPartial}}
+<body>
+ {{>NavbarPartial}}
+ <main>
+ <div class="container">
+ <div class="sidebar">
+ <h2>{{ProjectName}}</h2>
+ <ul>
+ <li class="sidebar-section">
+ <a class="sidebar-item" href="#Namespaces">Namespaces</a>
+ </li>
+ <li>
+ <ul>
+ {{#Index}}
+ <li class="sidebar-item-container">
+ <a class="sidebar-item" href="#{{Name}}">{{Name}}</a>
+ </li>
+ {{/Index}}
+ </ul>
+ </li>
+ </ul>
+ </div>
+ <div class="resizer" id="resizer"></div>
+ <div class="content">
+ <section id="Index" class="section-container">
+ <h2>Index</h2>
+ {{#Index}}
+ <div>
+ <a href="{{#Path}}{{Path}}/{{/Path}}{{Name}}/index.html">
+ <pre><code class="language-cpp code-clang-doc">namespace {{Name}}</code></pre>
+ </a>
+ </div>
+ {{/Index}}
+ </section>
+ </div>
+ </div>
+ </main>
+</body>
+</html>
diff --git a/clang-tools-extra/clang-doc/support/Utils.cpp b/clang-tools-extra/clang-doc/support/Utils.cpp
index d0fd6f45b8a02..e0d92d23b045e 100644
--- a/clang-tools-extra/clang-doc/support/Utils.cpp
+++ b/clang-tools-extra/clang-doc/support/Utils.cpp
@@ -60,6 +60,8 @@ void getHtmlFiles(StringRef AssetsPath, clang::doc::ClangDocContext &CDCtx) {
appendPathPosix(AssetsPath, "head-template.mustache");
SmallString<128> NavbarTemplate =
appendPathPosix(AssetsPath, "navbar-template.mustache");
+ SmallString<128> IndexTemplate =
+ appendPathPosix(AssetsPath, "index-template.mustache");
CDCtx.MustacheTemplates.insert(
{"namespace-template", NamespaceTemplate.c_str()});
@@ -70,4 +72,5 @@ void getHtmlFiles(StringRef AssetsPath, clang::doc::ClangDocContext &CDCtx) {
CDCtx.MustacheTemplates.insert({"comment-template", CommentTemplate.c_str()});
CDCtx.MustacheTemplates.insert({"head-template", HeadTemplate.c_str()});
CDCtx.MustacheTemplates.insert({"navbar-template", NavbarTemplate.c_str()});
+ CDCtx.MustacheTemplates.insert({"index-template", IndexTemplate.c_str()});
}
diff --git a/clang-tools-extra/clang-doc/tool/CMakeLists.txt b/clang-tools-extra/clang-doc/tool/CMakeLists.txt
index c8b4162a0e716..6d8665379e750 100644
--- a/clang-tools-extra/clang-doc/tool/CMakeLists.txt
+++ b/clang-tools-extra/clang-doc/tool/CMakeLists.txt
@@ -33,6 +33,7 @@ set(assets
template.mustache
head-template.mustache
navbar-template.mustache
+ index-template.mustache
)
set(asset_dir "${CMAKE_CURRENT_SOURCE_DIR}/../assets")
diff --git a/clang-tools-extra/test/clang-doc/index.cpp b/clang-tools-extra/test/clang-doc/index.cpp
new file mode 100644
index 0000000000000..e9ac164768170
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/index.cpp
@@ -0,0 +1,62 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --format=html --output=%t --executor=standalone %s
+// RUN: FileCheck %s < %t/json/index.json -check-prefix=CHECK-JSON
+// RUN: FileCheck %s < %t/html/index.html -check-prefix=CHECK-HTML
+
+class Foo {};
+
+namespace inner {
+ class Bar {};
+}
+
+// CHECK-JSON: "Index": [
+// CHECK-JSON-NEXT: {
+// CHECK-JSON-NEXT: "Name": "GlobalNamespace",
+// CHECK-JSON-NEXT: "QualName": "GlobalNamespace",
+// CHECK-JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
+// CHECK-JSON-NEXT: },
+// CHECK-JSON-NEXT: {
+// CHECK-JSON-NEXT: "Name": "inner",
+// CHECK-JSON-NEXT: "QualName": "inner",
+// CHECK-JSON-NEXT: "USR": "{{([0-9A-F]{40})}}"
+// CHECK-JSON-NEXT: }
+// CHECK-JSON-NEXT: ]
+
+// CHECK-HTML: <main>
+// CHECK-HTML-NEXT: <div class="container">
+// CHECK-HTML-NEXT: <div class="sidebar">
+// CHECK-HTML-NEXT: <h2></h2>
+// CHECK-HTML-NEXT: <ul>
+// CHECK-HTML-NEXT: <li class="sidebar-section">
+// CHECK-HTML-NEXT: <a class="sidebar-item" href="#Namespaces">Namespaces</a>
+// CHECK-HTML-NEXT: </li>
+// CHECK-HTML-NEXT: <li>
+// CHECK-HTML-NEXT: <ul>
+// CHECK-HTML-NEXT: <li class="sidebar-item-container">
+// CHECK-HTML-NEXT: <a class="sidebar-item" href="#GlobalNamespace">GlobalNamespace</a>
+// CHECK-HTML-NEXT: </li>
+// CHECK-HTML-NEXT: <li class="sidebar-item-container">
+// CHECK-HTML-NEXT: <a class="sidebar-item" href="#inner">inner</a>
+// CHECK-HTML-NEXT: </li>
+// CHECK-HTML-NEXT: </ul>
+// CHECK-HTML-NEXT: </li>
+// CHECK-HTML-NEXT: </ul>
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: <div class="resizer" id="resizer"></div>
+// CHECK-HTML-NEXT: <div class="content">
+// CHECK-HTML-NEXT: <section id="Index" class="section-container">
+// CHECK-HTML-NEXT: <h2>Index</h2>
+// CHECK-HTML-NEXT: <div>
+// CHECK-HTML-NEXT: <a href="GlobalNamespace/index.html">
+// CHECK-HTML-NEXT: <pre><code class="language-cpp code-clang-doc">namespace GlobalNamespace</code></pre>
+// CHECK-HTML-NEXT: </a>
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: <div>
+// CHECK-HTML-NEXT: <a href="inner/index.html">
+// CHECK-HTML-NEXT: <pre><code class="language-cpp code-clang-doc">namespace inner</code></pre>
+// CHECK-HTML-NEXT: </a>
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: </section>
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: </main>
diff --git a/clang-tools-extra/test/clang-doc/json/class-requires.cpp b/clang-tools-extra/test/clang-doc/json/class-requires.cpp
index e10c5e89f6e17..6c35f2303b6dd 100644
--- a/clang-tools-extra/test/clang-doc/json/class-requires.cpp
+++ b/clang-tools-extra/test/clang-doc/json/class-requires.cpp
@@ -23,7 +23,6 @@ struct MyClass;
// CHECK-NEXT: "End": true,
// CHECK-NEXT: "Expression": "Addable<T>",
// CHECK-NEXT: "Name": "Addable",
-// CHECK-NEXT: "Path": "",
// CHECK-NEXT: "QualName": "Addable",
// CHECK-NEXT: "USR": "{{[0-9A-F]*}}"
// CHECK-NEXT: }
diff --git a/clang-tools-extra/test/clang-doc/json/class.cpp b/clang-tools-extra/test/clang-doc/json/class.cpp
index 1c0d5d5ab567a..79ac20f954f7a 100644
--- a/clang-tools-extra/test/clang-doc/json/class.cpp
+++ b/clang-tools-extra/test/clang-doc/json/class.cpp
@@ -95,7 +95,6 @@ struct MyClass {
// CHECK-NEXT: ],
// CHECK-NEXT: "Reference": {
// CHECK-NEXT: "Name": "friendFunction",
-// CHECK-NEXT: "Path": "",
// CHECK-NEXT: "QualName": "friendFunction",
// CHECK-NEXT: "USR": "{{[0-9A-F]*}}"
// CHECK-NEXT: },
diff --git a/clang-tools-extra/test/clang-doc/json/compound-constraints.cpp b/clang-tools-extra/test/clang-doc/json/compound-constraints.cpp
index 5b15a88d562de..afaad8f5d6775 100644
--- a/clang-tools-extra/test/clang-doc/json/compound-constraints.cpp
+++ b/clang-tools-extra/test/clang-doc/json/compound-constraints.cpp
@@ -32,7 +32,6 @@ template<typename T> requires (Incrementable<T> && Decrementable<T>) || PreIncre
// CHECK-NEXT: {
// CHECK-NEXT: "Expression": "Incrementable<T>",
// CHECK-NEXT: "Name": "Incrementable",
-// CHECK-NEXT: "Path": "",
// CHECK-NEXT: "QualName": "Incrementable",
// CHECK-NEXT: "USR": "{{[0-9A-F]*}}"
// CHECK-NEXT: },
@@ -40,7 +39,6 @@ template<typename T> requires (Incrementable<T> && Decrementable<T>) || PreIncre
// CHECK-NEXT: "End": true,
// CHECK-NEXT: "Expression": "Decrementable<T>",
// CHECK-NEXT: "Name": "Decrementable",
-// CHECK-NEXT: "Path": "",
// CHECK-NEXT: "QualName": "Decrementable",
// CHECK-NEXT: "USR": "{{[0-9A-F]*}}"
// CHECK-NEXT: }
@@ -51,7 +49,6 @@ template<typename T> requires (Incrementable<T> && Decrementable<T>) || PreIncre
// CHECK-NEXT: {
// CHECK-NEXT: "Expression": "Incrementable<T>",
// CHECK-NEXT: "Name": "Incrementable",
-// CHECK-NEXT: "Path": "",
// CHECK-NEXT: "QualName": "Incrementable",
// CHECK-NEXT: "USR": "{{[0-9A-F]*}}"
// CHECK-NEXT: },
@@ -59,7 +56,6 @@ template<typename T> requires (Incrementable<T> && Decrementable<T>) || PreIncre
// CHECK-NEXT: "End": true,
// CHECK-NEXT: "Expression": "Decrementable<T>",
// CHECK-NEXT: "Name": "Decrementable",
-// CHECK-NEXT: "Path": "",
// CHECK-NEXT: "QualName": "Decrementable",
// CHECK-NEXT: "USR": "{{[0-9A-F]*}}"
// CHECK-NEXT: }
@@ -70,21 +66,18 @@ template<typename T> requires (Incrementable<T> && Decrementable<T>) || PreIncre
// CHECK-NEXT: {
// CHECK-NEXT: "Expression": "Incrementable<T>",
// CHECK-NEXT: "Name": "Incrementable",
-// CHECK-NEXT: "Path": "",
// CHECK-NEXT: "QualName": "Incrementable",
// CHECK-NEXT: "USR": "{{[0-9A-F]*}}"
// CHECK-NEXT: },
// CHECK-NEXT: {
// CHECK-NEXT: "Expression": "Decrementable<T>",
// CHECK-NEXT: "Name": "Decrementable",
-// CHECK-NEXT: "Path": "",
// CHECK-NEXT: "QualName": "Decrementable",
// CHECK-NEXT: "USR": "{{[0-9A-F]*}}"
// CHECK-NEXT: },
// CHECK-NEXT: {
// CHECK-NEXT: "Expression": "PreIncrementable<T>",
// CHECK-NEXT: "Name": "PreIncrementable",
-// CHECK-NEXT: "Path": "",
// CHECK-NEXT: "QualName": "PreIncrementable",
// CHECK-NEXT: "USR": "{{[0-9A-F]*}}"
// CHECK-NEXT: },
@@ -92,7 +85,6 @@ template<typename T> requires (Incrementable<T> && Decrementable<T>) || PreIncre
// CHECK-NEXT: "End": true,
// CHECK-NEXT: "Expression": "PreDecrementable<T>",
// CHECK-NEXT: "Name": "PreDecrementable",
-// CHECK-NEXT: "Path": "",
// CHECK-NEXT: "QualName": "PreDecrementable",
// CHECK-NEXT: "USR": "{{[0-9A-F]*}}"
// CHECK-NEXT: }
@@ -103,14 +95,12 @@ template<typename T> requires (Incrementable<T> && Decrementable<T>) || PreIncre
// CHECK-NEXT: {
// CHECK-NEXT: "Expression": "Incrementable<T>",
// CHECK-NEXT: "Name": "Incrementable",
-// CHECK-NEXT: "Path": "",
// CHECK-NEXT: "QualName": "Incrementable",
// CHECK-NEXT: "USR": "{{[0-9A-F]*}}"
// CHECK-NEXT: },
// CHECK-NEXT: {
// CHECK-NEXT: "Expression": "Decrementable<T>",
// CHECK-NEXT: "Name": "Decrementable",
-// CHECK-NEXT: "Path": "",
// CHECK-NEXT: "QualName": "Decrementable",
// CHECK-NEXT: "USR": "{{[0-9A-F]*}}"
// CHECK-NEXT: },
@@ -118,7 +108,6 @@ template<typename T> requires (Incrementable<T> && Decrementable<T>) || PreIncre
// CHECK-NEXT: "End": true,
// CHECK-NEXT: "Expression": "PreIncrementable<T>",
// CHECK-NEXT: "Name": "PreIncrementable",
-// CHECK-NEXT: "Path": "",
// CHECK-NEXT: "QualName": "PreIncrementable",
// CHECK-NEXT: "USR": "{{[0-9A-F]*}}"
// CHECK-NEXT: }
diff --git a/clang-tools-extra/test/clang-doc/json/function-requires.cpp b/clang-tools-extra/test/clang-doc/json/function-requires.cpp
index 931bb07edb836..8c86b1f93cc5e 100644
--- a/clang-tools-extra/test/clang-doc/json/function-requires.cpp
+++ b/clang-tools-extra/test/clang-doc/json/function-requires.cpp
@@ -37,7 +37,6 @@ template<Incrementable T> Incrementable auto incrementTwo(T t);
// CHECK-NEXT: "End": true,
// CHECK-NEXT: "Expression": "Incrementable<T>",
// CHECK-NEXT: "Name": "Incrementable",
-// CHECK-NEXT: "Path": "",
// CHECK-NEXT: "QualName": "Incrementable",
// CHECK-NEXT: "USR": "{{[0-9A-F]*}}"
// CHECK-NEXT: }
@@ -76,7 +75,6 @@ template<Incrementable T> Incrementable auto incrementTwo(T t);
// CHECK-NEXT: "End": true,
// CHECK-NEXT: "Expression": "Incrementable<T>",
// CHECK-NEXT: "Name": "Incrementable",
-// CHECK-NEXT: "Path": "",
// CHECK-NEXT: "QualName": "Incrementable",
// CHECK-NEXT: "USR": "{{[0-9A-F]*}}"
// CHECK-NEXT: }
diff --git a/clang-tools-extra/test/clang-doc/json/namespace.cpp b/clang-tools-extra/test/clang-doc/json/namespace.cpp
index 3beb6b91010d6..c752e22c3e813 100644
--- a/clang-tools-extra/test/clang-doc/json/namespace.cpp
+++ b/clang-tools-extra/test/clang-doc/json/namespace.cpp
@@ -81,7 +81,6 @@ typedef int MyTypedef;
// CHECK-NEXT: {
// CHECK-NEXT: "End": true,
// CHECK-NEXT: "Name": "NestedNamespace",
-// CHECK-NEXT: "Path": "",
// CHECK-NEXT: "QualName": "NestedNamespace",
// CHECK-NEXT: "USR": "{{[0-9A-F]*}}"
// CHECK-NEXT: }
diff --git a/clang-tools-extra/unittests/clang-doc/JSONGeneratorTest.cpp b/clang-tools-extra/unittests/clang-doc/JSONGeneratorTest.cpp
index e6eaabcb8127c..84fe681098f35 100644
--- a/clang-tools-extra/unittests/clang-doc/JSONGeneratorTest.cpp
+++ b/clang-tools-extra/unittests/clang-doc/JSONGeneratorTest.cpp
@@ -135,7 +135,6 @@ TEST_F(JSONGeneratorTest, emitRecordJSON) {
{
"End": true,
"Name": "F",
- "Path": "",
"QualName": "",
"USR": "0000000000000000000000000000000000000000"
}
More information about the cfe-commits
mailing list