[llvm] [CodeGen] Fix `MachineModuleInfo`'s move constructor to be more safe with `MCContext` ownership. (PR #104834)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 10:14:10 PDT 2024


arsenm wrote:

> My PR is not really touching much ownership but more like fixing a dangerous existing bug. I **DO NOT DISAGREE** that it worthwhile reconsidering the actual ownership of the design if you see fit, but again, it's out of the scope of this bug fixing PR IMO, and I don't feel comfortable to moving ahead without understanding the context of the original design. 

Could you also just change the move constructor to move the MCContext in place without switching to the unique_ptr? 


> Also, for API change and design change like this, should there be an RFC to get community inputs before moving forward?

This isn't big enough to call for an RFC


> Can we please fix the bug first and then the design? Do they have to be done all in one go? It gets a bit frustrating here to be honest.

Since when is software not frustrating? 


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


More information about the llvm-commits mailing list