[clang] [CIR] Add CIRGenerator and plug it via CIRGenAction (PR #90831)

Nathan Lanza via cfe-commits cfe-commits at lists.llvm.org
Fri May 3 00:14:07 PDT 2024


================
@@ -0,0 +1,42 @@
+//===--- CIRGenModule.h - Per-Module state for CIR gen ----------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This is the internal per-translation-unit state used for CIR translation.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_LIB_CODEGEN_CIRGENMODULE_H
+#define LLVM_CLANG_LIB_CODEGEN_CIRGENMODULE_H
+
+#include "CIRGenTypeCache.h"
+
+#include "clang/AST/ASTContext.h"
+#include "clang/Basic/CodeGenOptions.h"
+#include "clang/Basic/Diagnostic.h"
+#include "mlir/IR/MLIRContext.h"
+
+using namespace clang;
+namespace cir {
+/// Implementation of a CIR/MLIR emission from Clang AST.
+///
+/// This will emit operations that are specific to C(++)/ObjC(++) language,
+/// preserving the semantics of the language and (hopefully) allow to perform
----------------
lanza wrote:

This sounds like what you wrote originally for the `CIRBuilder` class that was the original top level thing. Just going to get rid of it and use the same comment from CodeGenModule since it's less ambitious and more accurate.

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


More information about the cfe-commits mailing list