When a function calculates its module, make sure it returns the "real" module, not the linked .o file.

llvm-svn: 141424
This commit is contained in:
Jim Ingham 2011-10-07 22:20:35 +00:00
parent 4a6ae0f01a
commit 881ec8534e
1 changed files with 10 additions and 0 deletions

View File

@ -387,6 +387,16 @@ Function::CalculateSymbolContext(SymbolContext* sc)
Module *
Function::CalculateSymbolContextModule ()
{
const Section *section = m_range.GetBaseAddress().GetSection();
if (section)
{
const Section *linked_section = section->GetLinkedSection();
if (linked_section)
return linked_section->GetModule();
else
return section->GetModule();
}
return this->GetCompileUnit()->GetModule();
}