Mercurial > hg > CbC > CbC_llvm
diff lib/Object/SymbolSize.cpp @ 120:1172e4bd9c6f
update 4.0.0
author | mir3636 |
---|---|
date | Fri, 25 Nov 2016 19:14:25 +0900 |
parents | afa8332a0e37 |
children | c2174574ed3a |
line wrap: on
line diff
--- a/lib/Object/SymbolSize.cpp Tue Jan 26 22:56:36 2016 +0900 +++ b/lib/Object/SymbolSize.cpp Fri Nov 25 19:14:25 2016 +0900 @@ -16,19 +16,13 @@ using namespace llvm; using namespace object; -namespace { -struct SymEntry { - symbol_iterator I; - uint64_t Address; - unsigned Number; - unsigned SectionID; -}; -} - -static int compareAddress(const SymEntry *A, const SymEntry *B) { +// Orders increasingly by (SectionID, Address). +int llvm::object::compareAddress(const SymEntry *A, const SymEntry *B) { if (A->SectionID != B->SectionID) - return A->SectionID - B->SectionID; - return A->Address - B->Address; + return A->SectionID < B->SectionID ? -1 : 1; + if (A->Address != B->Address) + return A->Address < B->Address ? -1 : 1; + return 0; } static unsigned getSectionID(const ObjectFile &O, SectionRef Sec) {