summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/include-fixer/SymbolIndexManager.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [include-fixer] only deduplicate symbols after matching symbols with the ↵Eric Liu2016-06-131-13/+17
| | | | | | | | | | | | | | | | | | undefined identifier. Summary: we should only deduplicate symbols after matching symbols with the undefined identifier. This patch tries to fix the situation where matching symbols are deleted when it has the same header as a non-matching symbol, which can prevent finding the correct header even if there is a matched symbol. Reviewers: bkramer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D21290 llvm-svn: 272576
* [include-fixer] Be smarter about inserting symbols for a prefix.Benjamin Kramer2016-06-031-0/+12
| | | | | | | | | | | | | | | | | | | | | | If prefix search finds something where nothing can be nested under (e.g. a variable or macro) don't add it to the result. This is for cases like: header.h: extern int a; file.cc: namespace a { SOME_MACRO } We will look up a::SOME_MACRO, which doesn't have any results. Then we look up 'a' and find something before we ever look up just 'SOME_MACRO'. With some basic filtering we can avoid this case. Differential Revision: http://reviews.llvm.org/D20960 llvm-svn: 271671
* [include-fixer] Use a DenseMap, order doesn't matter here.Benjamin Kramer2016-05-311-1/+2
| | | | llvm-svn: 271284
* [include-fixer] Rank symbols based on the number of occurrences we found ↵Benjamin Kramer2016-05-311-0/+33
| | | | | | | | | | | | | while merging. This sorts based on the popularity of the header, not the symbol. If there are mutliple matching symbols in one header we take the maximum popularity for that header and deduplicate. If we know nothing we sort lexicographically based on the header path. Differential Revision: http://reviews.llvm.org/D20814 llvm-svn: 271283
* [include-fixer] Make search handle fully qualified names correctly.Benjamin Kramer2016-05-191-0/+11
| | | | | | | | | If a search string starts with "::" we don't want to return any results for suffixes of that string. Differential Revision: http://reviews.llvm.org/D20424 llvm-svn: 270055
* [include-fixer] Also look up prefixes of queries.Benjamin Kramer2016-05-181-40/+48
| | | | | | | | | | | | This is used to find nested classes. For a nested name foo::bar::qux we will first look up foo::bar::qux, then foo::bar, then foo unless we find a result. This is used to support nested classes which are not part of the index but can only be used if the header for the parent context is included. Differential Revision: http://reviews.llvm.org/D20372 llvm-svn: 269956
* [include-fixer] Ignore non-scoped enum declaration during search.Haojian Wu2016-05-181-4/+10
| | | | | | | | | | Reviewers: bkramer Subscribers: cfe-commits, ioeric Differential Revision: http://reviews.llvm.org/D20354 llvm-svn: 269890
* [include-fixer] Use scope contexts information to improve query.Haojian Wu2016-05-131-4/+6
| | | | | | | | | | Reviewers: bkramer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20205 llvm-svn: 269430
* [include-fixer] Rename XrefsDB to SymbolIndex.Benjamin Kramer2016-05-131-0/+70
It's not really containing xrefs so the name didn't fit. No functional change. llvm-svn: 269403
OpenPOWER on IntegriCloud