aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2009-09-16 11:43:12 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2009-09-16 11:43:12 +0000
commitf4f1b266fd83c819ea2cf7cbd9bcd377d95c4eb6 (patch)
treeac54fdfdc460c7e5d70788ab00ece473ec2fd87a
parent923327267949b537d7a2fdad5b7a919bd90ce085 (diff)
downloadexternal_llvm-f4f1b266fd83c819ea2cf7cbd9bcd377d95c4eb6.zip
external_llvm-f4f1b266fd83c819ea2cf7cbd9bcd377d95c4eb6.tar.gz
external_llvm-f4f1b266fd83c819ea2cf7cbd9bcd377d95c4eb6.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
-rw-r--r--lib/CodeGen/MachineModuleInfoImpls.cpp3
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;
}