diff options
author | Marco Bubke <marco.bubke@qt.io> | 2018-02-20 12:43:05 +0100 |
---|---|---|
committer | Marco Bubke <marco.bubke@qt.io> | 2018-03-22 13:26:24 +0000 |
commit | 53454b0f79fcfebab909d071e931557114ace558 (patch) | |
tree | 29294d846f6d93130324cb36d0f365b67d69bf21 /src/plugins/clangrefactoring | |
parent | 70f5e0e2643a7678e9d2b0aa57063b986acdfcaf (diff) |
Clang: Use PCHs for indexing
As generating the AST is quite expensive it would be very useful to cache
the not changed include. So we generate PCHs for include outside of a
project part. With this change this PCHs are used by the indexer.
For that they are save to the symbol database by the PCH manager and when
fetched by the symbol indexer.
Change-Id: I7a5b07cfb32d72d50dc52d2b108cd41727a7bfc7
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Diffstat (limited to 'src/plugins/clangrefactoring')
3 files changed, 90 insertions, 2 deletions
diff --git a/src/plugins/clangrefactoring/clangrefactoring-source.pri b/src/plugins/clangrefactoring/clangrefactoring-source.pri index 1b4b5e8c67d..ee0a43e3646 100644 --- a/src/plugins/clangrefactoring/clangrefactoring-source.pri +++ b/src/plugins/clangrefactoring/clangrefactoring-source.pri @@ -23,7 +23,8 @@ HEADERS += \ $$PWD/class.h \ $$PWD/enum.h \ $$PWD/function.h \ - $$PWD/include.h + $$PWD/include.h \ + $$PWD/projectpartproviderinterface.h SOURCES += \ $$PWD/clangqueryexamplehighlighter.cpp \ @@ -40,4 +41,5 @@ SOURCES += \ $$PWD/refactoringprojectupdater.cpp \ $$PWD/searchinterface.cpp \ $$PWD/searchhandle.cpp \ - $$PWD/symbolsfindfilter.cpp + $$PWD/symbolsfindfilter.cpp \ + $$PWD/projectpartproviderinterface.cpp diff --git a/src/plugins/clangrefactoring/projectpartproviderinterface.cpp b/src/plugins/clangrefactoring/projectpartproviderinterface.cpp new file mode 100644 index 00000000000..bea89f5b72b --- /dev/null +++ b/src/plugins/clangrefactoring/projectpartproviderinterface.cpp @@ -0,0 +1,32 @@ +/**************************************************************************** +** +** Copyright (C) 2017 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 "projectpartproviderinterface.h" + +namespace ClangRefactoring { + +ProjectPartProviderInterface::~ProjectPartProviderInterface() = default; + +} // namespace ClangRefactoring diff --git a/src/plugins/clangrefactoring/projectpartproviderinterface.h b/src/plugins/clangrefactoring/projectpartproviderinterface.h new file mode 100644 index 00000000000..87b3e0d5f1f --- /dev/null +++ b/src/plugins/clangrefactoring/projectpartproviderinterface.h @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2017 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. +** +****************************************************************************/ + +#pragma once + +#include "filecontainerv2.h" + +#include <QString> + +namespace CppTools { +class ProjectPart; +} + +namespace ClangRefactoring { + +class ProjectPartProviderInterface +{ +public: + ProjectPartProviderInterface() = default; + virtual ~ProjectPartProviderInterface(); + + ProjectPartProviderInterface(const ProjectPartProviderInterface&) = delete; + ProjectPartProviderInterface& operator=(const ProjectPartProviderInterface&) = delete; + + ProjectPartProviderInterface(ProjectPartProviderInterface&&) = default; + ProjectPartProviderInterface& operator=(ProjectPartProviderInterface&&) = default; + + virtual CppTools::ProjectPart *projectPart(const QString &projectPartId) const = 0; + virtual ClangBackEnd::V2::FileContainers generatedFiles() const = 0; +}; + +} // namespace ClangRefactoring |