mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 21:53:12 +08:00
Add a pointer to a source file to SymbolBody.
Previously, each subclass of SymbolBody had a pointer to a source file from which it was created. So, there was no single way to get a source file for a symbol. We had getSourceFile<ELFT>(), but the function was a bit inconvenient as it's a template. This patch makes SymbolBody have a pointer to a source file. If a symbol is not created from a file, the pointer has a nullptr. llvm-svn: 275701
This commit is contained in:
@@ -352,7 +352,7 @@ SymbolBody *elf::ObjectFile<ELFT>::createSymbolBody(const Elf_Sym *Sym) {
|
||||
if (Binding == STB_LOCAL) {
|
||||
if (Sym->st_shndx == SHN_UNDEF)
|
||||
return new (this->Alloc)
|
||||
Undefined(Sym->st_name, Sym->st_other, Sym->getType());
|
||||
Undefined(Sym->st_name, Sym->st_other, Sym->getType(), this);
|
||||
return new (this->Alloc) DefinedRegular<ELFT>(*Sym, Sec);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user