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

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 30 22:47:39 PDT 2024


KanRobert wrote:

> Since the `MachineBlockFrequencyInfo` class has an overloaded copy constructor, the assignment operator should be deleted to prevent undefined behaviour

I recalled my C++ knowledge and it is not clear what undefined behaviour you are referring to. We can define the move constructor and move assignment operator at the same time, e.g. https://learn.microsoft.com/en-us/cpp/cpp/move-constructors-and-move-assignment-operators-cpp?view=msvc-170

Are you talking about https://en.cppreference.com/w/cpp/language/rule_of_three

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


More information about the llvm-commits mailing list