Changeset View
Changeset View
Standalone View
Standalone View
languages/clang/duchain/clanghelpers.h
Show All 20 Lines | |||||
21 | 21 | | |||
22 | #ifndef CLANGHELPERS_H | 22 | #ifndef CLANGHELPERS_H | ||
23 | #define CLANGHELPERS_H | 23 | #define CLANGHELPERS_H | ||
24 | 24 | | |||
25 | #include <clang-c/Index.h> | 25 | #include <clang-c/Index.h> | ||
26 | #include <language/duchain/duchainpointer.h> | 26 | #include <language/duchain/duchainpointer.h> | ||
27 | #include <language/duchain/topducontext.h> | 27 | #include <language/duchain/topducontext.h> | ||
28 | 28 | | |||
29 | #include <duchain/clangduchainexport.h> | 29 | #include "clangprivateexport.h" | ||
30 | 30 | | |||
31 | class ParseSession; | 31 | class ParseSession; | ||
32 | class ClangIndex; | 32 | class ClangIndex; | ||
33 | 33 | | |||
34 | struct Import | 34 | struct Import | ||
35 | { | 35 | { | ||
36 | CXFile file; | 36 | CXFile file; | ||
37 | KDevelop::CursorInRevision location; | 37 | KDevelop::CursorInRevision location; | ||
Show All 19 Lines | |||||
57 | /** | 57 | /** | ||
58 | * Wrapper for @ref clang_Cursor_getSpellingNameRange which sometimes reports invalid ranges | 58 | * Wrapper for @ref clang_Cursor_getSpellingNameRange which sometimes reports invalid ranges | ||
59 | */ | 59 | */ | ||
60 | KDevelop::RangeInRevision cursorSpellingNameRange(CXCursor cursor, const KDevelop::Identifier& id); | 60 | KDevelop::RangeInRevision cursorSpellingNameRange(CXCursor cursor, const KDevelop::Identifier& id); | ||
61 | 61 | | |||
62 | /** | 62 | /** | ||
63 | * @returns all the Imports for each file in the @param tu | 63 | * @returns all the Imports for each file in the @param tu | ||
64 | */ | 64 | */ | ||
65 | KDEVCLANGDUCHAIN_EXPORT Imports tuImports(CXTranslationUnit tu); | 65 | KDEVCLANGPRIVATE_EXPORT Imports tuImports(CXTranslationUnit tu); | ||
66 | 66 | | |||
67 | /** | 67 | /** | ||
68 | * Recursively builds a duchain with the specified @param features for the | 68 | * Recursively builds a duchain with the specified @param features for the | ||
69 | * @param file and each of its @param imports using the TU from @param session. | 69 | * @param file and each of its @param imports using the TU from @param session. | ||
70 | * The resulting contexts are placed in @param includedFiles. | 70 | * The resulting contexts are placed in @param includedFiles. | ||
71 | * @returns the context created for @param file | 71 | * @returns the context created for @param file | ||
72 | */ | 72 | */ | ||
73 | KDEVCLANGDUCHAIN_EXPORT KDevelop::ReferencedTopDUContext buildDUChain( | 73 | KDEVCLANGPRIVATE_EXPORT KDevelop::ReferencedTopDUContext buildDUChain( | ||
74 | CXFile file, const Imports& imports, const ParseSession& session, | 74 | CXFile file, const Imports& imports, const ParseSession& session, | ||
75 | KDevelop::TopDUContext::Features features, IncludeFileContexts& includedFiles, | 75 | KDevelop::TopDUContext::Features features, IncludeFileContexts& includedFiles, | ||
76 | ClangIndex* index = nullptr); | 76 | ClangIndex* index = nullptr); | ||
77 | 77 | | |||
78 | /** | 78 | /** | ||
79 | * @return List of possible header extensions used for definition/declaration fallback switching | 79 | * @return List of possible header extensions used for definition/declaration fallback switching | ||
80 | */ | 80 | */ | ||
81 | QStringList headerExtensions(); | 81 | QStringList headerExtensions(); | ||
82 | 82 | | |||
83 | /** | 83 | /** | ||
84 | * @return List of possible source extensions used for definition/declaration fallback switching | 84 | * @return List of possible source extensions used for definition/declaration fallback switching | ||
85 | */ | 85 | */ | ||
86 | QStringList sourceExtensions(); | 86 | QStringList sourceExtensions(); | ||
87 | 87 | | |||
88 | /** | 88 | /** | ||
89 | * @return True if the given file @p path has the extension of a C++ source file | 89 | * @return True if the given file @p path has the extension of a C++ source file | ||
90 | */ | 90 | */ | ||
91 | bool isSource(const QString& path); | 91 | KDEVCLANGPRIVATE_EXPORT bool isSource(const QString& path); | ||
92 | 92 | | |||
93 | /** | 93 | /** | ||
94 | * @return True if the given file @p path has the extension of a C++ header file | 94 | * @return True if the given file @p path has the extension of a C++ header file | ||
95 | */ | 95 | */ | ||
96 | bool isHeader(const QString& path); | 96 | KDEVCLANGPRIVATE_EXPORT bool isHeader(const QString& path); | ||
97 | 97 | | |||
98 | } | 98 | } | ||
99 | 99 | | |||
100 | #endif //CLANGHELPERS_H | 100 | #endif //CLANGHELPERS_H |