summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTDumper.cpp
Commit message (Collapse)AuthorAgeFilesLines
* When dumping the AST to JSON, dump the type information from a typeid ↵Aaron Ballman2019-05-271-2/+2
| | | | | | expression with a type operand. llvm-svn: 361769
* Add support for dumping AST comment nodes to JSON.Aaron Ballman2019-05-211-1/+2
| | | | llvm-svn: 361265
* Extract ASTDumper to a header fileStephen Kelly2019-05-171-46/+1
| | | | | | | | | | | | | | | | | | Summary: This class has member APIs which are useful to clients. Make it possible to use those APIs without adding them to dump() member functions. Doing so does not scale. The optional arguments to dump() should be designed to be useful in a debugging context. Reviewers: aaron.ballman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61835 llvm-svn: 361034
* Introduce the ability to dump the AST to JSON.Aaron Ballman2019-05-131-5/+14
| | | | | | This adds the -ast-dump=json cc1 flag (in addition to -ast-dump=default, which is the default if no dump format is specified), as well as some initial AST dumping functionality and tests. llvm-svn: 360622
* [AST] Extract ASTNodeTraverser class from ASTDumperStephen Kelly2019-02-031-558/+29
| | | | | | | | | | | | | | | | | | Summary: This new traverser class allows clients to re-use the traversal logic which was previously part of ASTDumper. This means that alternative visit logic may be implemented, such as * Dump to alternative data formats such as JSON * Implement AST Matcher parent/child visitation matching AST dumps Reviewers: aaron.ballman Subscribers: jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D57472 llvm-svn: 352989
* [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive.Michael Kruse2019-02-011-0/+5
| | | | | | | | | | | | | | | | | This patch implements parsing and sema for "omp declare mapper" directive. User defined mapper, i.e., declare mapper directive, is a new feature in OpenMP 5.0. It is introduced to extend existing map clauses for the purpose of simplifying the copy of complex data structures between host and device (i.e., deep copy). An example is shown below: struct S { int len; int *d; }; #pragma omp declare mapper(struct S s) map(s, s.d[0:s.len]) // Memory region that d points to is also mapped using this mapper. Contributed-by: Lingda Li <lildmh@gmail.com> Differential Revision: https://reviews.llvm.org/D56326 llvm-svn: 352906
* [ASTDump] Inline traverse methods into classStephen Kelly2019-01-301-543/+388
| | | | | | | This API will be extracted into a new template class. This change will make the follow-up commit easier to review. llvm-svn: 352676
* [ASTDump] Make method definition order matches declaration orderStephen Kelly2019-01-301-21/+22
| | | | | | This will make follow-up changes easier to review. llvm-svn: 352663
* [ASTDump] Re-arrange method declarations to group Visit togetherStephen Kelly2019-01-301-120/+112
| | | | | | This will make follow-up commits easier to review. llvm-svn: 352661
* [ASTDump] Rename methods which are conceptually VisitsStephen Kelly2019-01-301-129/+125
| | | | | | | This is consistent with the TextNodeDumper, and is the appropriate name for the traverser class which will be extracted. llvm-svn: 352657
* [ASTDump] NFC: Inline vestigial methodsStephen Kelly2019-01-301-23/+15
| | | | | | This was a porting aid. llvm-svn: 352656
* [ASTDump] Move Decl node dumping to TextNodeDumperStephen Kelly2019-01-301-625/+3
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D57419 llvm-svn: 352655
* [ASTDumper][OpenMP] CapturedDecl has a 'nothrow' bitRoman Lebedev2019-01-301-0/+2
| | | | | | | | | | | | | | | | | | | | | Summary: Was trying to understand how complicated it would be to write a clang-tidy `openmp-exception-escape`-ish check once D57100 lands. Just so it happens, all the data is already there, it is just conveniently omitted from AST dump. Reviewers: aaron.ballman, steveire, ABataev Reviewed By: ABataev Subscribers: ABataev, guansong, cfe-commits Tags: #openmp, #clang Differential Revision: https://reviews.llvm.org/D57452 llvm-svn: 352631
* NFC: Move GenericSelectionExpr dump to NodeDumperStephen Kelly2019-01-291-2/+0
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56961 llvm-svn: 352558
* NFC: Implement GenericSelectionExpr::Association dump with VisitorStephen Kelly2019-01-291-15/+11
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56960 llvm-svn: 352552
* Re-commit "[AST] Introduce GenericSelectionExpr::Association"Bruno Ricci2019-01-291-5/+5
| | | | | | This time with a fix to make gcc 4.8 happy. llvm-svn: 352486
* Revert "[AST] Introduce GenericSelectionExpr::Association"Bruno Ricci2019-01-281-5/+5
| | | | | | This breaks GCC 4.8.4. Reported by email by Hans Wennborg. llvm-svn: 352403
* [AST] Introduce GenericSelectionExpr::AssociationBruno Ricci2019-01-281-5/+5
| | | | | | | | | | | | | | | | | Introduce a new class GenericSelectionExpr::Association which bundle together an association expression and its TypeSourceInfo. An iterator GenericSelectionExpr::AssociationIterator is additionally added to make it possible to iterate over ranges of Associations. This iterator is a kind of proxy iterator which abstract over how exactly the expressions and the TypeSourceInfos are stored. Differential Revision: https://reviews.llvm.org/D57106 Reviewed By: aaron.ballman Reviewers: aaron.ballman, steveire, dblaikie, mclow.lists llvm-svn: 352369
* [ASTDump] NFC: Convert iterative loops to cxx_range_forStephen Kelly2019-01-191-24/+14
| | | | | | | This is coming up a lot in reviews. Better just to change them all at once. llvm-svn: 351647
* [ASTDump] NFC: Use `const auto` in cxx_range_for loopsStephen Kelly2019-01-191-15/+15
| | | | | | This is coming up a lot in reviews. Better just to do them all at once. llvm-svn: 351646
* Move decl context dumping to TextNodeDumperStephen Kelly2019-01-191-7/+0
| | | | | | | | | | | | Summary: Only an obscure case is moved. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56829 llvm-svn: 351637
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [ASTDump] NFC: Move variable into if() statementStephen Kelly2019-01-181-2/+1
| | | | llvm-svn: 351605
* [ASTDump] NFC: Remove redundant conditionStephen Kelly2019-01-181-4/+1
| | | | | | | | | | | These conditions are duplicated from the dumpDeclContext function called within the if(). This is presumably an attempt to avoid calling the function in the case it will do nothing. That may have made sense in the past if the code was different, but it doesn't make sense now. llvm-svn: 351604
* [ASTDump] NFC: Remove non-needed bracesStephen Kelly2019-01-181-3/+2
| | | | llvm-svn: 351603
* [ASTDump] Mark null params with a tag rather than a child nodeStephen Kelly2019-01-181-4/+9
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56753 llvm-svn: 351601
* [ASTDump] Mark BlockDecls which capture this with a tagStephen Kelly2019-01-181-3/+3
| | | | | | | | | | | | | | Summary: Removal of the child node makes it easier to separate traversal from output generation. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56752 llvm-svn: 351600
* [ASTDump] Mark variadic declarations with a tag instead of child nodeStephen Kelly2019-01-181-8/+6
| | | | | | | | | | | | | | Summary: This makes it easier to separate traversal of the AST from output generation. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56751 llvm-svn: 351597
* Re-order type param children of ObjC nodesStephen Kelly2019-01-151-2/+2
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55394 llvm-svn: 351272
* NFC: Some cleanups that I missed in the previous commitStephen Kelly2019-01-151-9/+6
| | | | llvm-svn: 351271
* Re-order overrides in FunctionDecl dumpStephen Kelly2019-01-151-14/+16
| | | | | | | | | | | | | | Output all content which is local to the FunctionDecl before traversing to child AST nodes. This is necessary so that all of the part which is local to the FunctionDecl can be split into a different method. Reviewers: aaron.ballman Differential Revision: https://reviews.llvm.org/D55083 llvm-svn: 351269
* NFC: Replace iterator loop with cxx_range_forStephen Kelly2019-01-151-4/+2
| | | | llvm-svn: 351268
* Implement BlockDecl::Capture dump in terms of visitorsStephen Kelly2019-01-151-15/+11
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56709 llvm-svn: 351239
* NFC: Implement OMPClause dump in terms of visitorsStephen Kelly2019-01-151-21/+11
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56708 llvm-svn: 351236
* Implement CXXCtorInitializer dump in terms of VisitorStephen Kelly2019-01-151-11/+1
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56707 llvm-svn: 351235
* NFC: Move Decl node handling to TextNodeDumperStephen Kelly2019-01-151-68/+2
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56643 llvm-svn: 351175
* [ASTDump] NFC: Move dump of type nodes to NodeDumperStephen Kelly2019-01-151-88/+1
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56642 llvm-svn: 351172
* [ASTDump] NFC: Move dumping of QualType node to TextNodeDumperStephen Kelly2019-01-141-5/+1
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56641 llvm-svn: 351116
* [ASTDump] NFC: Canonicalize handling of TypeLocInfoStephen Kelly2019-01-141-4/+3
| | | | | | | | | | | | Summary: No need to avoid the Visit method. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56640 llvm-svn: 351115
* [ASTDump] NFC: Move Type Visit implementation to TextNodeDumperStephen Kelly2019-01-141-32/+3
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56639 llvm-svn: 351114
* NFC: Fix nits I missed beforeStephen Kelly2019-01-141-1/+1
| | | | llvm-svn: 351112
* [ASTDump] NFC: Move dump of individual Stmts to TextNodeDumperStephen Kelly2019-01-121-489/+2
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55340 llvm-svn: 351014
* Implement TemplateArgument dumping in terms of VisitorStephen Kelly2019-01-121-44/+13
| | | | | | | | | | | | Summary: Split the output streaming from the traversal to other AST nodes. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55491 llvm-svn: 351012
* NFC: Port loop to cxx_range_forStephen Kelly2019-01-121-3/+2
| | | | llvm-svn: 350984
* Implement Attr dumping in terms of visitorsStephen Kelly2019-01-111-19/+8
| | | | | | | | | | | | | | Remove now-vestigial dumpType and dumpBareDeclRef methods. The old tablegen generated code used to expect them to be present, but the new generated code has no such requirement. Reviewers: aaron.ballman Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D55492 llvm-svn: 350958
* [ASTDump] Add utility for dumping a label with child nodesStephen Kelly2019-01-111-7/+7
| | | | | | | | | | | | | | | | | | | Summary: Use it to add optional label nodes to Stmt dumps. This preserves behavior of InitExprList dump: // CHECK-NEXT: `-InitListExpr {{.+}} <col:13, col:15> 'U [3]' // CHECK-NEXT: |-array_filler: InitListExpr {{.+}} <col:15> 'U' field Field {{.+}} 'i' 'int' // CHECK-NEXT: `-InitListExpr {{.+}} <col:14> 'U' field Field {{.+}} 'i' 'int' // CHECK-NEXT: `-IntegerLiteral {{.+}} <col:14> 'int' 1 Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55488 llvm-svn: 350957
* NFC: Change case of identifiersStephen Kelly2019-01-101-2/+2
| | | | llvm-svn: 350890
* [ASTDump] NFC: Move dumpDeclRef to NodeDumperStephen Kelly2019-01-081-42/+30
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55337 llvm-svn: 350677
* Implement the TreeStructure interface through the TextNodeDumperStephen Kelly2019-01-081-4/+2
| | | | | | | | | | | | | | | | | | | | Summary: This way, when the generic ASTTraverser is extracted from ASTDumper, there can't be any problem related to ordering of class members, a concern that was raised in https://reviews.llvm.org/D55337. This will also preserve the property that the generic traverser does not enforce any coupling between the NodeDumper and the TreeStructure. https://godbolt.org/z/PEtT1_ Reviewers: aaron.ballman, erichkeane Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56407 llvm-svn: 350665
* [OpenCL] Add generic AS to 'this' pointerMikael Nilsson2018-12-131-3/+4
| | | | | | | | | | | | | Address spaces are cast into generic before invoking the constructor. Added support for a trailing Qualifiers object in FunctionProtoType. Note: This recommits the previously reverted patch, but now it is commited together with a fix for lldb. Differential Revision: https://reviews.llvm.org/D54862 llvm-svn: 349019
OpenPOWER on IntegriCloud