diff mlir/lib/Target/LLVMIR/ConvertToLLVMIR.cpp @ 173:0572611fdcc8 llvm10 llvm12

reorgnization done
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 11:55:54 +0900
parents 1d019706d866
children 2e18cbf3894f
line wrap: on
line diff
--- a/mlir/lib/Target/LLVMIR/ConvertToLLVMIR.cpp	Mon May 25 11:50:15 2020 +0900
+++ b/mlir/lib/Target/LLVMIR/ConvertToLLVMIR.cpp	Mon May 25 11:55:54 2020 +0900
@@ -25,12 +25,16 @@
   return LLVM::ModuleTranslation::translateModule<>(m);
 }
 
-static TranslateFromMLIRRegistration
-    registration("mlir-to-llvmir", [](ModuleOp module, raw_ostream &output) {
-      auto llvmModule = LLVM::ModuleTranslation::translateModule<>(module);
-      if (!llvmModule)
-        return failure();
+namespace mlir {
+void registerToLLVMIRTranslation() {
+  TranslateFromMLIRRegistration registration(
+      "mlir-to-llvmir", [](ModuleOp module, raw_ostream &output) {
+        auto llvmModule = LLVM::ModuleTranslation::translateModule<>(module);
+        if (!llvmModule)
+          return failure();
 
-      llvmModule->print(output, nullptr);
-      return success();
-    });
+        llvmModule->print(output, nullptr);
+        return success();
+      });
+}
+} // namespace mlir