Aleksei Sidorin
e45ab56ef1
[ASTImporterTest] Add mandatory testing with '-fdelayed-template-parsing'
...
* While running ASTImporterTests, we often forget about Windows MSVC
buildbots which enable '-fdelayed-template-parsing' by default.
This leads to AST import errors because templates are not parsed
and corresponding parts of AST are not built so importer cannot import them.
It takes both reviewing time to find such issues and post-commit time
to fix unexpected buildbot failures. To solve this issue, we enable testing
with '-fdelayed-template-parsing' option enabled by default in addition
to testing with default compiler options. This allows us to catch
the problem during development.
Differential Revision: https://reviews.llvm.org/D41444
llvm-svn: 321285
2017-12-21 17:41:06 +00:00
Peter Collingbourne
8b2c8df535
Revert r320942, "[ASTImporter] Support importing FunctionTemplateDecl and CXXDependentScopeMemberExpr"
...
Caused a test failure on Windows:
[ RUN ] ImportExpr.ImportCXXDependentScopeMemberExpr
C:\b\rr\tmppzcp4w\w\src\third_party\llvm\tools\clang\unittests\AST\ASTImporterTest.cpp(526): error: Value of: testImport("template <typename T> class C { T t; };" "template <typename T> void declToImport() {" " C<T> d;" " d.t;" "}", Lang_CXX, "", Lang_CXX, Verifier, functionTemplateDecl(has(functionDecl(has(compoundStmt( has(cxxDependentScopeMemberExpr())))))))
Actual: false (Could not find match)
Expected: true
C:\b\rr\tmppzcp4w\w\src\third_party\llvm\tools\clang\unittests\AST\ASTImporterTest.cpp(534): error: Value of: testImport("template <typename T> class C { T t; };" "template <typename T> void declToImport() {" " C<T> d;" " (&d)->t;" "}", Lang_CXX, "", Lang_CXX, Verifier, functionTemplateDecl(has(functionDecl(has(compoundStmt( has(cxxDependentScopeMemberExpr())))))))
Actual: false (Could not find match)
Expected: true
[ FAILED ] ImportExpr.ImportCXXDependentScopeMemberExpr (37 ms)
llvm-svn: 321139
2017-12-20 01:47:08 +00:00
Aleksei Sidorin
dec81835d1
[ASTImporter] Support importing FunctionTemplateDecl and CXXDependentScopeMemberExpr
...
* Also introduces ImportTemplateArgumentListInfo facility (A. Sidorin)
Patch by Peter Szecsi!
Differential Revision: https://reviews.llvm.org/D38692
llvm-svn: 320942
2017-12-17 14:16:17 +00:00
Aleksei Sidorin
9d8ba2e1ae
[ASTImporter] Add unit tests for UsingDecl and UsingShadowDecl
...
Patch by Kareem Khazem!
Differential Revision: https://reviews.llvm.org/D27181
llvm-svn: 319632
2017-12-03 16:04:07 +00:00
Aleksei Sidorin
60ccb7daf1
[ASTImporter] Support importing CXXPseudoDestructorExpr
...
Patch by Peter Szecsi!
Differential Revision: https://reviews.llvm.org/D38843
llvm-svn: 319015
2017-11-27 10:30:00 +00:00
Aleksei Sidorin
b05f37afcb
[ASTImporter] Support TypeTraitExpr
...
Patch by Takafumi Kubota!
Differential Revision: https://reviews.llvm.org/D39722
llvm-svn: 318998
2017-11-26 17:04:06 +00:00
Gabor Horvath
7a91c08414
[ASTImporter] TypeAliasTemplate and PackExpansion importing capability
...
Patch by: Zoltan Gera!
Differential Revision: https://reviews.llvm.org/D39247
llvm-svn: 318147
2017-11-14 11:30:38 +00:00
Gabor Horvath
480892b75f
[ASTImporter] Import SubStmt of CaseStmt
...
Patch by: Rafael Stahl!
Differential Revision: https://reviews.llvm.org/D38943
llvm-svn: 316069
2017-10-18 09:25:18 +00:00
Manuel Klimek
696e505278
Unify and simplify the behavior of the hasDeclaration matcher.
...
Originally, we weren't able to match on Type nodes themselves (only QualType),
so the hasDeclaration matcher was initially written to give what we thought are
reasonable results for QualType matches.
When we chagned the matchers to allow matching on Type nodes, it turned out
that the hasDeclaration matcher was by chance written templated enough to now
allow hasDeclaration to also match on (some) Type nodes.
This patch change the hasDeclaration matcher to:
a) work the same on Type and QualType nodes,
b) be completely explicit about what nodes we can match instead of just allowing
anything with a getDecl() to match,
c) explicitly control desugaring only one level in very specific instances.
d) adds hasSpecializedTemplate and tagType matchers to allow migrating
existing use cases that now need more explicit matchers
Note: This patch breaks clang-tools-extra. The corresponding patch there
is approved and will land in a subsequent patch.
Differential Revision: https://reviews.llvm.org/D27104
llvm-svn: 309809
2017-08-02 13:04:44 +00:00
Gabor Horvath
0866c2f5d4
[ASTImporter] Added ability to import AtomicType nodes
...
Patch by: Kareem Khazem
Differential Revision: https://reviews.llvm.org/D26328
llvm-svn: 287763
2016-11-23 15:24:23 +00:00
Malcolm Parsons
f76f6507c2
Fix Clang-tidy readability-redundant-string-cstr warnings
...
Reviewers: aaron.ballman, mehdi_amini, dblaikie
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D26206
llvm-svn: 285799
2016-11-02 10:39:27 +00:00
Aleksei Sidorin
a693b37e14
[ASTImporter] Implement some expression-related AST node import (part 2)
...
* Some code cleanup
* Add tests not present in http://reviews.llvm.org/D14286
* Integrate a test suite from Serge Pavlov (http://reviews.llvm.org/D14224 )
* ArrayTypeTraitExpr: serialize sub-expression to avoid keeping it undefined
* Implement import of some nodes:
- ArrayTypeTraitExpr
- ExpressionTraitExpr
- OpaqueValueExpr
- ArraySubscriptExpr
- ExplicitCastExpr
- ImplicitValueInitExpr
- OffsetOfExpr
- CXXThisExpr
- CXXThrowExpr
- CXXNoexceptExpr
- CXXDefaultArgExpr
- CXXScalarValueInitExpr
- CXXBindTemporaryExpr
- CXXTemporaryObjectExpr
- MaterializeTemporaryExpr
- ExprWithCleanups
- StaticAssertDecl
- FriendDecl
- DecayedType
Differential Revision: https://reviews.llvm.org/D14326
llvm-svn: 282572
2016-09-28 10:16:56 +00:00
Benjamin Kramer
cf236ec299
Prune away some unused using decls. NFC.
...
Found by clang's misc-unused-using-decls.
llvm-svn: 272156
2016-06-08 15:34:36 +00:00
Piotr Padlewski
cfed2bf588
[ASTMatchers] Breaking change of `has` matcher
...
has matcher can now match to implicit and paren casts
http://reviews.llvm.org/D20801
llvm-svn: 271288
2016-05-31 15:25:05 +00:00
Artem Dergachev
4e7c6fdeeb
[ASTImporter] Implement some expression-related AST node import.
...
Introduce ASTImporter unit test framework.
Fix a memory leak introduced in cf8ccff5: an array is allocated
in ImportArray and never freed.
Support new node kinds:
- GCCAsmStmt
- AddrLabelExpr
- AtomicExpr
- CompoundLiteralExpr
- CXXBoolLiteralExpr
- CXXNullPtrLiteralExpr
- CXXThisExpr
- DesignatedInitExpr
- GNUNullExpr
- ImplicitValueInitExpr
- InitListExpr
- OpaqueValueExpr
- PredefinedExpr
- ParenListExpr
- StmtExpr
- VAArgExpr
- BinaryConditionalOperator
- ConditionalOperator
- FloatingLiteral
- StringLiteral
- InjectedClassNameType
- TemplateTypeParmType
- LabelDecl
Patch by Aleksei Sidorin!
Differential Revision: http://reviews.llvm.org/D14286
llvm-svn: 266292
2016-04-14 11:51:27 +00:00