diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 1f7ef3d23e6e19d28c30beab37205e3c2f456925..17a2c8089f6fa8b40c34c664a323de87ea99ccfb 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -1411,16 +1411,10 @@ static SourceLocation MarkLiveTop(CFGBlock *e, llvm::BitVector &live, return top; } -namespace { -class LineCmp { - SourceManager &SM; -public: - LineCmp(SourceManager &sm) : SM(sm) { - } - bool operator () (SourceLocation l1, SourceLocation l2) { - return l1 < l2; - } -}; +static int LineCmp(const void *p1, const void *p2) { + SourceLocation *Line1 = (SourceLocation *)p1; + SourceLocation *Line2 = (SourceLocation *)p2; + return !(*Line1 < *Line2); } /// CheckUnreachable - Check for unreachable code. @@ -1477,7 +1471,7 @@ void Sema::CheckUnreachable(AnalysisContext &AC) { } } - std::sort(lines.begin(), lines.end(), LineCmp(Context.getSourceManager())); + llvm::array_pod_sort(lines.begin(), lines.end(), LineCmp); for (llvm::SmallVector::iterator I = lines.begin(), E = lines.end(); I != E;