forked from OSchip/llvm-project
include/llvm/Object/ELF.h: do debug checks only when NDEBUG
validateSymbol() is called all over the place, and it seems it's a debug check. It significantly speedups llvm-symbolizer used in tsan/asan/msan. validateSymbol() is the second hot function and accounts for 15% of runtime. llvm-svn: 175192
This commit is contained in:
parent
eee5e98658
commit
c35cfa91a8
|
|
@ -867,6 +867,7 @@ void ELFObjectFile<ELFT>::LoadVersionMap() const {
|
||||||
|
|
||||||
template<class ELFT>
|
template<class ELFT>
|
||||||
void ELFObjectFile<ELFT>::validateSymbol(DataRefImpl Symb) const {
|
void ELFObjectFile<ELFT>::validateSymbol(DataRefImpl Symb) const {
|
||||||
|
#ifndef NDEBUG
|
||||||
const Elf_Sym *symb = getSymbol(Symb);
|
const Elf_Sym *symb = getSymbol(Symb);
|
||||||
const Elf_Shdr *SymbolTableSection = SymbolTableSections[Symb.d.b];
|
const Elf_Shdr *SymbolTableSection = SymbolTableSections[Symb.d.b];
|
||||||
// FIXME: We really need to do proper error handling in the case of an invalid
|
// FIXME: We really need to do proper error handling in the case of an invalid
|
||||||
|
|
@ -881,6 +882,7 @@ void ELFObjectFile<ELFT>::validateSymbol(DataRefImpl Symb) const {
|
||||||
+ SymbolTableSection->sh_size)))
|
+ SymbolTableSection->sh_size)))
|
||||||
// FIXME: Proper error handling.
|
// FIXME: Proper error handling.
|
||||||
report_fatal_error("Symb must point to a valid symbol!");
|
report_fatal_error("Symb must point to a valid symbol!");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class ELFT>
|
template<class ELFT>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue