[llvm] Delete assignment operator from `MachineBlockFrequencyInfo` (PR #101289)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 30 22:40:07 PDT 2024


phoebewang wrote:

> > > > Since the `MachineBlockFrequencyInfo` class has an overloaded copy constructor, the assignment operator should be deleted to prevent undefined behaviour
> > > 
> > > 
> > > `has an overloaded copy constructor` where, could you point out?
> > 
> > 
> > The above `MachineBlockFrequencyInfo(MachineBlockFrequencyInfo &&);`
> 
> Okay. I think it's called move constructor...

Oh, I think you are right. So what we should do here is

`operator=(const MachineBlockFrequencyInfo &&) = default;`


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


More information about the llvm-commits mailing list