[llvm-branch-commits] [clang] [CIR][NFC] Add scaffolding for the CIR dialect and CIROps.td (PR #86080)

Mehdi Amini via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Apr 17 15:42:48 PDT 2024


================
@@ -0,0 +1,44 @@
+//===- CIRDialect.td - CIR dialect -------------------------*- tablegen -*-===//
+//
+// 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 file declares the CIR dialect.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_CIR_DIALECT_IR_CIRDIALECT
+#define LLVM_CLANG_CIR_DIALECT_IR_CIRDIALECT
+
+include "mlir/IR/OpBase.td"
+
+def CIR_Dialect : Dialect {
+  let name = "cir";
+
+  // A short one-line summary of our dialect.
+  let summary = "A high-level dialect for analyzing and optimizing Clang "
+                "supported languages";
+
+  let cppNamespace = "::mlir::cir";
+
+  let useDefaultAttributePrinterParser = 0;
+  let useDefaultTypePrinterParser = 0;
+
+  let extraClassDeclaration = [{
+    void registerAttributes();
+    void registerTypes();
+
+    Type parseType(DialectAsmParser &parser) const override;
----------------
joker-eph wrote:

I think I mentioned it elsewhere, but worth keeping in mind: MLIR didn't intend to diverge from LLVM, it started about at the time where there was this plan to adopt a new style for LLVM: https://llvm.org/docs/Proposals/VariableNames.html
So we thought we were just adopting the "new coding style" to limit churn, and unfortunately this didn't pan out for the whole codebase (I think lldb and lld are also using this style now)

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


More information about the llvm-branch-commits mailing list