[clang] [CIR] Call code gen; create empty cir.func op (PR #113483)
Schrodinger ZHU Yifan via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 23 11:51:51 PDT 2024
================
@@ -16,4 +16,50 @@
include "clang/CIR/Dialect/IR/CIRDialect.td"
+include "mlir/Interfaces/ControlFlowInterfaces.td"
+include "mlir/Interfaces/FunctionInterfaces.td"
+include "mlir/Interfaces/InferTypeOpInterface.td"
+include "mlir/Interfaces/LoopLikeInterface.td"
+include "mlir/Interfaces/MemorySlotInterfaces.td"
+include "mlir/Interfaces/SideEffectInterfaces.td"
+
+include "mlir/IR/BuiltinAttributeInterfaces.td"
+include "mlir/IR/EnumAttr.td"
+include "mlir/IR/SymbolInterfaces.td"
+include "mlir/IR/CommonAttrConstraints.td"
+
+//===----------------------------------------------------------------------===//
+// CIR Ops
+//===----------------------------------------------------------------------===//
+
+class LLVMLoweringInfo {
+ string llvmOp = "";
+}
+
+class CIR_Op<string mnemonic, list<Trait> traits = []> :
+ Op<CIR_Dialect, mnemonic, traits>, LLVMLoweringInfo;
+
+//===----------------------------------------------------------------------===//
+// FuncOp
+//===----------------------------------------------------------------------===//
+
+// For starters, cir.func has only name, nothing else. The other properties
+// of a function will be added over time as more of ClangIR is upstreamed.
+
+def FuncOp : CIR_Op<"func"> {
----------------
SchrodingerZhu wrote:
Maybe mention that some traits are to be added
https://github.com/llvm/llvm-project/pull/113483
More information about the cfe-commits
mailing list