[Mlir-commits] [mlir] [mlir] Fix compile error in Inliner.cpp when NDEBUG is set (PR #150850)

Timo Nicolai llvmlistbot at llvm.org
Sun Jul 27 12:44:45 PDT 2025


https://github.com/Time0o created https://github.com/llvm/llvm-project/pull/150850

I just noticed this while trying to build the current main branch. The way `LDBG` is defined it must be possible to evaluate its arguments even when it turns into a no-op and there seems to be this one case here where that is not true.

>From 434fc260dd70553c5e246129d5bf71688da0d5f7 Mon Sep 17 00:00:00 2001
From: Timo Nicolai <timo.nicolai94 at gmail.com>
Date: Sun, 27 Jul 2025 21:34:14 +0200
Subject: [PATCH] [mlir] Fix compile error in Inliner.cpp when NDEBUG is set

Fix a compile error in Inliner.cpp introduced by c28dfa13417cd that manifest
due to a missing getNodeName definition in a call to LDBG when NDEBUG is set.
---
 mlir/lib/Transforms/Utils/Inliner.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mlir/lib/Transforms/Utils/Inliner.cpp b/mlir/lib/Transforms/Utils/Inliner.cpp
index dc780652cbe9d..d8d87c18d6457 100644
--- a/mlir/lib/Transforms/Utils/Inliner.cpp
+++ b/mlir/lib/Transforms/Utils/Inliner.cpp
@@ -667,9 +667,11 @@ Inliner::Impl::inlineCallsInSCC(InlinerInterfaceImpl &inlinerIface,
     auto historyToString = [](InlineHistoryT h) {
       return h.has_value() ? std::to_string(*h) : "root";
     };
+#ifndef NDEBUG
     LDBG() << "* new inlineHistory entry: " << newInlineHistoryID << ". ["
            << getNodeName(call) << ", " << historyToString(inlineHistoryID)
            << "]";
+#endif
 
     for (unsigned k = prevSize; k != calls.size(); ++k) {
       callHistory.push_back(newInlineHistoryID);



More information about the Mlir-commits mailing list