MLIR  19.0.0git
InitAllTranslations.h
Go to the documentation of this file.
1 //===- InitAllTranslations.h - MLIR Translations Registration ---*- C++ -*-===//
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 // This file defines a helper to trigger the registration of all translations
10 // in and out of MLIR to the system.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef MLIR_INITALLTRANSLATIONS_H
15 #define MLIR_INITALLTRANSLATIONS_H
16 
17 namespace mlir {
18 
24 
25 // This function should be called before creating any MLIRContext if one
26 // expects all the possible translations to be made available to the context
27 // automatically.
28 inline void registerAllTranslations() {
29  static bool initOnce = []() {
35  return true;
36  }();
37  (void)initOnce;
38 }
39 } // namespace mlir
40 
41 #endif // MLIR_INITALLTRANSLATIONS_H
Include the generated interface declarations.
void registerToLLVMIRTranslation()
void registerFromSPIRVTranslation()
void registerToCppTranslation()
void registerFromLLVMIRTranslation()
void registerAllTranslations()
void registerToSPIRVTranslation()