From c93e98648c9250c5731bf9af9d44a81946419514 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 14 Jan 2025 15:43:30 -0800 Subject: [PATCH] qlogging.cpp: clean up of QT_BOOTSTRAPPED Amends commit df2e07549e6edd1d271cce1d86cadd4a33dfd8fc which removed this file from the bootstrap build. Drive-by remove pre-thread_local content, which isn't needed in 2025. Change-Id: I406c748a5f0aedb5a846fffde5a2f5eb5f875f14 Reviewed-by: Ahmad Samir --- src/corelib/global/qlogging.cpp | 53 +++++---------------------------- 1 file changed, 8 insertions(+), 45 deletions(-) diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 02a5b0a0ce1..e9fd1b99213 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -92,9 +92,7 @@ QT_BEGIN_NAMESPACE using namespace Qt::StringLiterals; -#ifndef QT_BOOTSTRAPPED Q_TRACE_POINT(qtcore, qt_message_print, int type, const char *category, const char *function, const char *file, int line, const QString &message); -#endif /*! \headerfile @@ -883,7 +881,6 @@ QDebug QMessageLogger::fatal(QMessageLogger::CategoryFunction catFunc) const } #endif // QT_NO_DEBUG_STREAM -#if !defined(QT_BOOTSTRAPPED) static bool isDefaultCategory(const char *category) { return !category || strcmp(category, "default") == 0; @@ -1113,9 +1110,7 @@ struct QMessagePattern std::unique_ptr[]> literals; std::unique_ptr tokens; QList timeArgs; // timeFormats in sequence of %{time -#ifndef QT_BOOTSTRAPPED std::chrono::steady_clock::time_point appStartTime = std::chrono::steady_clock::now(); -#endif struct BacktraceParams { QString backtraceSeparator; @@ -1533,7 +1528,13 @@ static QString formatBacktraceForLogMessage(const QMessagePattern::BacktracePara return frames.join(backtraceSeparator); } -#endif // QLOGGING_HAVE_BACKTRACE && !QT_BOOTSTRAPPED +#else +void QInternalMessageLogContext::populateBacktrace(int) +{ + // initFrom() returns 0 to our caller, so we should never get here + Q_UNREACHABLE(); +} +#endif // !QLOGGING_HAVE_BACKTRACE Q_GLOBAL_STATIC(QMessagePattern, qMessagePattern) @@ -1675,20 +1676,6 @@ static QString formatLogMessage(QtMsgType type, const QMessageLogContext &contex } return message; } -#else // QT_BOOTSTRAPPED -static QString formatLogMessage(QtMsgType type, const QMessageLogContext &context, const QString &str) -{ - Q_UNUSED(type); - Q_UNUSED(context); - return str; -} -#endif -#ifndef QLOGGING_HAVE_BACKTRACE -void QInternalMessageLogContext::populateBacktrace(int) -{ - Q_UNREACHABLE(); -} -#endif static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &buf); @@ -1697,10 +1684,6 @@ Q_CONSTINIT static QBasicAtomicPointerfromEnvironment) qMessagePattern()->setPattern(pattern); } -#endif static void copyInternalContext(QInternalMessageLogContext *self, const QMessageLogContext &logContext) noexcept