summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/include-fixer/find-all-symbols/SymbolInfo.cpp
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2017-03-09 10:47:44 +0000
committerSam McCall <sam.mccall@gmail.com>2017-03-09 10:47:44 +0000
commit573050e703308c624e48c7f36f19dc2d83d7170f (patch)
tree117d50c89d6e50bda3d7fdd100a747702017e037 /clang-tools-extra/include-fixer/find-all-symbols/SymbolInfo.cpp
parent76630d43f6081c657ac5be2406061d43334045dd (diff)
downloadbcm5719-llvm-573050e703308c624e48c7f36f19dc2d83d7170f.tar.gz
bcm5719-llvm-573050e703308c624e48c7f36f19dc2d83d7170f.zip
[include-fixer] Remove line number from Symbol identity
Summary: Remove line number from Symbol identity. For our purposes (include-fixer and clangd autocomplete), function overloads within the same header should mostly be treated as a single combined symbol. We may want to track individual occurrences (line number, full type info) and aggregate this during mapreduce, but that's not done here. Reviewers: hokein, bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D30685 llvm-svn: 297371
Diffstat (limited to 'clang-tools-extra/include-fixer/find-all-symbols/SymbolInfo.cpp')
-rw-r--r--clang-tools-extra/include-fixer/find-all-symbols/SymbolInfo.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/clang-tools-extra/include-fixer/find-all-symbols/SymbolInfo.cpp b/clang-tools-extra/include-fixer/find-all-symbols/SymbolInfo.cpp
index 7194f2e24fd..a2195392e7b 100644
--- a/clang-tools-extra/include-fixer/find-all-symbols/SymbolInfo.cpp
+++ b/clang-tools-extra/include-fixer/find-all-symbols/SymbolInfo.cpp
@@ -32,7 +32,6 @@ template <> struct MappingTraits<SymbolAndSignals> {
io.mapRequired("Name", Symbol.Symbol.Name);
io.mapRequired("Contexts", Symbol.Symbol.Contexts);
io.mapRequired("FilePath", Symbol.Symbol.FilePath);
- io.mapRequired("LineNumber", Symbol.Symbol.LineNumber);
io.mapRequired("Type", Symbol.Symbol.Type);
io.mapRequired("Seen", Symbol.Signals.Seen);
io.mapRequired("Used", Symbol.Signals.Used);
@@ -74,21 +73,18 @@ namespace clang {
namespace find_all_symbols {
SymbolInfo::SymbolInfo(llvm::StringRef Name, SymbolKind Type,
- llvm::StringRef FilePath, int LineNumber,
+ llvm::StringRef FilePath,
const std::vector<Context> &Contexts)
- : Name(Name), Type(Type), FilePath(FilePath), Contexts(Contexts),
- LineNumber(LineNumber) {}
+ : Name(Name), Type(Type), FilePath(FilePath), Contexts(Contexts) {}
bool SymbolInfo::operator==(const SymbolInfo &Symbol) const {
- return std::tie(Name, Type, FilePath, LineNumber, Contexts) ==
- std::tie(Symbol.Name, Symbol.Type, Symbol.FilePath, Symbol.LineNumber,
- Symbol.Contexts);
+ return std::tie(Name, Type, FilePath, Contexts) ==
+ std::tie(Symbol.Name, Symbol.Type, Symbol.FilePath, Symbol.Contexts);
}
bool SymbolInfo::operator<(const SymbolInfo &Symbol) const {
- return std::tie(Name, Type, FilePath, LineNumber, Contexts) <
- std::tie(Symbol.Name, Symbol.Type, Symbol.FilePath, Symbol.LineNumber,
- Symbol.Contexts);
+ return std::tie(Name, Type, FilePath, Contexts) <
+ std::tie(Symbol.Name, Symbol.Type, Symbol.FilePath, Symbol.Contexts);
}
std::string SymbolInfo::getQualifiedName() const {
OpenPOWER on IntegriCloud