================ @@ -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; ---------------- erichkeane wrote:
Hmm... I don't think the shared pointer is the way here, we should have one of them own, and the other observe. What are the lifetimes of these two objects? Is there one of these that has a lifetime that is clearly larger than the other that can be the owner, and the other be a reference to it? @bcardosolopes 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