llvm-nm: Make sort more stable when symbol names are equal.

llvm-svn: 167866
This commit is contained in:
Daniel Dunbar 2012-11-13 19:39:55 +00:00
parent 8557850053
commit 38d2284eeb
2 changed files with 13 additions and 2 deletions

View File

@ -153,8 +153,8 @@ CHECKIDX: U ??_7type_info@@6B@
CHECKIDX: 00000000 R ??_C@_0BC@IHENMCGI@b?5cannot?5be?5zero?$CB?$AA@
CHECKIDX: w ??_Einvalid_argument@std@@UAEPAXI@Z
CHECKIDX: w ??_Elogic_error@std@@UAEPAXI@Z
CHECKIDX: U ??_Ginvalid_argument@std@@UAEPAXI@Z
CHECKIDX: 00000000 T ??_Ginvalid_argument@std@@UAEPAXI@Z
CHECKIDX: U ??_Ginvalid_argument@std@@UAEPAXI@Z
CHECKIDX: 00000000 T ??_Glogic_error@std@@UAEPAXI@Z
CHECKIDX: U ??_Glogic_error@std@@UAEPAXI@Z
CHECKIDX: 00000000 D ??_R0?AVexception@std@@@8

View File

@ -150,6 +150,8 @@ namespace {
return true;
else if (a.Address == b.Address && a.Name < b.Name)
return true;
else if (a.Address == b.Address && a.Name == b.Name && a.Size < b.Size)
return true;
else
return false;
@ -160,12 +162,21 @@ namespace {
return true;
else if (a.Size == b.Size && a.Name < b.Name)
return true;
else if (a.Size == b.Size && a.Name == b.Name && a.Address < b.Address)
return true;
else
return false;
}
static bool CompareSymbolName(const NMSymbol &a, const NMSymbol &b) {
return a.Name < b.Name;
if (a.Name < b.Name)
return true;
else if (a.Name == b.Name && a.Size < b.Size)
return true;
else if (a.Name == b.Name && a.Size == b.Size && a.Address < b.Address)
return true;
else
return false;
}
StringRef CurrentFilename;