ValueRange to TypeRange Conversion Error on Windows-VS2019 Build

Hi

Here is the fumction call which seems to be working fine on Linux/Ubuntu
getOrInsertFunctionOp(conv_channel_split_func_name, rewriter, TypeRange(gpxSplitOp->getResults()), ValueRange(gpxSplitOp->getOperands()), moduleOp, true );

On windows(VS2019-community) Getting the following conversion compilation error.

: error C2664: ‘mlir::FlatSymbolRefAttr getOrInsertFunctionOp(llvm::StringRef,mlir::PatternRewriter &,mlir::TypeRange,mlir::TypeRange,mlir::ModuleOp,bool)’: cannot convert argument 4 from ‘mlir::ValueRange’ to ‘mlir::TypeRange’

: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
: see declaration of ‘getOrInsertFunctionOp’

The above call is working fine on Linux/Ubuntu. Great if I know how to fix it for windows build.

Thanks
Channa

Could you please post a reproducible code snippet along with the version of the compiler used (Linux/Ubuntu doesn’t say anything).

From the looks of it, your code is incorrect: it passes a ValueRange when a TypeRange is expected. MSVC is right.

1 Like