mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-12-06 11:01:43 +00:00
Fix ModuleCache usage in Platform - ask remote platform for module's ModuleSpec beforehand so we can look for a module by UUID locally without need to download it.
http://reviews.llvm.org/D8557 llvm-svn: 233136
This commit is contained in:
1 parent
6ba3831ebe
commit
037f6b9c0f
4 files changed
+92
-67
No files matched your search
@@ -82,7 +82,8 @@ Error
|
||||
ModuleCache::Get (const FileSpec &root_dir_spec,
|
||||
const char *hostname,
|
||||
const ModuleSpec &module_spec,
|
||||
ModuleSP &cached_module_sp)
|
||||
ModuleSP &cached_module_sp,
|
||||
bool *did_create_ptr)
|
||||
{
|
||||
const auto find_it = m_loaded_modules.find (module_spec.GetUUID ().GetAsString());
|
||||
if (find_it != m_loaded_modules.end ())
|
||||
@@ -109,6 +110,8 @@ ModuleCache::Get (const FileSpec &root_dir_spec,
|
||||
cached_module_spec.GetFileSpec () = module_file_path;
|
||||
cached_module_spec.GetPlatformFileSpec () = module_spec.GetFileSpec ();
|
||||
cached_module_sp.reset (new Module (cached_module_spec));
|
||||
if (did_create_ptr)
|
||||
*did_create_ptr = true;
|
||||
|
||||
m_loaded_modules.insert (std::make_pair (module_spec.GetUUID ().GetAsString (), cached_module_sp));
|
||||
|
||||
|
||||
Reference in new issue
Block a user