[all-commits] [llvm/llvm-project] 284e5d: [MsgPackDocument]: Fix DocNode comparison and add ...
Jacob Lambert via All-commits
all-commits at lists.llvm.org
Tue Mar 31 13:12:51 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 284e5d79cdf292f4693ee835cbcbb6760ac63889
https://github.com/llvm/llvm-project/commit/284e5d79cdf292f4693ee835cbcbb6760ac63889
Author: Jacob Lambert <jacob.lambert at amd.com>
Date: 2026-03-31 (Tue, 31 Mar 2026)
Changed paths:
M llvm/include/llvm/BinaryFormat/MsgPackDocument.h
M llvm/lib/BinaryFormat/MsgPackDocument.cpp
M llvm/unittests/BinaryFormat/MsgPackDocumentTest.cpp
Log Message:
-----------
[MsgPackDocument]: Fix DocNode comparison and add copyNode (#189436)
Fix two bugs in DocNode's comparison operators and add a new
Document::copyNode() method:
1. operator== was implemented via operator<, which hits llvm_unreachable
for Array/Map nodes. Implement operator== directly with recursive value
comparison for all node types.
2. operator< compared KindAndDoc pointers, causing cross-document nodes
of the same type and value to silently produce wrong results. Compare by
kind then by value instead.
3. Add Document::copyNode() for deep copying nodes between Documents
with independent memory ownership.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list