summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/include-fixer/IncludeFixer.cpp
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2017-02-28 08:13:15 +0000
committerSam McCall <sam.mccall@gmail.com>2017-02-28 08:13:15 +0000
commitb27dc2245f9cd5e5c38c88aef5b291f21adfad1e (patch)
tree5588ddbe7e74a9fc0772dc2f50def3274b5ca255 /clang-tools-extra/include-fixer/IncludeFixer.cpp
parent427215ce5ef200869b2ee6f62a48aa5733b375f3 (diff)
downloadbcm5719-llvm-b27dc2245f9cd5e5c38c88aef5b291f21adfad1e.tar.gz
bcm5719-llvm-b27dc2245f9cd5e5c38c88aef5b291f21adfad1e.zip
[include-fixer] Add usage count to find-all-symbols.
Summary: Add usage count to find-all-symbols. FindAllSymbols now finds (most!) main-file usages of the discovered symbols. The per-TU map output has NumUses=0 or 1 (only one use per file is counted). The reducer aggregates these to find the number of files that use a symbol. The NumOccurrences is now set to 1 in the mapper rather than being inferred by the reducer, for consistency. The idea here is to use NumUses for ranking: intuitively number of files that use a symbol is more meaningful than number of files that include the header. Reviewers: hokein, bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D30210 llvm-svn: 296446
Diffstat (limited to 'clang-tools-extra/include-fixer/IncludeFixer.cpp')
-rw-r--r--clang-tools-extra/include-fixer/IncludeFixer.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang-tools-extra/include-fixer/IncludeFixer.cpp b/clang-tools-extra/include-fixer/IncludeFixer.cpp
index 1944d73f63c..ca4d863d3ad 100644
--- a/clang-tools-extra/include-fixer/IncludeFixer.cpp
+++ b/clang-tools-extra/include-fixer/IncludeFixer.cpp
@@ -334,8 +334,7 @@ IncludeFixerContext IncludeFixerSemaSource::getIncludeFixerContext(
SourceManager, HeaderSearch);
SymbolCandidates.emplace_back(Symbol.getName(), Symbol.getSymbolKind(),
MinimizedFilePath, Symbol.getLineNumber(),
- Symbol.getContexts(),
- Symbol.getNumOccurrences());
+ Symbol.getContexts());
}
return IncludeFixerContext(FilePath, QuerySymbolInfos, SymbolCandidates);
}
OpenPOWER on IntegriCloud