Aaron Ballman
a35b8fcef8
Adding new AST matchers for: addrLabelExpr, atomicExpr, binaryConditionalOperator, designatedInitExpr, designatorCountIs, hasSyntacticForm, implicitValueInitExpr, labelDecl, opaqueValueExpr, parenListExpr, predefinedExpr, requiresZeroInitialization, and stmtExpr.
...
Patch by Aleksei Sidorin.
llvm-svn: 263027
2016-03-09 17:11:51 +00:00
Samuel Benzaquen
922bef4f38
[ASTMatchers] Add matcher hasAnyName.
...
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
2016-02-22 21:13:02 +00:00
Aaron Ballman
eb7e5d9074
Add an AST matcher for real floating-point types. e.g., float, double, long double, but not complex.
...
llvm-svn: 261221
2016-02-18 16:36:01 +00:00
Aaron Ballman
232e63d00b
Add a nullPointerConstant() AST matcher to handle variations of null pointer constants in one matcher.
...
llvm-svn: 261008
2016-02-16 21:02:23 +00:00
Felix Berger
cc9df3b9cc
Add isAnyPointer() matchers. Register missing matchers.
...
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
2016-02-15 04:00:39 +00:00
Reid Kleckner
969b1a50a0
Pass /bigobj when building lib/ASTMatchers/Dynamic/Registry.cpp
...
This is the third time it has crossed the 2^16 section limit. We've
already spent time optimizing this file to reduce template
instantiations, and it's not clear that there is anymore low hanging
fruit.
llvm-svn: 260267
2016-02-09 19:53:30 +00:00
Aaron Ballman
880a65bba5
Registering the gnuNullExpr AST matcher as a dynamic matcher so that it is available from clang-query.
...
llvm-svn: 260222
2016-02-09 14:04:49 +00:00
Aaron Ballman
7e7b7b2def
Reapply r259210 with a fix for RegistryTest.cpp.
...
Patch by Richard Thomson.
llvm-svn: 259359
2016-02-01 14:11:47 +00:00
Hans Wennborg
2b79910d8b
Revert r259210 "Extend hasType narrowing matcher for TypedefDecls, add functionProtoType matcher for FunctionProtoType nodes, extend parameterCountIs to FunctionProtoType nodes."
...
It didn't pass check-clang.
llvm-svn: 259218
2016-01-29 18:24:34 +00:00
Aaron Ballman
fb9d0e354d
Extend hasType narrowing matcher for TypedefDecls, add functionProtoType matcher for FunctionProtoType nodes, extend parameterCountIs to FunctionProtoType nodes.
...
Patch by Richard Thomson
llvm-svn: 259210
2016-01-29 17:03:11 +00:00
Chris Bieneman
2bf68c6c1c
Remove autoconf support
...
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
2016-01-26 21:30:40 +00:00
Eugene Zelenko
1660a5d298
Fix Clang-tidy modernize-use-nullptr warnings; other minor fixes.
...
Differential revision: http://reviews.llvm.org/D16567
llvm-svn: 258836
2016-01-26 19:01:06 +00:00
Aaron Ballman
31bde8762e
Add am AST matcher for isMoveAssignmentOperator.
...
Patch by Jonathan Coe.
llvm-svn: 258573
2016-01-22 22:37:09 +00:00
Nico Weber
a415a1d0d7
Add an isVirtualAsWritten AST matcher.
...
http://reviews.llvm.org/D16394
llvm-svn: 258415
2016-01-21 17:56:24 +00:00
Aaron Ballman
433485f003
Register the isCopyAssignmentOperator AST matcher so that it can be used dynamically.
...
Path by Jonathan Coe.
llvm-svn: 258341
2016-01-20 20:47:58 +00:00
Aaron Ballman
e8295d7980
Add AST matcher for paren expressions.
...
Patch by Adrian Zgorzałek.
llvm-svn: 258321
2016-01-20 16:17:39 +00:00
Aaron Ballman
eb85b04c7e
Add an AST matcher for checking whether a function is defaulted.
...
Patch by Jonathan Coe.
llvm-svn: 258072
2016-01-18 20:37:44 +00:00
Manuel Klimek
ce28f9ebd3
Add forEachArgumentWithParam AST matcher.
...
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
2016-01-18 11:20:09 +00:00
Samuel Benzaquen
bd3232af03
[ASTMatchers] Add booleanType() matcher.
...
llvm-svn: 256278
2015-12-22 20:06:40 +00:00
Aaron Ballman
a60bcdab92
Add a narrowing AST matcher that matches on a FunctionDecl with a non-throwing exception specification.
...
llvm-svn: 254516
2015-12-02 15:23:59 +00:00
Aaron Ballman
6290fc9154
Add an AST matcher for narrowing when a type is volatile-qualified.
...
llvm-svn: 253882
2015-11-23 17:09:24 +00:00
Aaron Ballman
8e7f00b0eb
Re-committing r253473 after hopefully fixing the bot breakage. There was a copy-pasta issue that my local testing did not catch.
...
llvm-svn: 253481
2015-11-18 17:56:55 +00:00
Aaron Ballman
81d17f2f7e
Reverting r253473 while I investigate build bot failures.
...
llvm-svn: 253475
2015-11-18 17:16:01 +00:00
Aaron Ballman
34e0bd40e4
Adding AST matchers for VarDecl storage durations. Can now determine whether a VarDecl has automatic, static, or thread storage duration. This also updates the documentation for matchers, which appear to be missing some previous additions.
...
llvm-svn: 253473
2015-11-18 17:05:39 +00:00
Angel Garcia Gomez
637d1e6694
Roll-back r250822.
...
Summary: It breaks the build for the ASTMatchers
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D13893
llvm-svn: 250827
2015-10-20 13:23:58 +00:00
Angel Garcia Gomez
b5250d3448
Apply modernize-use-default to clang.
...
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
2015-10-20 12:52:55 +00:00
Matthias Gehre
2cf7e803bb
Add decayedType and hasDecayedType AST matchers
...
Summary: Add decayedType and hasDecayedType AST matchers
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D13639
llvm-svn: 250114
2015-10-12 21:46:07 +00:00
Aaron Ballman
3fd6c110be
Adding a narrowing AST matcher for FunctionDecl::isVariadic(), plus tests and documentation.
...
llvm-svn: 249321
2015-10-05 14:41:27 +00:00
Craig Topper
e335f25949
SourceRanges are small and trivially copyable, don't them by reference.
...
llvm-svn: 249259
2015-10-04 04:53:55 +00:00
Aaron Ballman
512fb64765
Rename AST node matchers to match the AST node names directly. Part of this rename also splits recordDecl() (which used to match CXXRecordDecl) into recordDecl() (that matches RecordDecl) and cxxRecordDecl (that matches CXXRecordDecl). Also adds isStruct(), isUnion(), and isClass() narrowing matchers for RecordDecl objects.
...
llvm-svn: 247885
2015-09-17 13:30:52 +00:00
Aaron Ballman
b85be665b0
Fixed HasDeclarationMatcher to properly convert all types into decls where possible. Added objcObjectPointerType(), objcInterfaceDecl(), templateTypeParmType(), injectedClassNameType(), and unresolvedUsingTypenameDecl(). Updated documentation for pointerType() to call out that it does not match ObjCObjectPointerType types. Changed pointsTo() to handle ObjCObjectPointerType as well as PointerType.
...
While this may seem like a lot of unrelated changes, they all relate back to fixing HasDeclarationMatcher.
This now allows us to write a matcher like:
varDecl(hasType(namedDecl(hasName("Foo"))))
that matches code using typedefs, objc interfaces, template type parameters, injected class names, or unresolved using typenames.
llvm-svn: 247404
2015-09-11 11:51:24 +00:00
Aaron Ballman
6c79f352b8
Adding an AST matcher for namespaceAliasDecl.
...
llvm-svn: 246322
2015-08-28 19:39:21 +00:00
Samuel Benzaquen
f8ec454f7d
[ASTMatchers] Add type matcher for SubstTemplateTypeParmType.
...
llvm-svn: 246037
2015-08-26 16:15:59 +00:00
Aaron Ballman
11825f2592
Add AST narrowing matchers for inline and anonymous namespaces. Since the inline keyword can also be specified on a FunctionDecl, this is a polymorphic matcher.
...
llvm-svn: 245337
2015-08-18 19:55:20 +00:00
Aaron Ballman
7596bcf726
Switching from an explicit loop to DeleteContainerSeconds; NFC.
...
llvm-svn: 244802
2015-08-12 20:05:18 +00:00
Aaron Ballman
001f168e94
RangRangify some more for loops; NFC.
...
llvm-svn: 244792
2015-08-12 19:00:39 +00:00
Aaron Ballman
6f6d0b6c5a
Add a polymorphic AST matcher for testing whether a constructor or a conversion declaration is marked as explicit or not.
...
llvm-svn: 244666
2015-08-11 21:09:52 +00:00
Aaron Ballman
ed455d4062
Add an AST matcher to match member intializers of a CXXCtorInitializer.
...
llvm-svn: 244662
2015-08-11 20:42:00 +00:00
Aaron Ballman
1ca258e6a8
Add AST matchers for narrowing constructors that are default, copy, or move constructors, as well as functionality to determine whether a ctor initializer is a base initializer.
...
llvm-svn: 244036
2015-08-05 12:11:30 +00:00
Aaron Ballman
41143bb573
Add an AST matcher, isFinal(), for testing whether a method or class declaration are marked final.
...
llvm-svn: 243107
2015-07-24 12:35:41 +00:00
Samuel Benzaquen
b063f5c7e1
[ASTMatchers] Use provided target NodeKind instead of inferring it from the matchers.
...
Individual matchers might not be convertible to each other's kind, but
they might still all be convertible to the target kind.
All the callers already know the target kind, so just pass it down.
llvm-svn: 242534
2015-07-17 16:05:27 +00:00
Aaron Ballman
3991846c33
Add the ability to AST match a variable declaration that is an exception variable.
...
llvm-svn: 242303
2015-07-15 17:11:21 +00:00
Yaron Keren
5b816061ba
Replace some const std::string & with llvm::StringRef or std::string
...
and std::move to avoid implicit std::string construction.
Patch by Eugene Kosov.
llvm-svn: 241433
2015-07-06 08:47:15 +00:00
Yaron Keren
40178c352e
Revert r241330. It compiled with Visual C++ 2013 and gcc 4.9.1 (mingw) but now fails the bots.
...
llvm-svn: 241335
2015-07-03 09:30:33 +00:00
Yaron Keren
452670165c
Replace some const std::string & with llvm::StringRef or std::string
...
and std::move to avoid implicit std::string construction.
Patch by Eugene Kosov.
llvm-svn: 241330
2015-07-03 09:16:20 +00:00
Yaron Keren
d30f5ffddc
Revert r241319, investigating.
...
llvm-svn: 241321
2015-07-03 05:31:54 +00:00
Yaron Keren
25bb2e4709
Replace some const std::string & with llvm::StringRef or std::string
...
and std::move to avoid implicit std::string construction.
Part 1/2.
Patch by Eugene Kosov.
llvm-svn: 241319
2015-07-03 05:09:59 +00:00
Aaron Ballman
9b869aa4a1
Implement an AST matcher for C++ exception catch handlers that can catch any exception type (...).
...
llvm-svn: 241256
2015-07-02 12:53:22 +00:00
David Majnemer
8423df927e
Move a test from static-assert.cpp to DeclPrinterTest
...
It's better not to rely on the diagnostics engine to pretty print the
argument to decltype. Instead, exercise the functionality in
DeclPrinterTest.
llvm-svn: 239197
2015-06-05 22:40:53 +00:00
Benjamin Kramer
3204b152b5
Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types
...
If the type isn't trivially moveable emplace can skip a potentially
expensive move. It also saves a couple of characters.
Call sites were found with the ASTMatcher + some semi-automated cleanup.
memberCallExpr(
argumentCountIs(1), callee(methodDecl(hasName("push_back"))),
on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))),
hasArgument(0, bindTemporaryExpr(
hasType(recordDecl(hasNonTrivialDestructor())),
has(constructExpr()))),
unless(isInTemplateInstantiation()))
No functional change intended.
llvm-svn: 238601
2015-05-29 19:42:19 +00:00