[llvm] [CodeGen] Make MCContext in MachineModuleInfo a unique_ptr. (PR #104834)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 12:57:02 PDT 2024


================
@@ -124,10 +124,10 @@ class MachineModuleInfo {
   const LLVMTargetMachine &getTarget() const { return TM; }
 
   const MCContext &getContext() const {
-    return ExternalContext ? *ExternalContext : Context;
+    return ExternalContext ? *ExternalContext : *Context;
----------------
arsenm wrote:

Can we get rid of this ExternalContext business? I don't understand why it's here. If it's necessary to construct with an external context, I would expect that to be the only way to construct MMI 

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


More information about the llvm-commits mailing list