Object: Abstract out the determination of function line symbols

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204313 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Majnemer 2014-03-20 06:28:55 +00:00
parent 8bd2799a2d
commit b000c172ed
2 changed files with 5 additions and 1 deletions

View File

@ -210,6 +210,10 @@ struct coff_symbol {
!COFF::isReservedSectionNumber(SectionNumber); !COFF::isReservedSectionNumber(SectionNumber);
} }
bool isFunctionLineInfo() const {
return StorageClass == COFF::IMAGE_SYM_CLASS_FUNCTION;
}
bool isWeakExternal() const { bool isWeakExternal() const {
return StorageClass == COFF::IMAGE_SYM_CLASS_WEAK_EXTERNAL || return StorageClass == COFF::IMAGE_SYM_CLASS_WEAK_EXTERNAL ||
(StorageClass == COFF::IMAGE_SYM_CLASS_EXTERNAL && (StorageClass == COFF::IMAGE_SYM_CLASS_EXTERNAL &&

View File

@ -157,7 +157,7 @@ void COFFDumper::dumpSymbols(unsigned NumSymbols) {
reinterpret_cast<const object::coff_aux_function_definition *>( reinterpret_cast<const object::coff_aux_function_definition *>(
AuxData.data()); AuxData.data());
dumpFunctionDefinition(&Sym, ObjFD); dumpFunctionDefinition(&Sym, ObjFD);
} else if (Symbol->StorageClass == COFF::IMAGE_SYM_CLASS_FUNCTION) { } else if (Symbol->isFunctionLineInfo()) {
// This symbol describes function line number information. // This symbol describes function line number information.
assert(Symbol->NumberOfAuxSymbols == 1 && assert(Symbol->NumberOfAuxSymbols == 1 &&
"Exepected a single aux symbol to describe this section!"); "Exepected a single aux symbol to describe this section!");