djasper accepted this revision.
This revision is now accepted and ready to land.
================
Comment at: include-fixer/SymbolIndexManager.cpp:25
@@ +24,3 @@
+ // First collect occurrences per header file.
+ std::map<llvm::StringRef, unsigned> HeaderPopularity;
+ for (const SymbolInfo &Symbol : Symbols) {
----------------
Maybe use a DenseHashMap?
================
Comment at: include-fixer/tool/ClangIncludeFixer.cpp:101
@@ -100,3 +100,3 @@
Split.second.split(CommaSplits, ",");
- for (StringRef Header : CommaSplits)
+ for (const StringRef &Header : CommaSplits)
Symbols.push_back(find_all_symbols::SymbolInfo(
----------------
Can you please write a regular for loop with index instead?
================
Comment at: include-fixer/tool/ClangIncludeFixer.cpp:105
@@ -104,3 +104,3 @@
find_all_symbols::SymbolInfo::SymbolKind::Unknown, Header.trim(),
1,
- {}));
+ {}, /*NumOccurrences=*/CommaSplits.end() - &Header));
}
----------------
Add a comment that you are assigning fake occurrences to keep the existing test
logic (with the first include being the most preferable).
http://reviews.llvm.org/D20814
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits