[cfe-commits] r164859 - /cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp

Jordan Rose jordan_rose at apple.com
Fri Sep 28 15:29:02 PDT 2012


Author: jrose
Date: Fri Sep 28 17:29:02 2012
New Revision: 164859

URL: http://llvm.org/viewvc/llvm-project?rev=164859&view=rev
Log:
Fix buildbots by not using a template from another namespace.

No need to specialize BeforeThanCompare for a comparator that's only
going to be used once.

Modified:
    cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp

Modified: cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp?rev=164859&r1=164858&r2=164859&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp (original)
+++ cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp Fri Sep 28 17:29:02 2012
@@ -936,23 +936,22 @@
 }
 
 namespace {
-  typedef std::pair<const Stmt *,
-                    sema::FunctionScopeInfo::WeakObjectUseMap::const_iterator>
-          StmtUsesPair;
-}
+typedef std::pair<const Stmt *,
+                  sema::FunctionScopeInfo::WeakObjectUseMap::const_iterator>
+        StmtUsesPair;
 
-template<>
-class BeforeThanCompare<StmtUsesPair> {
+class StmtUseSorter {
   const SourceManager &SM;
 
 public:
-  explicit BeforeThanCompare(const SourceManager &SM) : SM(SM) { }
+  explicit StmtUseSorter(const SourceManager &SM) : SM(SM) { }
 
   bool operator()(const StmtUsesPair &LHS, const StmtUsesPair &RHS) {
     return SM.isBeforeInTranslationUnit(LHS.first->getLocStart(),
                                         RHS.first->getLocStart());
   }
 };
+}
 
 
 static void diagnoseRepeatedUseOfWeak(Sema &S,
@@ -991,7 +990,7 @@
 
   // Sort by first use so that we emit the warnings in a deterministic order.
   std::sort(UsesByStmt.begin(), UsesByStmt.end(),
-            BeforeThanCompare<StmtUsesPair>(S.getSourceManager()));
+            StmtUseSorter(S.getSourceManager()));
 
   // Classify the current code body for better warning text.
   // This enum should stay in sync with the cases in





More information about the cfe-commits mailing list