[clang] [CIR] Add framework for CIR to LLVM IR lowering (PR #124650)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 28 11:20:12 PST 2025


================
@@ -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;
----------------
andykaylor wrote:

Perhaps it's also relevant to note that I don't seem to need the context here in the current patch. It's only used as a unique pointer in the path where we're lowering CIR to other MLIR dialects before generating LLVM IR. So, I could remove this part of the change and defer the decision until it is needed.

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


More information about the cfe-commits mailing list