[llvm-branch-commits] [clang-tools-extra] [clang-doc] add namespaces to JSON generator (PR #143209)

Erick Velez via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Jun 9 20:06:43 PDT 2025


================
@@ -0,0 +1,25 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --output=%t --format=json --executor=standalone %s
+// RUN: FileCheck %s < %t/GlobalNamespace/index.json
+
+static void myFunction() {}
+
+void noExceptFunction() noexcept {}
+
+inline void inlineFunction() {}
+
+extern void externFunction() {}
+
+constexpr void constexprFunction() {}
+
+// CHECK:          "Functions": [
+// CHECK-NEXT:       {
+// CHECK:              "IsStatic": true,
----------------
evelez7 wrote:

Yeah this was motivated by convenience. The functions are serialized in order, so I know that the first entry to be checked will be the static function. Hence, the `"IsStatic": true` check. The contents of an object are serialized alphabetically, so I haven't figured how to check the name first, since that comes after all the `Is` fields.

That would be useful. I can investigate this more.

https://github.com/llvm/llvm-project/pull/143209


More information about the llvm-branch-commits mailing list