| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
Makes the name of this directory consistent with the names of the other
directories in clang-tools-extra.
Similar to r356254. No intended behavior change.
Differential Revision: https://reviews.llvm.org/D59750
llvm-svn: 356897
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to reflect the new license.
We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.
Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.
llvm-svn: 351636
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch moves the virtual file system form clang to llvm so it can be
used by more projects.
Concretely the patch:
- Moves VirtualFileSystem.{h|cpp} from clang/Basic to llvm/Support.
- Moves the corresponding unit test from clang to llvm.
- Moves the vfs namespace from clang::vfs to llvm::vfs.
- Formats the lines affected by this change, mostly this is the result of
the added llvm namespace.
RFC on the mailing list:
http://lists.llvm.org/pipermail/llvm-dev/2018-October/126657.html
Differential revision: https://reviews.llvm.org/D52783
llvm-svn: 344140
|
|
|
|
|
|
|
|
|
|
| |
We do now both:
- stop reformatting a sequence after a closing brace in more cases, in
order to not misindent after an incorrect closing brace
- format the closing brace when formatting the line containing the
opening brace
llvm-svn: 330580
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
We don't actually need the index until parse time, so fetch it in the
background and start parsing. By the time it is actually needed it's
likely that the loading phase has completed in the background.
llvm-svn: 291446
|
|
|
|
|
|
|
|
| |
This will look through typedefs so include-fixer will look up the target
of the typedef instead of the typedef itself (which is already in
scope).
llvm-svn: 289952
|
|
|
|
| |
llvm-svn: 288495
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Previously, if we pass multiple files or a file pattern (e.g. /path/to/*.cc) to
include-fixer, include-fixer will apply all replacements to the first argument,
which probably causes crashes.
With this patch, include-fixer can process multiple files now.
Vim and Emacs integration are tested manually.
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D23266
llvm-svn: 278102
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
information
Summary:
include-fixer will firstly try to use scoped namespace context information to
search identifier. However, in some cases, it's unsafe to do nested class
search, because it might treat the identifier as a nested class of scoped
namespace.
Given the following code, and the symbol database only has two classes: "foo" and
"b::Bar".
namespace foo { Bar t; }
Before getting fixing, include-fixer will never search "Bar" symbol.
Because it firstly tries to search "foo::Bar", there is no "Bar" in foo namespace,
then it finds "foo" in database finally. So it treats "Bar" is a nested class
of "foo".
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D23023
llvm-svn: 277442
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: In missing complete type cases, we don't know where to add the qualifiers.
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D22812
llvm-svn: 276761
|
|
|
|
|
|
|
|
|
|
|
|
| |
symbol.
Reviewers: bkramer
Subscribers: ioeric, cfe-commits
Differential Revision: https://reviews.llvm.org/D22567
llvm-svn: 276280
|
|
|
|
|
|
|
|
|
|
|
|
| |
symbol.
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D22367
llvm-svn: 275542
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The judgement that checks whether the fully-qualified name has scoped qualifiers
prefix is incorrect. Should always check whether the first matched postion is the
beginning position.
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D22343
llvm-svn: 275386
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
integration.
Summary:
The patch extends include-fixer's "-output-headers", and "-insert-headers"
command line options to make it dump more information (e.g. QualifiedSymbol),
so that vim-integration can add missing qualifiers.
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D22299
llvm-svn: 275279
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
this patch contains changes related to the interface change from
http://reviews.llvm.org/D21601. Only submit this patch after D21601 is
submitted.
Reviewers: djasper, klimek
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D21602
llvm-svn: 275063
|
|
|
|
|
|
|
|
|
|
|
|
| |
operator.
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D22127
llvm-svn: 274848
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
header.
Summary:
This is an initial version of fixing namespace issues by adding missing
namespace qualifiers to an unidentified symbol.
This version only fixes the first discovered unidentified symbol.
In the long run, include-fixer should fix all unidentified symbols
with a same name at one run.
Currently, it works on command-line tool. The vim integration is not
implemented yet.
Reviewers: klimek, bkramer, djasper
Subscribers: bkramer, ioeric, cfe-commits
Differential Revision: http://reviews.llvm.org/D21603
llvm-svn: 274832
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
from the main file.
Summary:
The further solution is to add the missing header to the file where the
symbol comes from.
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20950
llvm-svn: 271660
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: clang-format's cleanupAroundReplacements() takes care of header insertions.
Reviewers: bkramer
Subscribers: cfe-commits, hokein
Differential Revision: http://reviews.llvm.org/D20816
llvm-svn: 271287
|
|
|
|
|
|
|
|
|
|
| |
don't matter anymore.
Summary: [include-fixer] use tooling::Replacements since the order of replacements don't matter anymore.
Differential Revision: http://reviews.llvm.org/D20813
llvm-svn: 271279
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
headers.
Summary:
Some changes in the patch:
* Add two commandline flags in clang-include-fixer.
* Introduce a IncludeFixerContext for the queried symbol.
* Pull out CreateReplacementsForHeader.
Reviewers: bkramer
Subscribers: klimek, cfe-commits, ioeric
Differential Revision: http://reviews.llvm.org/D20621
llvm-svn: 271258
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 270045
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: [include-fixer] Sort headers after inserting new headers.
Reviewers: bkramer
Subscribers: klimek, djasper, hokein, cfe-commits
Differential Revision: http://reviews.llvm.org/D20370
llvm-svn: 270031
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Something behind that flag makes us get fewer typo correction callbacks,
unbreak the tests on windows for now.
llvm-svn: 269894
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: bkramer
Subscribers: cfe-commits, ioeric
Differential Revision: http://reviews.llvm.org/D20354
llvm-svn: 269890
|
|
|
|
|
|
| |
for targeting *-win32.
llvm-svn: 269870
|
|
|
|
|
|
|
|
| |
nested names in the front.
This handles cases where the initial namespace is unknown.
llvm-svn: 269758
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20205
llvm-svn: 269430
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The InMemorySymbolIndex only constructs hard-coded Class symbols from a string
map. The patch provide a flexable way in InMemorySymbolIndex to create a custom
SymbolInfo in the include-fixer unittest.
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20232
llvm-svn: 269427
|
|
|
|
|
|
| |
It's not really containing xrefs so the name didn't fit. No functional change.
llvm-svn: 269403
|
|
|
|
|
|
| |
for targeting win32. Investigating.
llvm-svn: 269135
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
This will always pick the shortest possible path based on -I options. Based
on the #include suggestion code for modules.
llvm-svn: 267868
|
|
|
|
|
|
| |
clang/tools/extra.
llvm-svn: 266874
|
|
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
|