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

Hendrik Greving via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 16:26:06 PDT 2024


hgreving2304 wrote:

> @hgreving2304, I think you were the original author who puts the [`ExternContext`](https://github.com/llvm/llvm-project/blob/e56ad22b4a41e65984d6997b2c2496a20f906d1d/llvm/include/llvm/CodeGen/MachineModuleInfo.h#L92) in `llvm::MachineModuleInfo`. Would you mind giving us a bit more context on why it was added originally, and if there is any concerns on removing it with the change of make `MCContext` not owned by `llvm::MachineModuleInfo` entirely anymore?

This was done in order to have an external driver owning the MCContext pointer (and the data it points to). I am not at Google anymore so I can't talk for them, but I know that changing this back will create a lot of trouble there. Before this change, a lot of cumbersome copying was needed.

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


More information about the llvm-commits mailing list