r191177 - Make sort predicate match the qsort convention.
Benjamin Kramer
benny.kra at googlemail.com
Sun Sep 22 08:02:02 PDT 2013
Author: d0k
Date: Sun Sep 22 10:02:02 2013
New Revision: 191177
URL: http://llvm.org/viewvc/llvm-project?rev=191177&view=rev
Log:
Make sort predicate match the qsort convention.
Modified:
cfe/trunk/lib/Analysis/ReachableCode.cpp
Modified: cfe/trunk/lib/Analysis/ReachableCode.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/ReachableCode.cpp?rev=191177&r1=191176&r2=191177&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/ReachableCode.cpp (original)
+++ cfe/trunk/lib/Analysis/ReachableCode.cpp Sun Sep 22 10:02:02 2013
@@ -112,7 +112,11 @@ const Stmt *DeadCodeScan::findDeadCode(c
static int SrcCmp(const std::pair<const CFGBlock *, const Stmt *> *p1,
const std::pair<const CFGBlock *, const Stmt *> *p2) {
- return p2->second->getLocStart() < p1->second->getLocStart();
+ if (p1->second->getLocStart() < p2->second->getLocStart())
+ return -1;
+ if (p2->second->getLocStart() < p1->second->getLocStart())
+ return 1;
+ return 0;
}
unsigned DeadCodeScan::scanBackwards(const clang::CFGBlock *Start,
More information about the cfe-commits
mailing list