diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2009-09-16 11:43:12 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2009-09-16 11:43:12 +0000 |
commit | 9ccaf3f7c56c9f3e7e3359165f387895a1cd5ffa (patch) | |
tree | ac54fdfdc460c7e5d70788ab00ece473ec2fd87a /lib/CodeGen/MachineModuleInfoImpls.cpp | |
parent | ec139a0819923967e3c2b8a8e5fafa8859056b8b (diff) | |
download | external_llvm-9ccaf3f7c56c9f3e7e3359165f387895a1cd5ffa.zip external_llvm-9ccaf3f7c56c9f3e7e3359165f387895a1cd5ffa.tar.gz external_llvm-9ccaf3f7c56c9f3e7e3359165f387895a1cd5ffa.tar.bz2 |
Don't sort the vector when it is empty. This should fix some expensive checking
failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82040 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineModuleInfoImpls.cpp')
-rw-r--r-- | lib/CodeGen/MachineModuleInfoImpls.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/MachineModuleInfoImpls.cpp b/lib/CodeGen/MachineModuleInfoImpls.cpp index 10de1de..7a62929 100644 --- a/lib/CodeGen/MachineModuleInfoImpls.cpp +++ b/lib/CodeGen/MachineModuleInfoImpls.cpp @@ -38,7 +38,8 @@ MachineModuleInfoMachO::SymbolListTy MachineModuleInfoMachO::GetSortedStubs(const DenseMap<const MCSymbol*, const MCSymbol*> &Map) { MachineModuleInfoMachO::SymbolListTy List(Map.begin(), Map.end()); - qsort(&List[0], List.size(), sizeof(List[0]), SortSymbolPair); + if (!List.empty()) + qsort(&List[0], List.size(), sizeof(List[0]), SortSymbolPair); return List; } |