[clang-tools-extra] [clang-doc] Add a breadcrumb navigation bar (PR #173297)
Paul Kirth via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 5 13:05:03 PST 2026
================
@@ -709,6 +770,32 @@ static Error serializeIndex(const ClangDocContext &CDCtx, StringRef RootDir) {
return Error::success();
}
+static void serializeContexts(Info *I,
+ StringMap<std::unique_ptr<Info>> &Infos) {
+ if (I->USR == GlobalNamespaceID)
+ return;
+ auto ParentUSR = I->ParentUSR;
+
+ while (true) {
+ Info *ParentInfo =
+ Infos.at(llvm::toStringRef(llvm::toHex(ParentUSR)).str()).get();
----------------
ilovepi wrote:
I'm a little confused by this. you're using `toStringRef()` on an `std::string`, and then calling `.str()` to go back to an `std::string`, but the interface is `StringRef` AFAICT ... am I missing something obvious?
Also, maybe we should just use `auto&` to have a reference to the unique_ptr, instead of getting the raw pointer inside? Not the biggest deal, but we won't leak the ptr that way by accident
https://github.com/llvm/llvm-project/pull/173297
More information about the cfe-commits
mailing list