When target module add/SBTarget::AddModule()'ing, if an architecture isn't specifically

requested, use the Target's architecture to pick the correct slice of a universal file.
<rdar://problem/14813869> 

llvm-svn: 190550
This commit is contained in:
Jason Molenda 2013-09-11 21:25:46 +00:00
parent 71780ec4fd
commit b019cd92b5
2 changed files with 4 additions and 0 deletions

View File

@ -1905,6 +1905,8 @@ SBTarget::AddModule (const char *path,
if (triple)
module_spec.GetArchitecture().SetTriple (triple, target_sp->GetPlatform ().get());
else
module_spec.GetArchitecture() = target_sp->GetArchitecture();
if (symfile)
module_spec.GetSymbolFileSpec ().SetFile(symfile, false);

View File

@ -2763,6 +2763,8 @@ protected:
module_spec.GetUUID() = m_uuid_option_group.GetOptionValue ().GetCurrentValue();
if (m_symbol_file.GetOptionValue().OptionWasSet())
module_spec.GetSymbolFileSpec() = m_symbol_file.GetOptionValue().GetCurrentValue();
if (!module_spec.GetArchitecture().IsValid())
module_spec.GetArchitecture() = target->GetArchitecture();
Error error;
ModuleSP module_sp (target->GetSharedModule (module_spec, &error));
if (!module_sp)