Preparation for a patch to introduce a resizing functionality for MDNodes. See D124548 for a more detailed discussion.
Using a SmallVector<MDOperand> as a large storage container seems to require these constructors/operators to be defined.
Differential D125994
[NFC] Define move and copy constructors and copy assignment operators for MDOperand. wolfgangp on May 19 2022, 11:25 AM. Authored by
Details Preparation for a patch to introduce a resizing functionality for MDNodes. See D124548 for a more detailed discussion. Using a SmallVector<MDOperand> as a large storage container seems to require these constructors/operators to be defined.
Diff Detail
Unit Tests Event TimelineComment Actions Can you add a unit test for this? Ideally something that could expose errors if the tracking logic isn’t right, so probably a TempMDTuple or something assigned/moved between operands.
Comment Actions Only define the move constructor and move assignment operator. Use retrack() instead of relying on the destructor to untrack the source op. Comment Actions (Not sure if you were posting for review yet, but I took a look and noticed this comment hadn’t been addressed yet.) Comment Actions Added a unit test to make sure the move constructor and the move assignment op of MDOperand adjust tracking info. |
There shouldn’t be a const here, and Op should probably be reset. Is there a retrack() function for that operation?