diff options
Diffstat (limited to 'clang/include/clang')
-rw-r--r-- | clang/include/clang/Driver/Options.td | 4 | ||||
-rw-r--r-- | clang/include/clang/Lex/HeaderSearch.h | 30 | ||||
-rw-r--r-- | clang/include/clang/Lex/HeaderSearchOptions.h | 4 | ||||
-rw-r--r-- | clang/include/clang/Serialization/ASTReader.h | 10 | ||||
-rw-r--r-- | clang/include/clang/Serialization/ModuleManager.h | 14 |
5 files changed, 14 insertions, 48 deletions
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 38b694fd5dd..2f8ededbc09 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -1125,8 +1125,8 @@ def fmodule_map_file : Joined<["-"], "fmodule-map-file=">, Group<f_Group>, Flags<[DriverOption,CC1Option]>, MetaVarName<"<file>">, HelpText<"Load this module map file">; def fmodule_file : Joined<["-"], "fmodule-file=">, - Group<i_Group>, Flags<[DriverOption,CC1Option]>, MetaVarName<"[<name>=]<file>">, - HelpText<"Specify the mapping of module name to precompiled module file, or load a module file if name is omitted.">; + Group<f_Group>, Flags<[DriverOption,CC1Option]>, + HelpText<"Load this precompiled module file">, MetaVarName<"<file>">; def fmodules_ignore_macro : Joined<["-"], "fmodules-ignore-macro=">, Group<f_Group>, Flags<[CC1Option]>, HelpText<"Ignore the definition of the given macro when building and loading modules">; def fmodules_decluse : Flag <["-"], "fmodules-decluse">, Group<f_Group>, diff --git a/clang/include/clang/Lex/HeaderSearch.h b/clang/include/clang/Lex/HeaderSearch.h index 126bbdfc139..1b7f80c87ff 100644 --- a/clang/include/clang/Lex/HeaderSearch.h +++ b/clang/include/clang/Lex/HeaderSearch.h @@ -471,41 +471,29 @@ public: /// \brief Get filenames for all registered header maps. void getHeaderMapFileNames(SmallVectorImpl<std::string> &Names) const; - /// \brief Retrieve the name of the cached module file that should be used - /// to load the given module. + /// \brief Retrieve the name of the module file that should be used to + /// load the given module. /// /// \param Module The module whose module file name will be returned. /// /// \returns The name of the module file that corresponds to this module, /// or an empty string if this module does not correspond to any module file. - std::string getCachedModuleFileName(Module *Module); + std::string getModuleFileName(Module *Module); - /// \brief Retrieve the name of the prebuilt module file that should be used - /// to load a module with the given name. - /// - /// \param ModuleName The module whose module file name will be returned. - /// - /// \param FileMapOnly If true, then only look in the explicit module name - // to file name map and skip the directory search. - /// - /// \returns The name of the module file that corresponds to this module, - /// or an empty string if this module does not correspond to any module file. - std::string getPrebuiltModuleFileName(StringRef ModuleName, - bool FileMapOnly = false); - - - /// \brief Retrieve the name of the (to-be-)cached module file that should - /// be used to load a module with the given name. + /// \brief Retrieve the name of the module file that should be used to + /// load a module with the given name. /// /// \param ModuleName The module whose module file name will be returned. /// /// \param ModuleMapPath A path that when combined with \c ModuleName /// uniquely identifies this module. See Module::ModuleMap. /// + /// \param UsePrebuiltPath Whether we should use the prebuilt module path. + /// /// \returns The name of the module file that corresponds to this module, /// or an empty string if this module does not correspond to any module file. - std::string getCachedModuleFileName(StringRef ModuleName, - StringRef ModuleMapPath); + std::string getModuleFileName(StringRef ModuleName, StringRef ModuleMapPath, + bool UsePrebuiltPath); /// \brief Lookup a module Search for a module with the given name. /// diff --git a/clang/include/clang/Lex/HeaderSearchOptions.h b/clang/include/clang/Lex/HeaderSearchOptions.h index 356f500335e..ca3a84e75e1 100644 --- a/clang/include/clang/Lex/HeaderSearchOptions.h +++ b/clang/include/clang/Lex/HeaderSearchOptions.h @@ -17,7 +17,6 @@ #include "llvm/ADT/StringRef.h" #include <string> #include <vector> -#include <map> namespace clang { @@ -95,9 +94,6 @@ public: /// \brief The directory used for a user build. std::string ModuleUserBuildPath; - /// \brief The mapping of module names to prebuilt module files. - std::map<std::string, std::string> PrebuiltModuleFiles; - /// \brief The directories used to load prebuilt module files. std::vector<std::string> PrebuiltModulePaths; diff --git a/clang/include/clang/Serialization/ASTReader.h b/clang/include/clang/Serialization/ASTReader.h index 94ac9f2face..ec6e148dd77 100644 --- a/clang/include/clang/Serialization/ASTReader.h +++ b/clang/include/clang/Serialization/ASTReader.h @@ -2142,19 +2142,9 @@ public: // \brief Read a string static std::string ReadString(const RecordData &Record, unsigned &Idx); - // \brief Skip a string - static void SkipString(const RecordData &Record, unsigned &Idx) { - Idx += Record[Idx] + 1; - } - // \brief Read a path std::string ReadPath(ModuleFile &F, const RecordData &Record, unsigned &Idx); - // \brief Skip a path - static void SkipPath(const RecordData &Record, unsigned &Idx) { - SkipString(Record, Idx); - } - /// \brief Read a version tuple. static VersionTuple ReadVersionTuple(const RecordData &Record, unsigned &Idx); diff --git a/clang/include/clang/Serialization/ModuleManager.h b/clang/include/clang/Serialization/ModuleManager.h index ffc42ce6040..fae387cac7e 100644 --- a/clang/include/clang/Serialization/ModuleManager.h +++ b/clang/include/clang/Serialization/ModuleManager.h @@ -27,7 +27,6 @@ class GlobalModuleIndex; class MemoryBufferCache; class ModuleMap; class PCHContainerReader; -class HeaderSearch; namespace serialization { @@ -59,9 +58,6 @@ class ModuleManager { /// \brief Knows how to unwrap module containers. const PCHContainerReader &PCHContainerRdr; - /// \brief Preprocessor's HeaderSearchInfo containing the module map. - const HeaderSearch &HeaderSearchInfo; - /// \brief A lookup of in-memory (virtual file) buffers llvm::DenseMap<const FileEntry *, std::unique_ptr<llvm::MemoryBuffer>> InMemoryBuffers; @@ -132,8 +128,7 @@ public: typedef std::pair<uint32_t, StringRef> ModuleOffset; explicit ModuleManager(FileManager &FileMgr, MemoryBufferCache &PCMCache, - const PCHContainerReader &PCHContainerRdr, - const HeaderSearch &HeaderSearchInfo); + const PCHContainerReader &PCHContainerRdr); ~ModuleManager(); /// \brief Forward iterator to traverse all loaded modules. @@ -168,11 +163,8 @@ public: /// \brief Returns the module associated with the given index ModuleFile &operator[](unsigned Index) const { return *Chain[Index]; } - /// \brief Returns the module associated with the given file name. - ModuleFile *lookupByFileName(StringRef FileName) const; - - /// \brief Returns the module associated with the given module name. - ModuleFile *lookupByModuleName(StringRef ModName) const; + /// \brief Returns the module associated with the given name + ModuleFile *lookup(StringRef Name) const; /// \brief Returns the module associated with the given module file. ModuleFile *lookup(const FileEntry *File) const; |