[PATCH] D142101: [clang] [extract-api] Don't crash for category in libclang APIs

Daniel Grumberg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 19 14:48:57 PST 2023


dang added inline comments.


================
Comment at: clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp:537-544
+  generatePathComponents(Record, API,
+                         [Lang, &ParentContexts](const PathComponent &PC) {
+                           ParentContexts.push_back(
+                               serializeParentContext(PC, Lang));
+                         });
+
+  // The last component would be the record itself so let's remove it.
----------------
bnbarham wrote:
> It's not really clear to me what the intended behavior was meant to be here, ie. whether if any parent fails we skip writing all *or* if we should be writing all valid parents. I'll leave that to someone that knows more about the symbolgraph output.
> 
> But this fixes the obvious crash, so that part is fine with me.
I think it is a bit of a grey area, having parent contexts and related symbols allows downstream clients to perform link resolution on declaration fragment chunks e.t.c I figured it would be best to do a best effort and provide the known parents.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142101/new/

https://reviews.llvm.org/D142101



More information about the cfe-commits mailing list