aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/AnalysisBasedWarnings.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-09-28 22:29:02 +0000
committerJordan Rose <jordan_rose@apple.com>2012-09-28 22:29:02 +0000
commit20441c59a00afb949e53121c55f8a58da17ba79e (patch)
tree26bc625638a3726b7701d07b0174869d1c40c9f0 /lib/Sema/AnalysisBasedWarnings.cpp
parent66da0abf7ab7cd449bb1d5134b2ef97d9d34d812 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164859 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/AnalysisBasedWarnings.cpp')
-rw-r--r--lib/Sema/AnalysisBasedWarnings.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/Sema/AnalysisBasedWarnings.cpp b/lib/Sema/AnalysisBasedWarnings.cpp
index ec500a06c3..ad5c739037 100644
--- a/lib/Sema/AnalysisBasedWarnings.cpp
+++ b/lib/Sema/AnalysisBasedWarnings.cpp
@@ -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