Fix buildbots by not using a template from another namespace.
authorJordan Rose <jordan_rose@apple.com>
Fri, 28 Sep 2012 22:29:02 +0000 (22:29 +0000)
committerJordan Rose <jordan_rose@apple.com>
Fri, 28 Sep 2012 22:29:02 +0000 (22:29 +0000)
No need to specialize BeforeThanCompare for a comparator that's only
going to be used once.

llvm-svn: 164859

clang/lib/Sema/AnalysisBasedWarnings.cpp

index ec500a0..ad5c739 100644 (file)
@@ -936,23 +936,22 @@ static void DiagnoseSwitchLabelsFallthrough(Sema &S, AnalysisDeclContext &AC,
 }
 
 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 @@ static void diagnoseRepeatedUseOfWeak(Sema &S,
 
   // 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