================ @@ -65,7 +80,27 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> { cgf.getLoc(e->getExprLoc()), type, builder.getCIRBoolAttr(e->getValue())); } + + mlir::Value VisitCastExpr(CastExpr *E); + + /// Emit a conversion from the specified type to the specified destination + /// type, both of which are CIR scalar types. + /// TODO: do we need ScalarConversionOpts here? Should be done in another + /// pass. + mlir::Value emitScalarConversion(mlir::Value src, QualType srcType, + QualType dstType, SourceLocation loc) { + // No sort of type conversion is implemented yet, but the path for implicit + // paths goes through here even if the type isn't being changed. + srcType = cgf.getContext().getCanonicalType(srcType); + dstType = cgf.getContext().getCanonicalType(dstType); + if (srcType == dstType) ---------------- andykaylor wrote:
It's going to be expanded to handle mixed types, so I don't think it makes sense to reduce the implementation now only to have to break it apart later. https://github.com/llvm/llvm-project/pull/128792 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits