[clang-tools-extra] r271284 - [include-fixer] Use a DenseMap, order doesn't matter here.
Benjamin Kramer via cfe-commits
cfe-commits at lists.llvm.org
Tue May 31 07:37:11 PDT 2016
Author: d0k
Date: Tue May 31 09:37:10 2016
New Revision: 271284
URL: http://llvm.org/viewvc/llvm-project?rev=271284&view=rev
Log:
[include-fixer] Use a DenseMap, order doesn't matter here.
Modified:
clang-tools-extra/trunk/include-fixer/SymbolIndexManager.cpp
Modified: clang-tools-extra/trunk/include-fixer/SymbolIndexManager.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/include-fixer/SymbolIndexManager.cpp?rev=271284&r1=271283&r2=271284&view=diff
==============================================================================
--- clang-tools-extra/trunk/include-fixer/SymbolIndexManager.cpp (original)
+++ clang-tools-extra/trunk/include-fixer/SymbolIndexManager.cpp Tue May 31 09:37:10 2016
@@ -9,6 +9,7 @@
#include "SymbolIndexManager.h"
#include "find-all-symbols/SymbolInfo.h"
+#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/Debug.h"
@@ -22,7 +23,7 @@ using clang::find_all_symbols::SymbolInf
/// Sorts and uniques SymbolInfos based on the popularity info in SymbolInfo.
static void rankByPopularity(std::vector<SymbolInfo> &Symbols) {
// First collect occurrences per header file.
- std::map<llvm::StringRef, unsigned> HeaderPopularity;
+ llvm::DenseMap<llvm::StringRef, unsigned> HeaderPopularity;
for (const SymbolInfo &Symbol : Symbols) {
unsigned &Popularity = HeaderPopularity[Symbol.getFilePath()];
Popularity = std::max(Popularity, Symbol.getNumOccurrences());
More information about the cfe-commits
mailing list