@@ -185,39 +185,20 @@ struct NMSymbol {
185
185
}
186
186
187
187
static bool compareSymbolAddress (const NMSymbol &A, const NMSymbol &B) {
188
- bool AUndefined = A.Sym .getFlags () & SymbolRef::SF_Undefined;
189
- bool BUndefined = B.Sym .getFlags () & SymbolRef::SF_Undefined;
190
- if (AUndefined && !BUndefined)
191
- return true ;
192
- if (!AUndefined && BUndefined)
193
- return false ;
194
- if (A.Address < B.Address )
195
- return true ;
196
- if (A.Address == B.Address && A.Name < B.Name )
197
- return true ;
198
- if (A.Address == B.Address && A.Name == B.Name && A.Size < B.Size )
199
- return true ;
200
- return false ;
188
+ bool ADefined = !(A.Sym .getFlags () & SymbolRef::SF_Undefined);
189
+ bool BDefined = !(B.Sym .getFlags () & SymbolRef::SF_Undefined);
190
+ return std::make_tuple (ADefined, A.Address , A.Name , A.Size ) <
191
+ std::make_tuple (BDefined, B.Address , B.Name , B.Size );
201
192
}
202
193
203
194
static bool compareSymbolSize (const NMSymbol &A, const NMSymbol &B) {
204
- if (A.Size < B.Size )
205
- return true ;
206
- if (A.Size == B.Size && A.Name < B.Name )
207
- return true ;
208
- if (A.Size == B.Size && A.Name == B.Name && A.Address < B.Address )
209
- return true ;
210
- return false ;
195
+ return std::make_tuple (A.Size , A.Name , A.Address ) <
196
+ std::make_tuple (B.Size , B.Name , B.Address );
211
197
}
212
198
213
199
static bool compareSymbolName (const NMSymbol &A, const NMSymbol &B) {
214
- if (A.Name < B.Name )
215
- return true ;
216
- if (A.Name == B.Name && A.Size < B.Size )
217
- return true ;
218
- if (A.Name == B.Name && A.Size == B.Size && A.Address < B.Address )
219
- return true ;
220
- return false ;
200
+ return std::make_tuple (A.Name , A.Size , A.Address ) <
201
+ std::make_tuple (B.Name , B.Size , B.Address );
221
202
}
222
203
223
204
static char isSymbolList64Bit (SymbolicFile &Obj) {
0 commit comments