| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 280157
|
|
|
|
|
|
|
|
|
|
| |
r271042 changed the way the diagnostic arguments are parsed. It assumes that
the diagnostics options were already parsed by the "Driver".
For tools using clang::Tooling, the diagnostics argument were not parsed.
Differential Revision: https://reviews.llvm.org/D23837
llvm-svn: 280118
|
|
|
|
| |
llvm-svn: 279122
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch introduced the ability to decide at runtime whether to parse
JSON compilation database command lines using Gnu syntax or Windows
syntax. However, there were many existing unit tests written that
hardcoded Gnu-specific paths. These tests were now failing because
the auto-detection logic was choosing to parse them using Windows
rules.
This resubmission of the patch fixes this by introducing an enum
which defines the syntax mode, which defaults to auto-detect, but
for which the unit tests force Gnu style parsing.
Reviewed By: alexfh
Differential Revision: https://reviews.llvm.org/D23628
llvm-svn: 279120
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 27a874790fc79f6391ad3703d7c790f51ac6ae1f.
After the introduction of windows command line parsing, some unit tests
began failing that expect to test gnu style command line quirks. The
fix is mechanical but time consuming, so revert this for now.
llvm-svn: 278976
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a compilation database is used on Windows, the command lines cannot
be parsed using the standard GNU style syntax. LLVM provides functions for
parsing Windows style command lines, so use them where appropriate.
After this patch, clang-tidy runs correctly on Windows.
Reviewed by: alexfh
Differential Revision: https://reviews.llvm.org/D23455
llvm-svn: 278964
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: klimek, djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D23264
llvm-svn: 278004
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a registry"
This differs from the previous version by being more careful about template
instantiation/specialization in order to prevent errors when building with
clang -Werror. Specifically:
* begin is not defined in the template and is instead instantiated when Head
is. I think the warning when we don't do that is wrong (PR28815) but for now
at least do it this way to avoid the warning.
* Instead of performing template specializations in LLVM_INSTANTIATE_REGISTRY
instead provide a template definition then do explicit instantiation. No
compiler I've tried has problems with doing it the other way, but strictly
speaking it's not permitted by the C++ standard so better safe than sorry.
Original commit message:
Currently the Registry class contains the vestiges of a previous attempt to
allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a
plugin would have its own copy of a registry and export it to be imported by
the tool that's loading the plugin. This only works if the plugin is entirely
self-contained with the only interface between the plugin and tool being the
registry, and in particular this conflicts with how IR pass plugins work.
This patch changes things so that instead the add_node function of the registry
is exported by the tool and then imported by the plugin, which solves this
problem and also means that instead of every plugin having to export every
registry they use instead LLVM only has to export the add_node functions. This
allows plugins that use a registry to work on Windows if
LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used.
llvm-svn: 277806
|
|
|
|
|
|
|
| |
We would not detect conflicts when inserting insertions at the same
offset as previously contained replacements.
llvm-svn: 277603
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we would search through all replacements when inserting a
new one to check for overlaps. Instead, make use of the fact that we
already have a set of replacments without overlaps to find the potential
overlap with lower_bound.
Differential Revision: https://reviews.llvm.org/D23119
llvm-svn: 277597
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
- Implement clang::tooling::Replacements as a class to provide interfaces to
control how replacements for a single file are combined and provide guarantee
on the order of replacements being applied.
- tooling::Replacements only contains replacements for the same file now.
Use std::map<std::string, tooling::Replacements> to represent multi-file
replacements.
- Error handling for the interface change will be improved in followup patches.
Reviewers: djasper, klimek
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D21748
llvm-svn: 277335
|
|
|
|
|
|
|
|
|
| |
registry"
Buildbot failures when building with clang -Werror. Reverting while I try to
figure this out.
llvm-svn: 277008
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a registry"
This version has two fixes compared to the original:
* In Registry.h the template static members are instantiated before they are
used, as clang gives an error if you do it the other way around.
* The use of the Registry template in clang-tidy is updated in the same way as
has been done everywhere else.
Original commit message:
Currently the Registry class contains the vestiges of a previous attempt to
allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a
plugin would have its own copy of a registry and export it to be imported by
the tool that's loading the plugin. This only works if the plugin is entirely
self-contained with the only interface between the plugin and tool being the
registry, and in particular this conflicts with how IR pass plugins work.
This patch changes things so that instead the add_node function of the registry
is exported by the tool and then imported by the plugin, which solves this
problem and also means that instead of every plugin having to export every
registry they use instead LLVM only has to export the add_node functions. This
allows plugins that use a registry to work on Windows if
LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used.
llvm-svn: 276973
|
|
|
|
|
|
|
|
| |
registry"
This is causing a huge pile of buildbot failures.
llvm-svn: 276857
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently the Registry class contains the vestiges of a previous attempt to
allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a
plugin would have its own copy of a registry and export it to be imported by
the tool that's loading the plugin. This only works if the plugin is entirely
self-contained with the only interface between the plugin and tool being the
registry, and in particular this conflicts with how IR pass plugins work.
This patch changes things so that instead the add_node function of the registry
is exported by the tool and then imported by the plugin, which solves this
problem and also means that instead of every plugin having to export every
registry they use instead LLVM only has to export the add_node functions. This
allows plugins that use a registry to work on Windows if
LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used.
Differential Revision: http://reviews.llvm.org/D21385
llvm-svn: 276856
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
type decl from a different canonical namespace.
Summary:
[Tooling] skip anonymous namespaces when checking if typeLoc
references a type decl from a different canonical namespace.
Reviewers: bkramer
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D22808
llvm-svn: 276754
|
|
|
|
|
|
|
|
|
|
| |
Summary: Removed unused headers, replaced some headers with forward class declarations
Patch by: Eugene <claprix@yandex.ru>
Differential Revision: https://reviews.llvm.org/D20100
llvm-svn: 275882
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
empty string to indicate potential error.
Summary:
return llvm::Expected<> to carry error status and error information.
This is the first step towards introducing "Error" into tooling::Replacements.
Reviewers: djasper, klimek
Subscribers: ioeric, klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D21601
llvm-svn: 275062
|
|
|
|
|
|
|
|
|
| |
ArrayRef is a little better than passing around a pointer/length
pair.
No functional change is intended.
llvm-svn: 274732
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: rsmith, saugustine, rnk
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D21666
llvm-svn: 274185
|
|
|
|
| |
llvm-svn: 274041
|
|
|
|
|
|
| |
sanitizer-x86_64-linux-fast/builds/13946.
llvm-svn: 273319
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
new code.
Summary:
Added calculateRangesAfterReplaments() to calculate original ranges as well as
newly affacted ranges in the new code.
Reviewers: klimek, djasper
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D21547
llvm-svn: 273290
|
|
|
|
|
|
| |
No functionality change intended.
llvm-svn: 272789
|
|
|
|
|
|
| |
This mostly affects smart pointers. No functionality change intended.
llvm-svn: 272520
|
|
|
|
| |
llvm-svn: 271182
|
|
|
|
|
|
| |
No functionality change intended, maybe a tiny performance improvement.
llvm-svn: 270996
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This is the refactoring to lift some FixItHint into tooling.
used by: http://reviews.llvm.org/D19807
Reviewers: klimek, alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19941
llvm-svn: 269188
|
|
|
|
|
|
| |
nested-name-specifier. Patch by Sterling Augustine!
llvm-svn: 268988
|
|
|
|
|
|
|
|
|
| |
This allows using a different standard library (the one from argv[0] in
the compilation database) with the correct builtins.
Differential Revision: http://reviews.llvm.org/D19356
llvm-svn: 266973
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: rsmith, rnk
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D19253
llvm-svn: 266925
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
formatAndApplyAllReplacements takes a set of Replacements, applies them on a
Rewriter, and reformats the changed code.
Reviewers: klimek, djasper
Subscribers: ioeric, klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D17852
llvm-svn: 264745
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a commonly useful feature to have, and we have implemented it
multiple times with different kinds of bugs. This implementation
centralizes the idea in a set of functions that we can then use from the various
tools.
Reverts r262234, which is a revert of r262232, and puts the functions
into FOrmat.h, as they are closely coupled to clang-format, and we
otherwise introduce a cyclic dependency between libFormat and
libTooling.
Patch by Eric Liu.
llvm-svn: 262323
|
|
|
|
|
|
|
|
| |
replacements."
This reverts commit r262232.
llvm-svn: 262234
|
|
|
|
|
|
| |
Patch by Eric Liu.
llvm-svn: 262232
|
|
|
|
|
|
|
|
| |
Also introduce inputs() that reutnrs an llvm::iterator_range.
Iterating over A->inputs() is much less mysterious than
iterating over *A. No intended behavior change.
llvm-svn: 261674
|
|
|
|
| |
llvm-svn: 261625
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The keyword "template" isn't necessary when
printing a fully-qualified qualtype name, and, in fact,
results in a syntax error if one tries to use it. So stop
printing it.
Reviewers: rsmith, rnk
Subscribers: rnk, klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D17214
llvm-svn: 261005
|
|
|
|
| |
llvm-svn: 260552
|
|
|
|
|
|
| |
off the end of a covered switch
llvm-svn: 260411
|
|
|
|
|
|
|
|
|
| |
that type from the global scope.
Patch by Sterling Augustine, derived (with permission) from code from Cling by
Vassil Vassilev and Philippe Canal.
llvm-svn: 260278
|
|
|
|
|
|
|
|
|
|
| |
runToolOnCodeWithArgs/buildASTFromCodeWithArgs.
This can be used as a way to modify argv[0] for a clang tool.
Differential Revision: http://reviews.llvm.org/D16718
llvm-svn: 259187
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html
"This is the way [autoconf] ends
Not with a bang but a whimper."
-T.S. Eliot
Reviewers: chandlerc, grosbach, bob.wilson, echristo
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D16472
llvm-svn: 258862
|
|
|
|
|
|
|
|
|
| |
Run without flags if we cannot load a compilation database. This matches
the behavior of clang itself when simply called with a source file.
Based on a patch by Russell Wallace.
llvm-svn: 254599
|
|
|
|
|
|
|
|
|
| |
the case where a specific range is replaced by new text. Previously,
the calculation would shift any position from within a replaced region
to the first character after the region. This is undersirable, e.g. for
clang-format's include sorting.
llvm-svn: 253859
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This is needed to handle per-project configurations when adding extra
arguments in clang-tidy for example.
Reviewers: klimek, djasper
Subscribers: djasper, cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D14191
llvm-svn: 252134
|
|
|
|
| |
llvm-svn: 251026
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
One problem in clang-tidy and other clang tools face is that there is no
way to lookup an arbitrary name in the AST, that's buried deep inside Sema
and might not even be what the user wants as the new name may be freshly
inserted and not available in the AST.
A common use case for lookups is replacing one nested name with another
while minimizing namespace qualifications, so replacing 'ns::foo' with
'ns::bar' will use just 'bar' if we happen to be inside the namespace 'ns'.
This adds a little helper utility for exactly that use case.
Differential Revision: http://reviews.llvm.org/D13931
llvm-svn: 251022
|
|
|
|
|
|
|
|
|
|
| |
Summary: It breaks the build for the ASTMatchers
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D13893
llvm-svn: 250827
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Replace empty bodies of default constructors and destructors with '= default'.
Reviewers: bkramer, klimek
Subscribers: klimek, alexfh, cfe-commits
Differential Revision: http://reviews.llvm.org/D13890
llvm-svn: 250822
|