================
@@ -44,7 +44,7 @@ class CIRGenerator : public clang::ASTConsumer {
   const clang::CodeGenOptions &codeGenOpts;
 
 protected:
-  std::unique_ptr<mlir::MLIRContext> mlirContext;
+  std::shared_ptr<mlir::MLIRContext> mlirContext;
----------------
bcardosolopes wrote:

We run passes post CIRGen (LLVM lowering is one example) and at some point we 
were trying to build CIR in Sema and hand it over to codegen if already 
produced, so this probably dates back to that. Right now CIRGenerator holds the 
whole lifetime it's totally fine to go for a more clean solution here.

Btw, If you want to double check, you could run the cir tests with a ASAN 
enabled clang build, I usually use that from time to time to make sure the 
incubator isn't leaking.

https://github.com/llvm/llvm-project/pull/124650
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to