forked from OSchip/llvm-project
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:
parent
4a6ae0f01a
commit
881ec8534e
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue