Commit Graph

58 Commits

Author SHA1 Message Date
Eric Liu 692aca6980 Added XrefsDBManager into include-fixer and made XrefsDB return SymbolInfo.
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
2016-05-04 08:22:35 +00:00
Haojian Wu a315dcb3da [include-fixer] Abstract includeFixerMain function.
llvm-svn: 268371
2016-05-03 08:38:35 +00:00
Haojian Wu d8c12badad [include-fixer] Add Yaml database integration.
Reviewers: bkramer

Subscribers: cfe-commits, klimek, djasper

Differential Revision: http://reviews.llvm.org/D19648

llvm-svn: 268017
2016-04-29 09:23:38 +00:00
Benjamin Kramer 3a45fab72b [include-fixer] Add an option to minimize include paths.
This will always pick the shortest possible path based on -I options. Based
on the #include suggestion code for modules.

llvm-svn: 267868
2016-04-28 11:21:29 +00:00
Simon Pilgrim b9f255878e Wdocumentation fix
llvm-svn: 267786
2016-04-27 20:43:32 +00:00
Benjamin Kramer f412e9029d Clean up the include fixer 'driver' a bit and make the database configurable.
Also add a test for it. The library is covered by unit tests, the driver
was not.

llvm-svn: 267718
2016-04-27 14:24:32 +00:00
Haojian Wu 9cba1b52ef Fix cast compiler warning message in include-fixer.
Reviewers: bkramer

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D19323

llvm-svn: 266970
2016-04-21 09:16:32 +00:00
Benjamin Kramer 6b23626192 [include-fixer] Add a prototype for a new include fixing tool.
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
2016-04-20 12:43:43 +00:00