clang 23.0.0git
InitAllDialects.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Centralised dialect registration for CIR tools. Every tool that parses or
10// transforms CIR (cir-opt, cir-lsp-server, -fclangir...) should call
11// registerAllDialects() instead of registering dialects and extensions
12// individually, so the dialect surface presented to all tools is always
13// consistent.
14//
15//===----------------------------------------------------------------------===//
16
17#ifndef CLANG_CIR_INITALLDIALECTS_H
18#define CLANG_CIR_INITALLDIALECTS_H
19
20namespace mlir {
21class DialectRegistry;
22class MLIRContext;
23} // namespace mlir
24
25namespace cir {
26
27// Populate \p registry with every dialect and dialect extension required to
28// parse, verify and transform CIR.
29void registerAllDialects(mlir::DialectRegistry &registry);
30
31// Convenience overload that registers the same dialects directly into \p
32// context for lazy loading.
33void registerAllDialects(mlir::MLIRContext &context);
34
35} // namespace cir
36
37#endif // CLANG_CIR_INITALLDIALECTS_H
void registerAllDialects(mlir::DialectRegistry &registry)