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

Matin Raayai via flang-commits flang-commits at lists.llvm.org
Tue Oct 1 13:36:18 PDT 2024


matinraayai wrote:

@MatzeB @arsenm in the latest commit I had to fix the issue you ran into in the following links @arsenm mentioned earlier:
https://lists.llvm.org/pipermail/llvm-dev/2017-October/117907.html

https://reviews.llvm.org/D38482
https://reviews.llvm.org/D38489

I can live with `TargetMachine` and `LLVMTargetMachine` being separate entities, with `TargetMachine` being the "frontend" and `LLVMTargetMachine` being any concrete subclass with codegen support as @MatzeB explained in the past.

With this patch, if any library requires MC code emission of any kind, it has to explicitly link to libCodeGen, since it has to be able to access the `MMI` constructor/destructor. I still believe that `addPassesToEmitMC` and `addPassesToEmitFile` need to be moved to `LLVMTargetMachine` to further enforce the distinction between `LLVMTargetMachine` and `TargetMachine`, as well as any other interface that explicitly uses CodeGen or MC primitives (e.g. MachineFunctionInfoYaml things).

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


More information about the flang-commits mailing list