diff options
author | Ivan Donchevskii <[email protected]> | 2018-01-17 15:08:30 +0100 |
---|---|---|
committer | Ivan Donchevskii <[email protected]> | 2018-04-13 12:34:53 +0000 |
commit | e9c462391ed3526097ca8121cce5cf8c84df1435 (patch) | |
tree | 81e6742572d2cc59a9d07899c68a90e725141102 /src/plugins/clangtools/clangtoolsdiagnostic.cpp | |
parent | 8936e5103367e300ac2b31ae5d4cf547425dc2a7 (diff) |
ClangTools: Split generic part from static analyzer tool
To reuse it for other clang-based tools.
Change-Id: I6c0d8e9eee543fa08faf3bf93c9fac33e43c6820
Reviewed-by: Nikolai Kosjar <[email protected]>
Reviewed-by: Alessandro Portale <[email protected]>
Diffstat (limited to 'src/plugins/clangtools/clangtoolsdiagnostic.cpp')
-rw-r--r-- | src/plugins/clangtools/clangtoolsdiagnostic.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/plugins/clangtools/clangtoolsdiagnostic.cpp b/src/plugins/clangtools/clangtoolsdiagnostic.cpp new file mode 100644 index 00000000000..078113fe9e6 --- /dev/null +++ b/src/plugins/clangtools/clangtoolsdiagnostic.cpp @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** 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. +** +****************************************************************************/ + +#include "clangtoolsdiagnostic.h" + +namespace ClangTools { +namespace Internal { + +ExplainingStep::ExplainingStep() + : depth(0) +{ +} + +bool ExplainingStep::isValid() const +{ + return location.isValid() && !ranges.isEmpty() && !message.isEmpty(); +} + +bool Diagnostic::isValid() const +{ + return !description.isEmpty(); +} + +} // namespace Internal +} // namespace ClangTools |