mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-30 04:35:00 +00:00
Optimize COFFObjectFile::sectionContainsSymbol a bit.
There is no need to compute the coff_section of the symbol just to compare the pointer. Inspired by the ELF implementation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219233 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
29890f73dc
commit
fbf9a40f5b
@ -347,13 +347,8 @@ std::error_code COFFObjectFile::sectionContainsSymbol(DataRefImpl SecRef,
|
|||||||
bool &Result) const {
|
bool &Result) const {
|
||||||
const coff_section *Sec = toSec(SecRef);
|
const coff_section *Sec = toSec(SecRef);
|
||||||
COFFSymbolRef Symb = getCOFFSymbol(SymbRef);
|
COFFSymbolRef Symb = getCOFFSymbol(SymbRef);
|
||||||
const coff_section *SymbSec = nullptr;
|
int32_t SecNumber = (Sec - SectionTable) + 1;
|
||||||
if (std::error_code EC = getSection(Symb.getSectionNumber(), SymbSec))
|
Result = SecNumber == Symb.getSectionNumber();
|
||||||
return EC;
|
|
||||||
if (SymbSec == Sec)
|
|
||||||
Result = true;
|
|
||||||
else
|
|
||||||
Result = false;
|
|
||||||
return object_error::success;
|
return object_error::success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user