[llvm-branch-commits] [clang-tools-extra] [clang-doc] create namespace names according to their paths (PR #162886)

Paul Kirth via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Oct 10 11:02:50 PDT 2025


================
@@ -584,7 +584,13 @@ static SmallString<16> determineFileName(Info *I, SmallString<128> &Path) {
     FileName = RecordSymbolInfo->MangledName;
   } else if (I->USR == GlobalNamespace)
     FileName = "index";
-  else
+  else if (I->IT == InfoType::IT_namespace) {
+    for (const auto &NS : I->Namespace) {
+      FileName += NS.Name;
+      FileName += "_";
+    }
+    FileName += I->Name;
+  } else
----------------
ilovepi wrote:

I'm thinking we'd be better off just moving away from the the flat dir structure. the number of files/items in a namespace can be quite large, and its probably a better choice to keep the number of files in a directory relatively small. Things like the global namespace may need more thought, since I think they may have lots of things in it. for example C projects will all just have everything in the global namespace, right? so we may also want to consider mirroring the source file directory structure. but moving away from the flat structure first and then using a different schema if we decide its worth the effort seems like a good path.

For now though, I'd like to get these bugs fixed, so lets just add a TODO about that, and go w/ what you have here. I think its more important to have a working thing, than stay in limbo while we figure out a path forward.

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


More information about the llvm-branch-commits mailing list