| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
with both functionDecl and functionPrototype matchers.
Patch by Don Hinton.
llvm-svn: 272028
|
|
|
|
|
|
| |
expressions). This is required for traversing certain types (like function pointer types).
llvm-svn: 271927
|
|
|
|
|
|
|
|
| |
has matcher can now match to implicit and paren casts
http://reviews.llvm.org/D20801
llvm-svn: 271288
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The switch statement could be added to the hasCondition matcher.
Example:
```
clang-query> match switchStmt(hasCondition(ignoringImpCasts(declRefExpr())))
```
Output:
```
Match #1:
Binding for "root":
SwitchStmt 0x2f9b528 </usr/local/google/home/etienneb/examples/enum.cc:35:3, line:38:3>
|-<<<NULL>>>
|-ImplicitCastExpr 0x2f9b510 <line:35:11> 'int' <IntegralCast>
| `-ImplicitCastExpr 0x2f9b4f8 <col:11> 'enum Color' <LValueToRValue>
| `-DeclRefExpr 0x2f9b4d0 <col:11> 'enum Color' lvalue Var 0x2f9a118 'C' 'enum Color'
`-CompoundStmt 0x2f9b610 <col:14, line:38:3>
|-CaseStmt 0x2f9b578 <line:36:3, col:22>
| |-ImplicitCastExpr 0x2f9b638 <col:8> 'int' <IntegralCast>
| | `-DeclRefExpr 0x2f9b550 <col:8> 'enum Size' EnumConstant 0x2f99e40 'Small' 'enum Size'
| |-<<<NULL>>>
| `-ReturnStmt 0x2f9b5d0 <col:15, col:22>
| `-IntegerLiteral 0x2f9b5b0 <col:22> 'int' 1
`-DefaultStmt 0x2f9b5f0 <line:37:3, col:12>
`-BreakStmt 0x2f9b5e8 <col:12>
1 match.
```
Reviewers: aaron.ballman, sbenza, klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D20767
llvm-svn: 271208
|
|
|
|
| |
llvm-svn: 269957
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: alexfh, aaron.ballman
Subscribers: thakis, cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D20369
llvm-svn: 269936
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: alexfh, aaron.ballman
Subscribers: aaron.ballman, klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D20360
llvm-svn: 269916
|
|
|
|
|
|
|
| |
fix for long compilation [20061]
http://reviews.llvm.org/D20210
llvm-svn: 269802
|
|
|
|
|
|
|
|
| |
that have a dynamic exception specification.
Patch by Don Hinton.
llvm-svn: 269662
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This AST matcher will match a given CastExpr kind.
It's an narrowing matcher on CastExpr.
Reviewers: klimek, alexfh, sbenza, aaron.ballman
Subscribers: Prazek, jroelofs, aaron.ballman, klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D19871
llvm-svn: 269460
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch is adding support for a matcher to check string literal length.
This matcher is used in clang-tidy checkers and is part of this refactoring:
see: http://reviews.llvm.org/D19841
Reviewers: sbenza, klimek, aaron.ballman
Subscribers: alexfh, klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D19876
llvm-svn: 269274
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Matcher proposed in the review of checker misc-assign-operator (name pending). Its goal is to find the direct enclosing function declaration of a statement and run the inner matcher on it. Two version is attached in this patch (thus it will not compile), to be decided which approach to take. The second one always chooses one single parent while the first one does a depth-first search upwards (thus a height-first search) and returns the first positive match of the inner matcher (thus it always returns zero or one matches, not more). Further questions: is it enough to implement it in-place, or ASTMatchersInternals or maybe ASTMatchFinder should be involved?
Reviewers: sbenza
Subscribers: aaron.ballman, klimek, o.gyorgy, xazax.hun, cfe-commits
Differential Revision: http://reviews.llvm.org/D19357
llvm-svn: 268490
|
|
|
|
|
|
| |
Patch by Clement Courbet
llvm-svn: 266986
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Prevent hasAncestor from comparing nodes that are not supported.
hasDescendant was fixed some time ago to avoid this problem.
I'm applying the same fix to hasAncestor: if any object in the Builder map is
not comparable, skip the cache.
Reviewers: alexfh
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D19231
llvm-svn: 266748
|
|
|
|
|
|
|
|
| |
hasType() to match on TypedefNameDecl nodes.
Patch by Clement Courbet.
llvm-svn: 266331
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
AllKindInfo is being indexed by NodeKindId, so the order must match.
Extended ASTTypeTraits tests to cover this.
Reviewers: sbenza
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D19059
llvm-svn: 266268
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CXXMethodDecl::isUserProvided.
Summary: Added two AST matchers: isDelegatingConstructor for CXXConstructorDecl::IsDelegatingConstructor; and isUserProvided corresponding to CXXMethodDecl::isUserProvided.
Reviewers: aaron.ballman, alexfh
Subscribers: klimek, cfe-commits
Patch by Michael Miller!
Differential Revision: http://reviews.llvm.org/D19038
llvm-svn: 266189
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The crash was reproduced by the included test case. It was initially
found through a crash of clang-tidy's misc-misplaced-widening-cast
check.
Reviewers: klimek, alexfh
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D18991
llvm-svn: 266043
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: A checker (will be uploaded after this patch) needs to check implicit casts. The checker needs matcher hasAnyArgument but it ignores implicit casts and parenthesized expressions which disables checking of implicit casts for arguments in the checker. However the documentation of the matcher contains a FIXME that this should be removed once separate matchers for ignoring implicit casts and parenthesized expressions are ready. Since these matchers were already there the fix could be executed. Only one Clang checker was affected which was also fixed (ignoreParenImpCasts added) and is separately uploaded. Third party checkers (not in the Clang repository) may be affected by this fix so the fix must be emphasized in the release notes.
Reviewers: klimek, sbenza, alexfh
Subscribers: alexfh, klimek, xazax.hun, cfe-commits
Differential Revision: http://reviews.llvm.org/D18243
llvm-svn: 264855
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
llvm::VariadicFunction is only being used by ASTMatchers.
Having our own copy here allows us to remove the other one from llvm/ADT.
Also, we can extend the API to meet our needs without modifying the common
implementation.
Reviewers: alexfh
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D18275
llvm-svn: 264417
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: A checker (will be uploaded after this patch) needs to check implicit casts. Existing generic matcher "has" ignores implicit casts and parenthesized expressions and no specific matcher for matching return value expression preexisted. The patch adds such a matcher (hasReturnValue).
Reviewers: klimek, sbenza
Subscribers: xazax.hun, klimek, cfe-commits
Patch by Ádám Balogh!
Differential Revision: http://reviews.llvm.org/D17986
llvm-svn: 264037
|
|
|
|
|
|
| |
MSVC-built bots.
llvm-svn: 263041
|
|
|
|
|
|
|
|
| |
binaryConditionalOperator, designatedInitExpr, designatorCountIs, hasSyntacticForm, implicitValueInitExpr, labelDecl, opaqueValueExpr, parenListExpr, predefinedExpr, requiresZeroInitialization, and stmtExpr.
Patch by Aleksei Sidorin.
llvm-svn: 263027
|
|
|
|
|
|
| |
2015 Win64 Debug due to the section limit.
llvm-svn: 262938
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
object pointers.
Summary: Add test for Objective-C object pointer matching.
Reviewers: aaron.ballman
Subscribers: klimek
Differential Revision: http://reviews.llvm.org/D17489
llvm-svn: 262806
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Add matcher hasAnyName as an optimization over anyOf(hasName(),...)
Reviewers: alexfh
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D17163
llvm-svn: 261574
|
|
|
|
|
|
| |
double, but not complex.
llvm-svn: 261221
|
|
|
|
| |
llvm-svn: 261009
|
|
|
|
|
|
| |
constants in one matcher.
llvm-svn: 261008
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The isAnyPointer() matcher is useful for http://reviews.llvm.org/D15623.
Reviewers: alexfh, klimek
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D15819
llvm-svn: 260872
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For an explicit specialization, we first build a FunctionDecl, and then
we call SubstDecl() on it to build a second FunctionDecl, which has the
first FunctionDecl as canonical decl.
The address of an explicit specialization of function template used to be the
canonical decl of the FunctionDecl. This is different from all the other
DeduceTemplateArguments() calls in SemaOverload, and since the canonical decl
isn't visited by ParentMap while the redecl is, it also made ParentMap assert
when computing the parent of a address-of-explicit-specialization-fun-template.
To fix, remove the getCanonicalDecl() call. No behavior difference for clang,
but it fixes an assert in ParentMap (which is e.g. used by libTooling).
llvm-svn: 260159
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Allow hasName() to look through inline namespaces.
This will fix the interaction between some clang-tidy checks and libc++.
libc++ defines names in an inline namespace named std::<version_#>.
When we try to match a name using hasName("std::xxx") it fails to match and the clang-tidy check does not work.
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D15506
llvm-svn: 259898
|
|
|
|
| |
llvm-svn: 259648
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
RecursiveASTVisitor::TraverseFunctionHelper() traverses a function's
ParmVarDecls by going to the function's getTypeSourceInfo if it exists, and
`DEF_TRAVERSE_TYPELOC(FunctionProtoType` then goes to the function's
ParmVarDecls.
For a function template that doesn't have parameters that explicitly depend on
the template parameter, we used to be clever and not build a new
TypeSourceInfo. That meant that when an instantiation of such a template is
visited, its TypeSourceInfo would point to the ParmVarDecls of the template,
not of the instantiation, which then confused clients of RecursiveASTVisitor.
So don't be clever for function templates that have parameters, even if none of
the parameters depend on the type.
Fixes PR26257.
http://reviews.llvm.org/D16478
llvm-svn: 259428
|
|
|
|
|
|
| |
Patch by Richard Thomson.
llvm-svn: 259359
|
|
|
|
|
|
|
|
| |
functionProtoType matcher for FunctionProtoType nodes, extend parameterCountIs to FunctionProtoType nodes."
It didn't pass check-clang.
llvm-svn: 259218
|
|
|
|
|
|
|
|
| |
matcher for FunctionProtoType nodes, extend parameterCountIs to FunctionProtoType nodes.
Patch by Richard Thomson
llvm-svn: 259210
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For
void f() {
union { int i; };
}
clang used to omit the RecordDecl from the anonymous union from the AST.
That's because the code creating it only called PushOnScopeChains(), which adds
it to the current DeclContext, which here is the function's DeclContext. But
RecursiveASTVisitor doesn't descent into all decls in a FunctionDecl.
Instead, for DeclContexts that contain statements, return the RecordDecl so
that it can be included in the DeclStmt containing the VarDecl for the union.
Interesting bits from the AST before this change:
|-FunctionDecl
| `-CompoundStmt
| |-DeclStmt
| | `-VarDecl 0x589cd60 <col:3> col:3 implicit used 'union (anonymous at test.cc:3:3)' callinit
After this change:
-FunctionDecl
| `-CompoundStmt
| |-DeclStmt
| | |-CXXRecordDecl 0x4612e48 <col:3, col:18> col:3 union definition
| | | |-FieldDecl 0x4612f70 <col:11, col:15> col:15 referenced i 'int'
| | `-VarDecl 0x4613010 <col:3> col:3 implicit used 'union (anonymous at test.cc:3:3)' callinit
This is now closer to how anonymous struct and unions are represented as
members of structs. It also enabled deleting some one-off code in the
template instantiation code.
Finally, it fixes a crash with ASTMatchers, see the included test case
(this fixes http://crbug.com/580749).
llvm-svn: 259079
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Patch by Jonathan Coe.
llvm-svn: 258573
|
|
|
|
|
|
|
|
|
|
|
|
| |
An implicit copy ctor creates loop VarDecls that hang off CXXCtorInitializer.
RecursiveASTVisitor used to not visit them, so that they didn't show up in the
parent map used by ASTMatchers, causing asserts() when the implicit
DeclRefExpr() in a CXXCtorInitializer referred to one of these VarDecls.
Fixes PR26227.
http://reviews.llvm.org/D16413
llvm-svn: 258503
|
|
|
|
|
|
| |
http://reviews.llvm.org/D16394
llvm-svn: 258415
|
|
|
|
|
|
| |
Patch by Aleksei Sidorin.
llvm-svn: 258322
|
|
|
|
|
|
| |
Patch by Adrian Zgorzałek.
llvm-svn: 258321
|
|
|
|
| |
llvm-svn: 258077
|
|
|
|
|
|
| |
Patch by Jonathan Coe.
llvm-svn: 258072
|
|
|
|
|
|
| |
EXPECT_TRUE instead of EXPECT_FALSE. Adds a matcher test to ensure that static member functions are properly handled. Generates the documentation from the matcher.
llvm-svn: 258070
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new matcher allows users to provide a matcher for both the argument
of a CallExpr/CxxConstructExpr a well as the ParmVarDecl of the
argument.
Patch by Felix Berger.
Differential Revision: http://reviews.llvm.org/D13845
llvm-svn: 258042
|
|
|
|
| |
llvm-svn: 256278
|