diff options
author | Ville Voutilainen <ville.voutilainen@qt.io> | 2022-09-19 19:08:22 +0300 |
---|---|---|
committer | Ville Voutilainen <ville.voutilainen@qt.io> | 2022-09-20 10:37:50 +0300 |
commit | af8e7873980b08e65f5fe1f53e94356aea5cde54 (patch) | |
tree | 7423751b867f6c53748a62ba5d80eda13d2040f2 /src/linguist | |
parent | b69a37e562d261f4a33bea1fbff1aa0ad2263577 (diff) | |
download | qttools-af8e7873980b08e65f5fe1f53e94356aea5cde54.tar.gz |
Remove operator<<(QDebug, const std::string &)
It will come back as a built-in facility of QDebug.
Change-Id: Ie083cc8da3f4f5a3e42bc59ac2a0ced489493610
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/linguist')
-rw-r--r-- | src/linguist/lupdate/clangtoolastreader.cpp | 24 | ||||
-rw-r--r-- | src/linguist/lupdate/cpp_clang.h | 6 | ||||
-rw-r--r-- | src/linguist/lupdate/lupdatepreprocessoraction.cpp | 2 |
3 files changed, 13 insertions, 19 deletions
diff --git a/src/linguist/lupdate/clangtoolastreader.cpp b/src/linguist/lupdate/clangtoolastreader.cpp index d233235d7..09948cf76 100644 --- a/src/linguist/lupdate/clangtoolastreader.cpp +++ b/src/linguist/lupdate/clangtoolastreader.cpp @@ -765,9 +765,9 @@ bool LupdateVisitor::VisitNamedDecl(clang::NamedDecl *namedDeclaration) if (!LupdatePrivate::isFileSignificant(fullLocation.getFileEntry()->getName().str())) return true; - qCDebug(lcClang) << "NamedDecl Name: " << namedDeclaration->getQualifiedNameAsString(); - qCDebug(lcClang) << "NamedDecl source: " << namedDeclaration->getSourceRange().printToString( - m_context->getSourceManager()); + qCDebug(lcClang) << "NamedDecl Name: " << QString::fromStdString(namedDeclaration->getQualifiedNameAsString()); + qCDebug(lcClang) << "NamedDecl source: " << QString::fromStdString(namedDeclaration->getSourceRange().printToString( + m_context->getSourceManager())); // Checks if there is a macro located within the range of this NamedDeclaration // in order to find a context for the macro findContextForTranslationStoresFromPP(namedDeclaration); @@ -795,15 +795,15 @@ void LupdateVisitor::findContextForTranslationStoresFromPP(clang::NamedDecl *nam store.contextRetrieved = LupdatePrivate::contextForNoopMacro(namedDeclaration, sm); qCDebug(lcClang) << "------------------------------------------NOOP Macro in range ---"; - qCDebug(lcClang) << "Range " << namedDeclaration->getSourceRange().printToString(sm); - qCDebug(lcClang) << "Point " << sourceLoc.printToString(sm); + qCDebug(lcClang) << "Range " << QString::fromStdString(namedDeclaration->getSourceRange().printToString(sm)); + qCDebug(lcClang) << "Point " << QString::fromStdString(sourceLoc.printToString(sm)); qCDebug(lcClang) << "=========== Visit Named Declaration ============================="; qCDebug(lcClang) << " Declaration Location " << - namedDeclaration->getSourceRange().printToString(sm); + QString::fromStdString(namedDeclaration->getSourceRange().printToString(sm)); qCDebug(lcClang) << " Macro Location " - << sourceLoc.printToString(sm); + << QString::fromStdString(sourceLoc.printToString(sm)); qCDebug(lcClang) << " Context namedDeclaration->getQualifiedNameAsString() " - << namedDeclaration->getQualifiedNameAsString(); + << QString::fromStdString(namedDeclaration->getQualifiedNameAsString()); qCDebug(lcClang) << " Context LupdatePrivate::contextForNoopMacro " << store.contextRetrieved; qCDebug(lcClang) << " Context Retrieved " << store.contextRetrieved; @@ -820,13 +820,13 @@ void LupdateVisitor::findContextForTranslationStoresFromPP(clang::NamedDecl *nam store.contextRetrieved = QString::fromStdString( namedDeclaration->getQualifiedNameAsString()); qCDebug(lcClang) << "------------------------------------------DECL Macro in range ---"; - qCDebug(lcClang) << "Range " << namedDeclaration->getSourceRange().printToString(sm); - qCDebug(lcClang) << "Point " << sourceLoc.printToString(sm); + qCDebug(lcClang) << "Range " << QString::fromStdString(namedDeclaration->getSourceRange().printToString(sm)); + qCDebug(lcClang) << "Point " << QString::fromStdString(sourceLoc.printToString(sm)); qCDebug(lcClang) << "=========== Visit Named Declaration ============================="; qCDebug(lcClang) << " Declaration Location " << - namedDeclaration->getSourceRange().printToString(sm); + QString::fromStdString(namedDeclaration->getSourceRange().printToString(sm)); qCDebug(lcClang) << " Macro Location " - << sourceLoc.printToString(sm); + << QString::fromStdString(sourceLoc.printToString(sm)); qCDebug(lcClang) << " Context namedDeclaration->getQualifiedNameAsString() " << store.contextRetrieved; qCDebug(lcClang) << " Context Retrieved " << store.contextRetrieved; diff --git a/src/linguist/lupdate/cpp_clang.h b/src/linguist/lupdate/cpp_clang.h index 0f98fa98e..88e25facd 100644 --- a/src/linguist/lupdate/cpp_clang.h +++ b/src/linguist/lupdate/cpp_clang.h @@ -31,12 +31,6 @@ QT_WARNING_POP QT_BEGIN_NAMESPACE -inline QDebug operator<<(QDebug out, const std::string& str) -{ - out << QString::fromStdString(str); - return out; -} - Q_DECLARE_LOGGING_CATEGORY(lcClang) inline QString toQt(llvm::StringRef str) diff --git a/src/linguist/lupdate/lupdatepreprocessoraction.cpp b/src/linguist/lupdate/lupdatepreprocessoraction.cpp index d7446c364..abfab34e5 100644 --- a/src/linguist/lupdate/lupdatepreprocessoraction.cpp +++ b/src/linguist/lupdate/lupdatepreprocessoraction.cpp @@ -144,7 +144,7 @@ void LupdatePPCallbacks::SourceRangeSkipped(clang::SourceRange sourceRange, const char *end = sm.getCharacterData(sourceRange.getEnd()); llvm::StringRef skippedText = llvm::StringRef(begin, end - begin); if (ClangCppParser::stringContainsTranslationInformation(skippedText)) { - qCDebug(lcClang) << "SourceRangeSkipped: skipped text:" << skippedText.str(); + qCDebug(lcClang) << "SourceRangeSkipped: skipped text:" << QString::fromStdString(skippedText.str()); unsigned int beginLine = sm.getExpansionLineNumber(sourceRange.getBegin()); unsigned int endLine = sm.getExpansionLineNumber(sourceRange.getEnd()); qWarning("%s Code with translation information has been skipped " |