================
@@ -1441,30 +1441,29 @@ void CIRGenModule::addReplacement(StringRef name,
mlir::Operation *op) {
replacements[name] = op;
}
-void CIRGenModule::replacePointerTypeArgs(cir::FuncOp oldF, cir::FuncOp newF) {
+#ifndef NDEBUG
+static bool verifyPointerTypeArgs(mlir::ModuleOp modOp, cir::FuncOp oldF,
+ cir::FuncOp newF) {
std::optional<mlir::SymbolTable::UseRange> optionalUseRange =
- oldF.getSymbolUses(theModule);
+ oldF.getSymbolUses(modOp);
if (!optionalUseRange)
- return;
+ return true;
for (const mlir::SymbolTable::SymbolUse &u : *optionalUseRange) {
- // CallTryOp only shows up after FlattenCFG.
auto call = mlir::dyn_cast<cir::CallOp>(u.getUser());
if (!call)
continue;
- for (const auto [argOp, fnArgType] :
+ for (auto [argOp, fnArgType] :
llvm::zip(call.getArgs(), newF.getFunctionType().getInputs())) {
- if (argOp.getType() == fnArgType)
- continue;
-
- // The purpose of this entire function is to insert bitcasts in the case
- // where these types don't match, but I haven't seen a case where that
- // happens.
- errorNYI(call.getLoc(), "replace call with mismatched types");
----------------
erichkeane wrote:
Oh neat, I've poked at this a few times and not come up with anything
reasonably actionable, glad to see this is going away.
https://github.com/llvm/llvm-project/pull/191291
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits