diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-09-28 22:29:02 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-09-28 22:29:02 +0000 |
commit | d61f3b4daeac83c13da4c97f9b32291dc2500829 (patch) | |
tree | 72b2f78426ee19103eb22d96c662cde0df024a1a /clang/lib/Sema/AnalysisBasedWarnings.cpp | |
parent | e61e5625e7d8a44f0f142f5f2faa912601b447f5 (diff) | |
download | bcm5719-llvm-d61f3b4daeac83c13da4c97f9b32291dc2500829.tar.gz bcm5719-llvm-d61f3b4daeac83c13da4c97f9b32291dc2500829.zip |
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.
llvm-svn: 164859
Diffstat (limited to 'clang/lib/Sema/AnalysisBasedWarnings.cpp')
-rw-r--r-- | clang/lib/Sema/AnalysisBasedWarnings.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/clang/lib/Sema/AnalysisBasedWarnings.cpp b/clang/lib/Sema/AnalysisBasedWarnings.cpp index ec500a06c32..ad5c739037e 100644 --- a/clang/lib/Sema/AnalysisBasedWarnings.cpp +++ b/clang/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 |