summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/include-fixer
Commit message (Collapse)AuthorAgeFilesLines
...
* [include-fixer] Always ignore SFINAE contexts.Benjamin Kramer2016-05-111-0/+8
| | | | | | | This could lead to spurious includes being added for identifiers that are supposed to be not available. llvm-svn: 269195
* [include-fixer] Also output the location where we found an unknown identifier.Benjamin Kramer2016-05-111-4/+6
| | | | | | | For debugging only, makes it a bit easier when there are queries coming out of headers. llvm-svn: 269194
* [find-all-symbols] Save relative file path for each symbol.Haojian Wu2016-05-112-18/+4
| | | | | | | | | | | | | | | | | | Summary: The HeaderSearch::suggestPathToFileForDiagnostics used in include-fixer doesn't work well with absolute file path, it assumes a relative file path based on header searching path. So saving relative file path to make include-fixer get the most appropriate header path. Reviewers: bkramer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20158 llvm-svn: 269173
* [find-all-symbols] Slim SymbolInfo.Haojian Wu2016-05-116-128/+115
| | | | | | | | | | | | | | | | | | | | Summary: SymbolInfo has some optional fields, which is a bad-smell implementation. For now, we * remove the optional field since we don't need them (we can probably add them back if we actually need them in the future) * make SymbolInfo to be a class. By this change, the code is more simplified. Reviewers: klimek Subscribers: cfe-commits, ioeric, bkramer Differential Revision: http://reviews.llvm.org/D20095 llvm-svn: 269162
* [include-fixer] Default to YAML db, it's much more useful than the fixed ↵Benjamin Kramer2016-05-101-1/+1
| | | | | | dummy db. llvm-svn: 269043
* [include-fixer] Remove unused includes and accessor.Benjamin Kramer2016-05-101-5/+0
| | | | llvm-svn: 269036
* [include-fixer] Emit some terminal output so users can see that the tool is ↵Benjamin Kramer2016-05-101-0/+7
| | | | | | working. llvm-svn: 269030
* [include-fixer] Work around partial names in both directions.Benjamin Kramer2016-05-101-8/+23
| | | | | | | | | | | | We already handled the case where we had a nested name specifier where parts from the beginning don't get a callback, also handle the case where the end doesn't get a callback. This happens with function calls in unknown namespaces. The way we do this for now based on character data is a bit of a hack, we may need to refine this later or fix clang to produce different callbacks. llvm-svn: 269029
* [include-fixer] For now, only add the first suggested include.Benjamin Kramer2016-05-101-22/+27
| | | | | | | | We used a std::set which made the picked include somewhat random (well, lexicographically sorted). Make the behavior more consistent by always picking the first one we found. llvm-svn: 269028
* [include-fixer] Autodetect yaml databases in parent directories.Benjamin Kramer2016-05-093-12/+55
| | | | | | | | | | This looks for find_all_symbols_db.yaml in all parent directories of the source file (like we do for compile_commands.json) so we don't have to pass the path manually. Differential Revision: http://reviews.llvm.org/D20066 llvm-svn: 268920
* Added XrefsDBManager into include-fixer and made XrefsDB return SymbolInfo.Eric Liu2016-05-0412-57/+185
| | | | | | | | | | | | Summary: Added XrefsDBManager into include-fixer and made XrefsDB return SymbolInfo. Reviewers: hokein, djasper, klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19869 llvm-svn: 268480
* [include-fixer] Abstract includeFixerMain function.Haojian Wu2016-05-031-2/+7
| | | | llvm-svn: 268371
* [include-fixer] Fix Clang-tidy modernize-use-override and some Include What ↵Eugene Zelenko2016-05-022-5/+20
| | | | | | | | You Use warnings. Differential revision: http://reviews.llvm.org/D19755 llvm-svn: 268262
* [find-all-symbols] Parallelize the merge step.Benjamin Kramer2016-04-291-15/+28
| | | | | | | | | | | | | | There is still more parallelism to get here because we synchonize on the actual uniquing but just doing YAML parsing in parallel already gives a significant speedup. Merging all symbols in LLVM+clang+compiler-rt+lld+libc++, 48 cores. before: 201.55s user 1.47s system 99% cpu 3:23.04 total after: 276.99s user 7.63s system 838% cpu 33.947 total Differential Revision: http://reviews.llvm.org/D19720 llvm-svn: 268037
* Make run-find-all-symbols executable.Benjamin Kramer2016-04-291-0/+0
| | | | llvm-svn: 268022
* [find-all-symbols] Fix racy yaml file writing.Benjamin Kramer2016-04-293-15/+20
| | | | | | | | | | | If multiple find-all-symbols processes access the temporary directory simultaneously with two files with the same name they would collide and create a broken yaml file. Fix this by using the safe createUniqueFile API from LLVM instead. Differential Revision: http://reviews.llvm.org/D19717 llvm-svn: 268021
* [find-all-symbols] Save absolute file path instead of relative file path in ↵Haojian Wu2016-04-291-4/+23
| | | | | | | | | | | | SymbolInfo. Reviewers: bkramer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19647 llvm-svn: 268019
* [include-fixer] Add Yaml database integration.Haojian Wu2016-04-294-1/+111
| | | | | | | | | | Reviewers: bkramer Subscribers: cfe-commits, klimek, djasper Differential Revision: http://reviews.llvm.org/D19648 llvm-svn: 268017
* [include-fixer] Add an option to minimize include paths.Benjamin Kramer2016-04-283-9/+57
| | | | | | | This will always pick the shortest possible path based on -I options. Based on the #include suggestion code for modules. llvm-svn: 267868
* Wdocumentation fixSimon Pilgrim2016-04-271-1/+1
| | | | llvm-svn: 267786
* [find-all-symbols] Clean up dependencies, fixing cmake shared build.Benjamin Kramer2016-04-271-2/+1
| | | | llvm-svn: 267738
* [include-fixer] Add a find-all-symbols tool for include-fixer.Haojian Wu2016-04-279-0/+748
| | | | | | | | | | | | | | | | Summary: The find-all-symbols tool generates a yaml symbol database for include-fixer. The symbol matcher is originally written by Xiaoyi Liu. Reviewers: bkramer, djasper Subscribers: cfe-commits, klimek, ioeric Differential Revision: http://reviews.llvm.org/D19482 llvm-svn: 267719
* Clean up the include fixer 'driver' a bit and make the database configurable.Benjamin Kramer2016-04-271-16/+51
| | | | | | | Also add a test for it. The library is covered by unit tests, the driver was not. llvm-svn: 267718
* Fix cast compiler warning message in include-fixer.Haojian Wu2016-04-211-3/+2
| | | | | | | | | | Reviewers: bkramer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19323 llvm-svn: 266970
* [include-fixer] Add a prototype for a new include fixing tool.Benjamin Kramer2016-04-208-0/+533
Summary: The goal of this tool is fairly simple, look up unknown identifiers in a global database and add the corresponding #include line. It accomplishes this by hooking into Sema as an ExternalSemaSource and responding to typo correction callbacks. This means we can see the unknown identifier before it's being munged by error recovery. This doesn't work perfectly yet as some typo corrections don't emit callbacks (delayed typos), but I think this is fixable. We also handle only one include at a time as this is meant to be run directly from the editing environment eventually. Adding multiple includes at the same time is tricky because of error recovery. This version only has a a dummy database, so all you can do is fixing missing includes of <string>, but the indexer to build a database will follow soon. Reviewers: djasper Subscribers: ioeric, hokein, cfe-commits Differential Revision: http://reviews.llvm.org/D19314 llvm-svn: 266870
OpenPOWER on IntegriCloud