comparison 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
comparison
equal deleted inserted replaced
172:9fbae9c8bf63 173:0572611fdcc8
23 23
24 std::unique_ptr<llvm::Module> mlir::translateModuleToLLVMIR(ModuleOp m) { 24 std::unique_ptr<llvm::Module> mlir::translateModuleToLLVMIR(ModuleOp m) {
25 return LLVM::ModuleTranslation::translateModule<>(m); 25 return LLVM::ModuleTranslation::translateModule<>(m);
26 } 26 }
27 27
28 static TranslateFromMLIRRegistration 28 namespace mlir {
29 registration("mlir-to-llvmir", [](ModuleOp module, raw_ostream &output) { 29 void registerToLLVMIRTranslation() {
30 auto llvmModule = LLVM::ModuleTranslation::translateModule<>(module); 30 TranslateFromMLIRRegistration registration(
31 if (!llvmModule) 31 "mlir-to-llvmir", [](ModuleOp module, raw_ostream &output) {
32 return failure(); 32 auto llvmModule = LLVM::ModuleTranslation::translateModule<>(module);
33 if (!llvmModule)
34 return failure();
33 35
34 llvmModule->print(output, nullptr); 36 llvmModule->print(output, nullptr);
35 return success(); 37 return success();
36 }); 38 });
39 }
40 } // namespace mlir