From 1a9dec0dda0064cd0035d70b6534a65856b7a212 Mon Sep 17 00:00:00 2001 From: Slava Zakharin Date: Sat, 17 Dec 2022 13:03:54 -0800 Subject: [PATCH] [flang] Fixed buildbot failured after D140236. Removed unused functions searchFunctionInLibrary and getFuncOp. Differential Revision: https://reviews.llvm.org/D140236 --- flang/lib/Lower/IntrinsicCall.cpp | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/flang/lib/Lower/IntrinsicCall.cpp b/flang/lib/Lower/IntrinsicCall.cpp index 3a73b6b..883d129 100644 --- a/flang/lib/Lower/IntrinsicCall.cpp +++ b/flang/lib/Lower/IntrinsicCall.cpp @@ -1686,44 +1686,6 @@ private: bool infinite = false; // When forbidden conversion or wrong argument number }; -/// Build mlir::func::FuncOp from runtime symbol description and add -/// fir.runtime attribute. -static mlir::func::FuncOp getFuncOp(mlir::Location loc, - fir::FirOpBuilder &builder, - const RuntimeFunction &runtime) { - mlir::func::FuncOp function = builder.addNamedFunction( - loc, runtime.symbol, runtime.typeGenerator(builder.getContext())); - function->setAttr("fir.runtime", builder.getUnitAttr()); - return function; -} - -/// Select runtime function that has the smallest distance to the intrinsic -/// function type and that will not imply narrowing arguments or extending the -/// result. -/// If nothing is found, the mlir::func::FuncOp will contain a nullptr. -static mlir::func::FuncOp searchFunctionInLibrary( - mlir::Location loc, fir::FirOpBuilder &builder, - const Fortran::common::StaticMultimapView &lib, - llvm::StringRef name, mlir::FunctionType funcType, - const RuntimeFunction **bestNearMatch, - FunctionDistance &bestMatchDistance) { - std::pair range = - lib.equal_range(name); - for (auto iter = range.first; iter != range.second && iter; ++iter) { - const RuntimeFunction &impl = *iter; - mlir::FunctionType implType = impl.typeGenerator(builder.getContext()); - if (funcType == implType) - return getFuncOp(loc, builder, impl); // exact match - - FunctionDistance distance(funcType, implType); - if (distance.isSmallerThan(bestMatchDistance)) { - *bestNearMatch = &impl; - bestMatchDistance = std::move(distance); - } - } - return {}; -} - using RtMap = Fortran::common::StaticMultimapView; static constexpr RtMap mathOps(mathOperations); static_assert(mathOps.Verify() && "map must be sorted"); -- 2.7.4