From 55ea75bf61a5d76f6453513d937944ce68181c6a Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Wed, 13 Mar 2013 21:13:51 +0000 Subject: [Modules] Don't eagerly load and associate all the module header files. In a module-enabled Cocoa PCH file, we spend a lot of time stat'ing the headers in order to associate the FileEntries with their modules and support implicit module import. Use a more lazy scheme by enhancing HeaderInfoTable to store extra info about the module that a header belongs to, and associate it with its module only when there is a request for loading the header info for a particular file. Part of rdar://13391765 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176976 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Lex/ModuleMap.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/clang/Lex/ModuleMap.h') diff --git a/include/clang/Lex/ModuleMap.h b/include/clang/Lex/ModuleMap.h index bb53ff21a0..cffa5b7b66 100644 --- a/include/clang/Lex/ModuleMap.h +++ b/include/clang/Lex/ModuleMap.h @@ -33,6 +33,7 @@ class FileEntry; class FileManager; class DiagnosticConsumer; class DiagnosticsEngine; +class HeaderSearch; class ModuleMapParser; class ModuleMap { @@ -40,6 +41,7 @@ class ModuleMap { IntrusiveRefCntPtr Diags; const LangOptions &LangOpts; const TargetInfo *Target; + HeaderSearch &HeaderInfo; /// \brief The directory used for Clang-supplied, builtin include headers, /// such as "stdint.h". @@ -147,7 +149,8 @@ public: /// /// \param Target The target for this translation unit. ModuleMap(FileManager &FileMgr, const DiagnosticConsumer &DC, - const LangOptions &LangOpts, const TargetInfo *Target); + const LangOptions &LangOpts, const TargetInfo *Target, + HeaderSearch &HeaderInfo); /// \brief Destroy the module map. /// -- cgit v1.2.3-70-g09d2