[clang] [clang][ExtractAPI] Fix handling of anonymous TagDecls (PR #87772)

Daniel Grumberg via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 23 08:16:13 PDT 2024


================
@@ -54,6 +54,20 @@ RecordContext *APIRecord::castToRecordContext(const APIRecord *Record) {
   }
 }
 
+void RecordContext::stealRecordChain(RecordContext &Other) {
+  // If we don't have an empty chain append Other's chain into ours.
+  if (First)
+    Last->NextInContext = Other.First;
----------------
daniel-grumberg wrote:

Documented the invariant that `First` being non-null implies that `Last` is also non-null in an assert above.

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


More information about the cfe-commits mailing list