diff options
Diffstat (limited to 'include/clang/Basic/Module.h')
-rw-r--r-- | include/clang/Basic/Module.h | 26 |
1 files changed, 22 insertions, 4 deletions
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. /// |