[clang] [flang] [llvm] [mlir] Make Ownership of MachineModuleInfo in Its Wrapper Pass External (PR #110443)

Matin Raayai via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 30 09:34:02 PDT 2024


matinraayai wrote:

> > * Move the MC emission functions in `TargetMachine` to `LLVMTargetMachine`. With the changes in this PR, we explicitly assume in both `addPassesToEmitFile` and `addPassesToEmitMC` that the `TargetMachine` is an `LLVMTargetMachine`; Hence it does not make sense for these functions to be present in the `TargetMachine` interface.
> 
> Was this already implicitly assumed? IIRC there was some layering reason why this is the way it was. There were previous attempts to merge these before, which were abandoned:
> 
> https://lists.llvm.org/pipermail/llvm-dev/2017-October/117907.html
> 
> https://reviews.llvm.org/D38482 https://reviews.llvm.org/D38489

My bad, I forgot to correct my comment. Initially I was going to move the MC file emission functions to `LLVMTargetMachine` but I decided against it, as it would make the PR harder to review.

I don't mind merging those interfaces together in a future PR, as all the past work mention, `LLVMTargetMachine` functionality is always assumed for all targets and no target directly extends `TargetMachine`.

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


More information about the cfe-commits mailing list