[llvm] [llvm] Use OwningArrayRef in NodeMetadata (NFC) (PR #137539)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 27 13:54:40 PDT 2025
================
@@ -183,18 +184,14 @@ class NodeMetadata {
NodeMetadata() = default;
NodeMetadata(const NodeMetadata &Other)
- : RS(Other.RS), NumOpts(Other.NumOpts), DeniedOpts(Other.DeniedOpts),
- OptUnsafeEdges(new unsigned[NumOpts]), VReg(Other.VReg),
- AllowedRegs(Other.AllowedRegs)
+ : RS(Other.RS), DeniedOpts(Other.DeniedOpts),
+ OptUnsafeEdges(ArrayRef<unsigned>(Other.OptUnsafeEdges)),
----------------
nikic wrote:
I see. We could add an explicit copy ctor, but I guess that might make it easier to make copies by accident, so keeping explicit casts is probably best.
https://github.com/llvm/llvm-project/pull/137539
More information about the llvm-commits
mailing list