[flang-commits] [flang] [flang] Do not produce result for void runtime call (PR #123155)

Valentin Clement バレンタイン クレメン via flang-commits flang-commits at lists.llvm.org
Thu Jan 16 09:01:58 PST 2025


================
@@ -776,6 +776,9 @@ static mlir::func::FuncOp getRuntimeFunc(mlir::Location loc,
   if (func)
     return func;
   auto funTy = RuntimeEntry::getTypeModel()(builder.getContext());
+  if (funTy.getResults().size() == 1 &&
+      mlir::isa<mlir::NoneType>(funTy.getResult(0)))
+    funTy = mlir::FunctionType::get(funTy.getContext(), funTy.getInputs(), {});
----------------
clementval wrote:

Yes that looks like a better place. I'll update the patch 

https://github.com/llvm/llvm-project/pull/123155


More information about the flang-commits mailing list