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

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 28 06:36:19 PST 2025


================
@@ -55,6 +55,9 @@ class CIRGenerator : public clang::ASTConsumer {
   void Initialize(clang::ASTContext &astContext) override;
   bool HandleTopLevelDecl(clang::DeclGroupRef group) override;
   mlir::ModuleOp getModule() const;
+  std::unique_ptr<mlir::MLIRContext> takeContext() {
----------------
erichkeane wrote:

This function is somewhat frightning TBH.  It potentially leaves the generator in an invalid state.  Is there a reason whoever takes this couldn't just keep a reference to this (for vice versa?).

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


More information about the cfe-commits mailing list