File indexing completed on 2024-05-12 04:39:12

0001 /*
0002     SPDX-FileCopyrightText: 2014 Olivier de Gaalon <olivier.jg@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 #ifndef CLANGPCH_H
0008 #define CLANGPCH_H
0009 
0010 #include <language/duchain/topducontext.h>
0011 #include <util/path.h>
0012 
0013 #include "parsesession.h"
0014 #include "clanghelpers.h"
0015 
0016 class ClangParsingEnvironment;
0017 
0018 class KDEVCLANGPRIVATE_EXPORT ClangPCH
0019 {
0020 public:
0021     ClangPCH(const ClangParsingEnvironment& environment, ClangIndex* index);
0022 
0023     IncludeFileContexts mapIncludes(CXTranslationUnit tu) const;
0024 
0025     CXFile mapFile(CXTranslationUnit tu) const;
0026 
0027     KDevelop::ReferencedTopDUContext context() const;
0028 
0029 private:
0030     Q_DISABLE_COPY(ClangPCH)
0031 
0032     IncludeFileContexts m_includes;
0033     KDevelop::ReferencedTopDUContext m_context;
0034     ParseSession m_session;
0035 };
0036 
0037 #endif //CLANGPCH_H