================ @@ -562,30 +562,39 @@ bool GreedyPatternRewriteDriver::processWorklist() { // Try to match one of the patterns. The rewriter is automatically // notified of any necessary changes, so there is nothing else to do // here. + std::function<bool(const Pattern &)> canApply = nullptr; + std::function<void(const Pattern &)> onFailure = nullptr; + std::function<LogicalResult(const Pattern &)> onSuccess = nullptr; + bool debugBuild = false; #ifndef NDEBUG - auto canApply = [&](const Pattern &pattern) { - LLVM_DEBUG({ - logger.getOStream() << "\n"; - logger.startLine() << "* Pattern " << pattern.getDebugName() << " : '" - << op->getName() << " -> ("; - llvm::interleaveComma(pattern.getGeneratedOps(), logger.getOStream()); - logger.getOStream() << ")' {\n"; - logger.indent(); - }); - return true; - }; - auto onFailure = [&](const Pattern &pattern) { - LLVM_DEBUG(logResult("failure", "pattern failed to match")); - }; - auto onSuccess = [&](const Pattern &pattern) { - LLVM_DEBUG(logResult("success", "pattern applied successfully")); - return success(); - }; -#else - function_ref<bool(const Pattern &)> canApply = {}; - function_ref<void(const Pattern &)> onFailure = {}; - function_ref<LogicalResult(const Pattern &)> onSuccess = {}; -#endif + debugBuild = true; ---------------- joker-eph wrote:
Why changing the structure of the code with this variable? https://github.com/llvm/llvm-project/pull/84131 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits