This is an archive of the discontinued LLVM Phabricator instance.

[clang] [extract-api] Don't crash for category in libclang APIs
ClosedPublic

Authored by dang on Jan 19 2023, 3:32 AM.

Details

Summary

Remove failure conditions for categories in libclang and return empty
content instead.

Diff Detail

Event Timeline

dang created this revision.Jan 19 2023, 3:32 AM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: arphaman. · View Herald Transcript
dang requested review of this revision.Jan 19 2023, 3:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 19 2023, 3:32 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
dang updated this revision to Diff 490447.Jan 19 2023, 3:37 AM

Formatting fixes

bnbarham accepted this revision.Jan 19 2023, 11:20 AM
bnbarham added inline comments.
clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
540–549

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.

This revision is now accepted and ready to land.Jan 19 2023, 11:20 AM
dang added inline comments.Jan 19 2023, 2:48 PM
clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
540–549

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.

This revision was landed with ongoing or failed builds.Feb 10 2023, 8:30 AM
This revision was automatically updated to reflect the committed changes.