diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/clang-c/Index.h | 8 | ||||
-rw-r--r-- | include/clang/Basic/Module.h | 26 |
2 files changed, 27 insertions, 7 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h index 07c0ffb443..71d3443ae6 100644 --- a/include/clang-c/Index.h +++ b/include/clang-c/Index.h @@ -32,7 +32,7 @@ * compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable. */ #define CINDEX_VERSION_MAJOR 0 -#define CINDEX_VERSION_MINOR 14 +#define CINDEX_VERSION_MINOR 15 #define CINDEX_VERSION_ENCODE(major, minor) ( \ ((major) * 10000) \ @@ -3347,7 +3347,8 @@ CINDEX_LINKAGE CXString clang_Module_getFullName(CXModule Module); * * \returns the number of top level headers associated with this module. */ -CINDEX_LINKAGE unsigned clang_Module_getNumTopLevelHeaders(CXModule Module); +CINDEX_LINKAGE unsigned clang_Module_getNumTopLevelHeaders(CXTranslationUnit, + CXModule Module); /** * \param Module a module object. @@ -3357,7 +3358,8 @@ CINDEX_LINKAGE unsigned clang_Module_getNumTopLevelHeaders(CXModule Module); * \returns the specified top level header associated with the module. */ CINDEX_LINKAGE -CXFile clang_Module_getTopLevelHeader(CXModule Module, unsigned Index); +CXFile clang_Module_getTopLevelHeader(CXTranslationUnit, + CXModule Module, unsigned Index); /** * @} diff --git a/include/clang/Basic/Module.h b/include/clang/Basic/Module.h index db636e5cd4..5f081e0f56 100644 --- a/include/clang/Basic/Module.h +++ b/include/clang/Basic/Module.h @@ -34,6 +34,7 @@ namespace clang { class DirectoryEntry; class FileEntry; +class FileManager; class LangOptions; class TargetInfo; @@ -67,7 +68,13 @@ private: /// \brief The AST file if this is a top-level module which has a /// corresponding serialized AST file, or null otherwise. const FileEntry *ASTFile; - + + /// \brief The top-level headers associated with this module. + llvm::SmallSetVector<const FileEntry *, 2> TopHeaders; + + /// \brief top-level header filenames that aren't resolved to FileEntries yet. + std::vector<std::string> TopHeaderNames; + public: /// \brief The headers that are part of this module. SmallVector<const FileEntry *, 2> Headers; @@ -75,9 +82,6 @@ public: /// \brief The headers that are explicitly excluded from this module. SmallVector<const FileEntry *, 2> ExcludedHeaders; - /// \brief The top-level headers associated with this module. - llvm::SmallSetVector<const FileEntry *, 2> TopHeaders; - /// \brief The set of language features required to use this module. /// /// If any of these features is not present, the \c IsAvailable bit @@ -292,6 +296,20 @@ public: return Umbrella && Umbrella.is<const DirectoryEntry *>(); } + /// \brief Add a top-level header associated with this module. + void addTopHeader(const FileEntry *File) { + assert(File); + TopHeaders.insert(File); + } + + /// \brief Add a top-level header filename associated with this module. + void addTopHeaderFilename(StringRef Filename) { + TopHeaderNames.push_back(Filename); + } + + /// \brief The top-level headers associated with this module. + ArrayRef<const FileEntry *> getTopHeaders(FileManager &FileMgr); + /// \brief Add the given feature requirement to the list of features /// required by this module. /// |