================
@@ -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();
+
+    if (ParentInfo->USR == GlobalNamespaceID) {
----------------
ilovepi wrote:

```suggestion
    if (ParentInfo && ParentInfo->USR == GlobalNamespaceID) {
```
AFAIK that could be `nullptr`...

https://github.com/llvm/llvm-project/pull/173297
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to