| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
outside of it.
llvm-svn: 231671
|
|
|
|
|
|
| |
Found by -Wmissing-prototypes.
llvm-svn: 231668
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Add translationUnitDecl matcher.
Reviewers: alexfh
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D7512
llvm-svn: 228694
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Add voidType() matcher.
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D6656
llvm-svn: 224250
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Speed up the variadic matchers by removing one indirect call.
Making the function pointer a template arguments allows the compiler to
inline the call instead of doing an runtime call by pointer.
Also, optimize the allOf() case to avoid redundant kind checks.
This speeds up our clang-tidy benchmark by ~2%
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D6424
llvm-svn: 223029
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
typedefDecl, isInMainFile, isInSystemFile, isInFileMatchingName
Change to original: ifndef out tests in Windows due to /-separated
paths.
Summary:
Often one is only interested in matches within the main-file or matches
that are not within a system-header, for which this patch adds
isInMainFile and isInSystemFile. They take no arguments and narrow down
the matches.
The isInFileMatchingName is mainly thought for interactive
clang-query-sessions, to make a matcher more specific without restarting
the session with the files you are interested in for that moment. It
takes a string that will be used as regular-expression to match the
filename of where the matched node is expanded.
Patch by Hendrik von Prince.
llvm-svn: 222765
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Filter the toplevel matchers by kind.
Decl and Stmt matchers are tied to a specific node kind and trying to
match incompatible nodes is a waste.
Precalculate a filtered list of matchers that have a chance of matching
the node and ignore the rest.
Speeds up our clang-tidy benchmark by ~10%
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D6361
llvm-svn: 222688
|
|
|
|
|
|
| |
which was required for r222646 to compile with Visual Studio 2012.
llvm-svn: 222667
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
isInFileMatchingName
Summary:
Often one is only interested in matches within the main-file or matches
that are not within a system-header, for which this patch adds
isInMainFile and isInSystemFile. They take no arguments and narrow down
the matches.
The isInFileMatchingName is mainly thought for interactive
clang-query-sessions, to make a matcher more specific without restarting
the session with the files you are interested in for that moment. It
takes a string that will be used as regular-expression to match the
filename of where the matched node is expanded.
Patch by Hendrik von Prince.
llvm-svn: 222646
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Replace variadic operator function pointer with an enum value.
Hiding the implementation of the variadic matcher will allow to specialize them for the operation performed.
In particular, it will allow for a more efficient allOf() matcher.
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D6293
llvm-svn: 222432
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DynTypedMatcher.
Summary:
The generic variadic matcher is faster (one less virtual function call
per match) and doesn't require template instantiations which reduces
compile time and binary size.
Registry.cpp.o generates ~14% less symbols and compiles ~7.5% faster.
The change also speeds up our clang-tidy benchmark by ~2%.
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D6278
llvm-svn: 222131
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Add valueDecl() matcher.
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D6005
llvm-svn: 220776
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Speed up clang-tidy when profiling in on.
It makes profiling runs twice as fast by reusing the time samples between the
different actions.
It also joins together the sampling of different matchers of the same check.
Reviewers: alexfh
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D5972
llvm-svn: 220682
|
|
|
|
| |
llvm-svn: 220560
|
|
|
|
| |
llvm-svn: 220559
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Add support for profiling the matchers used.
This will be connected with clang-tidy to generate a report to determine
and debug slow checks.
Reviewers: alexfh
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D5911
llvm-svn: 220418
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Fix code to follow the "Don’t use else after a return" rule.
This is a followup from rL219792.
Reviewers: alexfh
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D5826
llvm-svn: 219939
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Speed up hasName() matcher by skipping the expensive generation of the
fully qualified name unless we need it.
In the common case of matching an unqualified name, we don't need to
generate the full name. We might not even need to copy any string at
all.
This change speeds up our clang-tidy benchmark by ~10%
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D5776
llvm-svn: 219792
|
|
|
|
|
|
|
|
| |
Fix order of evaluation bug in DynTypedMatcher::constructVariadic().
If it evaluates right-to-left, the vector gets moved before we read the
kind from it.
llvm-svn: 219624
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
negatives.
Summary:
Change r219118 fixed the bug for anyOf and eachOf, but it is still
present for unless.
The variadic wrapper doesn't have enough information to know how to
restrict the type. Different operators handle restrict failures in
different ways.
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D5731
llvm-svn: 219622
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
overloads.
Summary:
There was an assumption that there were no matchers that were overloaded
on matchers and other types of arguments.
This assumption was broken recently with the addition of new matcher
overloads.
Fixes http://llvm.org/PR21226
Reviewers: pcc
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D5711
llvm-svn: 219450
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Remove unnecessary wrapping for the 0 and 1 matcher cases of
makeAllOfComposite(). We don't need a variadic wrapper for those cases.
Refactor TrueMatcher to take advandage of the new conversions between
DynTypedMatcher and Matcher<T>. Also, make it a singleton.
This change improves our clang-tidy related benchmarks by ~12%.
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D5675
llvm-svn: 219431
|
|
|
|
| |
llvm-svn: 219408
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
negatives.
Summary:
DynTypedMatcher::constructVariadic() where the restrict kind of the
different matchers are not related causes the matcher to have a "None"
restrict kind. This causes false negatives for anyOf and eachOf.
Change the logic to get a common ancestor if there is one.
Also added regression tests that fail without the fix.
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D5580
llvm-svn: 219118
|
|
|
|
|
|
|
| |
The map is immutable until the whole ASTContext dies. While there
movify a couple of copies in ASTMatchFinder away. NFC.
llvm-svn: 219062
|
|
|
|
|
|
| |
These were uncoveredby my yet undelivered patch.
llvm-svn: 218774
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This change introduces DynMatcherInterface and changes the internal
representation of DynTypedMatcher and Matcher<T> to use a generic
interface instead.
It removes unnecessary indirections and virtual function calls when
converting matchers by implicit and dynamic casts.
DynTypedMatcher now remembers the stricter type in the chain of casts
and checks it before calling into DynMatcherInterface.
This change improves our clang-tidy related benchmark by ~14%.
Also, it opens the door for more optimizations of this kind that are
coming in future changes.
As a side effect of removing these template instantiations, it also
speeds up compilation of Dynamic/Registry.cpp by ~17% and reduces the
number of
symbols generated by ~30%.
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D5542
llvm-svn: 218769
|
|
|
|
|
|
|
|
|
|
|
|
| |
of casts."
MSC17, aka VS2012, cannot compile it.
clang/include/clang/ASTMatchers/ASTMatchersInternal.h(387) : error C4519: default template arguments are only allowed on a class template
clang/include/clang/ASTMatchers/ASTMatchersInternal.h(443) : see reference to class template instantiation 'clang::ast_matchers::internal::Matcher<T>' being compiled
llvm-svn: 218648
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This change introduces DynMatcherInterface and changes the internal
representation of DynTypedMatcher and Matcher<T> to use a generic
interface instead.
It removes unnecessary indirections and virtual function calls when
converting matchers by implicit and dynamic casts.
DynTypedMatcher now remembers the stricter type in the chain of casts
and checks it before calling into DynMatcherInterface.
This change improves our clang-tidy related benchmark by ~14%.
Also, it opens the door for more optimizations of this kind that are
coming in future changes.
As a side effect of removing these template instantiations, it also
speeds up compilation of Dynamic/Registry.cpp by ~17% and reduces the number of
symbols generated by ~30%.
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D5485
llvm-svn: 218616
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Separate the matchers by type and statically dispatch to the right list.
For any node type that we support, it reduces the number of matchers we
run it through.
For node types we do not support, it makes match() a noop.
This change improves our clang-tidy related benchmark by ~30%.
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D5197
llvm-svn: 217274
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Refactor VariantMatcher::MatcherOps to reduce the amount of generated code.
- Make some code type agnostic and move it to the cpp file.
- Return a DynTypedMatcher instead of storing the object in MatcherOps.
This change reduces the number of symbols generated in Registry.cpp by
~19%, the object byte size by ~17% and the compilation time (in non-release mode) by ~20%.
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D5124
llvm-svn: 217152
|
|
|
|
|
|
|
|
|
|
|
| |
template instantiation.
This is hoisted from clang-tidy where it's used everywhere. The implementation
is not particularly efficient right now, but there is no easy fix for that.
Differential Revision: http://reviews.llvm.org/D5085
llvm-svn: 217029
|
|
|
|
|
|
| |
const from some other StringRefs since its implicitly const already.
llvm-svn: 216825
|
|
|
|
|
|
| |
and mentioning the type. This works now that we have a conversion from ArrayRef<T*> to ArrayRef<const T*>.
llvm-svn: 216824
|
|
|
|
|
|
|
|
|
| |
But don't move if all we do is clearing the thing. The move method is too large
to be inlined and performs a ton of unnecessary checking when the RHS is empty.
No functionality change.
llvm-svn: 216723
|
|
|
|
|
|
| |
This bug was reported by UBSan.
llvm-svn: 216691
|
|
|
|
|
|
|
|
| |
Delete special-case CUDA attribute matchers.
Patch by Jacques Pienaar.
llvm-svn: 216379
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D4910
llvm-svn: 215757
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D4911
llvm-svn: 215714
|
|
|
|
|
|
| |
Modifications made by clang-tidy with minor tweaks.
llvm-svn: 215557
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This includes:
- Passing a Sema to completeExpression to allow for named values in the
expression.
- Passing a map of names to values to the parser.
- Update the Sema interface to include completion for matchers.
- Change the parser to use the Sema for completion, instead of going
directly to Registry.
Reviewers: pcc
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D3509
llvm-svn: 215472
|
|
|
|
|
|
|
|
| |
After post-commit review and community discussion, this seems like a
reasonable direction to continue, making ownership semantics explicit in
the source using the type system.
llvm-svn: 215323
|
|
|
|
|
|
|
|
|
|
|
|
| |
If nodes without memoization data (e.g. TypeLocs) are bound to specific
names, that effectively prevents memoization as those elements cannot be
compared effectively. If it is tried anyway, this can lead to an assert
as demonstrated in the new test.
In the long term, the better solution will be to enable DynTypedNodes
without memoization data. For now, simply skip memoization instead.
llvm-svn: 213751
|
|
|
|
|
|
|
|
|
| |
This reverts commit r213307.
Reverting to have some on-list discussion/confirmation about the ongoing
direction of smart pointer usage in the LLVM project.
llvm-svn: 213325
|
|
|
|
|
|
|
|
|
| |
(after fixing a bug in MultiplexConsumer I noticed the ownership of the
nested consumers was implemented with raw pointers - so this fixes
that... and follows the source back to its origin pushing unique_ptr
ownership up through there too)
llvm-svn: 213307
|
|
|
|
| |
llvm-svn: 211987
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Add hasLocalStorage/hasGlobalStorage matchers for VarDecl nodes.
Update the doc. Also add them to the dynamic registry.
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D4034
llvm-svn: 210278
|
|
|
|
| |
llvm-svn: 209070
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Add support for named values in the parser.
Reviewers: pcc
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D3276
llvm-svn: 206176
|
|
|
|
|
|
|
|
| |
This was submitted before it was ready.
This reverts commit 62060a01e095cf35eb9ca42a333752d12714f35c.
llvm-svn: 205533
|