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

weiwei chen via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 13:30:20 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;
----------------
weiweichen wrote:

Well, it explicitly said `This is an external context` which means someone else is owning it instead of `this` here, so not quite the same scope, no?

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


More information about the llvm-commits mailing list