[llvm] r251414 - Rename qsort -> multikey_qsort. NFC.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 27 09:57:50 PDT 2015
Author: ruiu
Date: Tue Oct 27 11:57:50 2015
New Revision: 251414
URL: http://llvm.org/viewvc/llvm-project?rev=251414&view=rev
Log:
Rename qsort -> multikey_qsort. NFC.
`qsort` as a file-scope local function name was confusing.
Modified:
llvm/trunk/lib/MC/StringTableBuilder.cpp
Modified: llvm/trunk/lib/MC/StringTableBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/StringTableBuilder.cpp?rev=251414&r1=251413&r2=251414&view=diff
==============================================================================
--- llvm/trunk/lib/MC/StringTableBuilder.cpp (original)
+++ llvm/trunk/lib/MC/StringTableBuilder.cpp Tue Oct 27 11:57:50 2015
@@ -30,7 +30,7 @@ static int charTailAt(StringPair *P, siz
// Three-way radix quicksort. This is much faster than std::sort with strcmp
// because it does not compare characters that we already know the same.
-static void qsort(StringPair **Begin, StringPair **End, int Pos) {
+static void multikey_qsort(StringPair **Begin, StringPair **End, int Pos) {
tailcall:
if (End - Begin <= 1)
return;
@@ -50,8 +50,8 @@ tailcall:
R++;
}
- qsort(Begin, P, Pos);
- qsort(Q, End, Pos);
+ multikey_qsort(Begin, P, Pos);
+ multikey_qsort(Q, End, Pos);
if (Pivot != -1) {
// qsort(P, Q, Pos + 1), but with tail call optimization.
Begin = P;
@@ -68,7 +68,7 @@ void StringTableBuilder::finalize() {
Strings.push_back(&P);
if (!Strings.empty())
- qsort(&Strings[0], &Strings[0] + Strings.size(), 0);
+ multikey_qsort(&Strings[0], &Strings[0] + Strings.size(), 0);
switch (K) {
case RAW:
More information about the llvm-commits
mailing list