summaryrefslogtreecommitdiffstats
path: root/src/linguist/lupdate/cpp_clang.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/linguist/lupdate/cpp_clang.h')
-rw-r--r--src/linguist/lupdate/cpp_clang.h55
1 files changed, 11 insertions, 44 deletions
diff --git a/src/linguist/lupdate/cpp_clang.h b/src/linguist/lupdate/cpp_clang.h
index f27ee2bb0..88e25facd 100644
--- a/src/linguist/lupdate/cpp_clang.h
+++ b/src/linguist/lupdate/cpp_clang.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Linguist of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#ifndef CLANG_CPP_H
#define CLANG_CPP_H
@@ -36,22 +11,19 @@
#include <QtCore/qregularexpression.h>
#include <QtCore/qstring.h>
-#if defined(Q_CC_MSVC)
-# pragma warning(push)
-# pragma warning(disable: 4100)
-# pragma warning(disable: 4146)
-# pragma warning(disable: 4267)
-# pragma warning(disable: 4624)
-#endif
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_MSVC(4100)
+QT_WARNING_DISABLE_MSVC(4146)
+QT_WARNING_DISABLE_MSVC(4267)
+QT_WARNING_DISABLE_MSVC(4624)
+QT_WARNING_DISABLE_GCC("-Wnonnull")
#include <llvm/ADT/StringRef.h>
#include <clang/Basic/SourceLocation.h>
#include <clang/Basic/SourceManager.h>
#include <clang/Basic/FileManager.h>
-#if defined(Q_CC_MSVC)
-# pragma warning(pop)
-#endif
+QT_WARNING_POP
#include <vector>
#include <iostream>
@@ -59,12 +31,6 @@
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)
@@ -87,6 +53,7 @@ struct TranslationRelatedStore
QString contextRetrieved;
QString lupdateSource;
QString lupdateLocationFile;
+ QString lupdateInputFile; // file associated to the running of the tool
qint64 lupdateLocationLine = -1;
QString lupdateId;
QString lupdateSourceWhenId;
@@ -338,7 +305,7 @@ namespace ClangCppParser
void finalize(ReadSynchronizedRef<TranslationRelatedStore> &ast,
WriteSynchronizedRef<TranslationRelatedStore> &newAst);
- bool containsTranslationInformation(llvm::StringRef ba);
+ bool stringContainsTranslationInformation(llvm::StringRef ba);
bool hasAliases();
std::vector<std::string> getAliasFunctionDefinition();