================
@@ -54,6 +54,13 @@ RecordContext *APIRecord::castToRecordContext(const 
APIRecord *Record) {
   }
 }
 
+void RecordContext::stealRecordChain(RecordContext &Other) {
+  First = Other.First;
+  Last = Other.Last;
+  Other.First = nullptr;
+  Other.Last = nullptr;
+}
----------------
QuietMisdreavus wrote:

The name `stealRecordChain` is fine, it makes it plain that `Other`'s record 
chain will be set to null and moved to this context. I'm just worried with the 
implementation; if this stands as it is, with no comment and no guard that the 
current context has no record chain already, then i'm worried about a future 
use of this function that leads to broken behavior.

If this were a more verbose codebase i would call it 
`overwriteRecordChainByStealingFrom` but that's a bit too far 😅 

https://github.com/llvm/llvm-project/pull/87772
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to