summaryrefslogtreecommitdiffstats
path: root/clang/test/AST
Commit message (Collapse)AuthorAgeFilesLines
...
* Ignore trailing NullStmts in StmtExprs for GCC compatibility.Aaron Ballman2019-07-091-0/+10
| | | | | | | | Ignore trailing NullStmts in compound expressions when determining the result type and value. This is to match the GCC behavior which ignores semicolons at the end of compound expressions. Patch by Dominic Ferreira. llvm-svn: 365498
* [clang][test][NFC] Explicitly specify clang ABI in AST Dumper testJan Korous2019-06-281-1/+1
| | | | | | Clang <= 4 used the pre-C++11 rule about which structures can be passed in registers. llvm-svn: 364690
* [HIP] Support attribute hip_pinned_shadowYaxun Liu2019-06-261-0/+13
| | | | | | | | | | | | | | | This patch introduces support of hip_pinned_shadow variable for HIP. A hip_pinned_shadow variable is a global variable with attribute hip_pinned_shadow. It has external linkage on device side and has no initializer. It has internal linkage on host side and has initializer or static constructor. It can be accessed in both device code and host code. This allows HIP runtime to implement support of HIP texture reference. Differential Revision: https://reviews.llvm.org/D62738 llvm-svn: 364381
* Augment location information when dumping the AST to JSON.Aaron Ballman2019-06-2421-9632/+6052
| | | | | | Rather than create JSON objects for source locations and ranges, we instead stream them out directly. This allows us to elide duplicate information (without JSON field reordering causing an issue) like file names and line numbers, similar to the text dump. This also adds token length information when dumping the source location. llvm-svn: 364226
* Ensure that top-level QualType objects also have a "kind" field when dumping ↵Aaron Ballman2019-06-211-0/+72
| | | | | | the AST to JSON. llvm-svn: 364078
* Print more type node information when dumping the AST to JSON.Aaron Ballman2019-06-211-0/+358
| | | | llvm-svn: 364067
* Add an automated note to files produced by gen_ast_dump_json_test.py.Aaron Ballman2019-06-2121-627/+678
| | | | | | This also details what filters, if any, were used to generate the test output. Updates all the current JSON testing files to include the automated note. llvm-svn: 364055
* Print information about various type nodes when dumping the AST to JSON.Aaron Ballman2019-06-214-2243/+2285
| | | | llvm-svn: 364043
* Fix test/AST/ast-dump-records-json.cpp after ConstantExpr change in D63376Fangrui Song2019-06-211-0/+6
| | | | llvm-svn: 364033
* Print information about various ObjC expression nodes when dumping the AST ↵Aaron Ballman2019-06-202-143/+4963
| | | | | | to JSON. llvm-svn: 363988
* Print additional information about @encode expressions when dumping the AST ↵Aaron Ballman2019-06-201-0/+143
| | | | | | to JSON. llvm-svn: 363966
* Print additional information on dependent scopes when dumping the AST to JSON.Aaron Ballman2019-06-201-366/+640
| | | | llvm-svn: 363965
* Dump more information about expressions involving temporaries when dumping ↵Aaron Ballman2019-06-203-2/+468
| | | | | | the AST to JSON. llvm-svn: 363943
* Add test cases for explicit casts when dumping the AST to JSON; NFC.Aaron Ballman2019-06-202-0/+2213
| | | | llvm-svn: 363932
* Dump more information about construct expressions (resolved and unresolved) ↵Aaron Ballman2019-06-202-384/+556
| | | | | | when dumping the AST to JSON. llvm-svn: 363926
* Print whether a generic selection expression is result dependent when ↵Aaron Ballman2019-06-191-0/+334
| | | | | | dumping the AST to JSON. llvm-svn: 363873
* Print out the union field being initialized by an InitListExpr when dumping ↵Aaron Ballman2019-06-191-2/+17
| | | | | | the AST to JSON. llvm-svn: 363869
* Dump the value calculated by a constant expression when dumping the AST to JSON.Aaron Ballman2019-06-192-0/+3
| | | | llvm-svn: 363866
* Switching this test to use output generated by script; NFC.Aaron Ballman2019-06-191-931/+937
| | | | llvm-svn: 363859
* Add test cases for dumping record definition data to JSON; NFC.Aaron Ballman2019-06-191-0/+5196
| | | | llvm-svn: 363849
* Add a script to help generate expected test output for dumping the AST to JSON.Aaron Ballman2019-06-191-0/+137
| | | | | | Patch by Abhishek Bhaskar. llvm-svn: 363820
* Change the way we output templates for JSON AST dumping and dump information ↵Aaron Ballman2019-06-194-56/+2448
| | | | | | | | about template arguments. Previously, we attempted to write out template parameters and specializations to their own array, but due to the architecture of the ASTNodeTraverser, this meant that other nodes were not being written out. This now follows the same behavior as the regular AST dumper and puts all the (correct) information into the "inner" array. When we correct the AST node traverser itself, we can revisit splitting this information into separate arrays again. llvm-svn: 363819
* Add test cases for dumping AST function decl nodes to JSON; NFC.Aaron Ballman2019-06-181-0/+1126
| | | | llvm-svn: 363709
* Add test cases for dumping AST decl nodes to JSON; NFC.Aaron Ballman2019-06-181-0/+1671
| | | | llvm-svn: 363699
* [clang] Add storage for APValue in ConstantExprGauthier Harnisch2019-06-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When using ConstantExpr we often need the result of the expression to be kept in the AST. Currently this is done on a by the node that needs the result and has been done multiple times for enumerator, for constexpr variables... . This patch adds to ConstantExpr the ability to store the result of evaluating the expression. no functional changes expected. Changes: - Add trailling object to ConstantExpr that can hold an APValue or an uint64_t. the uint64_t is here because most ConstantExpr yield integral values so there is an optimized layout for integral values. - Add basic* serialization support for the trailing result. - Move conversion functions from an enum to a fltSemantics from clang::FloatingLiteral to llvm::APFloatBase. this change is to make it usable for serializing APValues. - Add basic* Import support for the trailing result. - ConstantExpr created in CheckConvertedConstantExpression now stores the result in the ConstantExpr Node. - Adapt AST dump to print the result when present. basic* : None, Indeterminate, Int, Float, FixedPoint, ComplexInt, ComplexFloat, the result is not yet used anywhere but for -ast-dump. Reviewers: rsmith, martong, shafik Reviewed By: rsmith Subscribers: rnkovacs, hiraditya, dexonsmith, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D62399 llvm-svn: 363493
* For DR712: store on a DeclRefExpr whether it constitutes an odr-use.Richard Smith2019-06-115-34/+69
| | | | | | | Begin restructuring to support the forms of non-odr-use reference permitted by DR712. llvm-svn: 363086
* Factor out commonality between variable capture initialization andRichard Smith2019-06-022-17/+40
| | | | | | 'this' capture initialization. llvm-svn: 362317
* Add script to update OpenMP -ast-dump test expectations, and use it toRichard Smith2019-06-022-205/+205
| | | | | | | | | regenerate the test expectations. (Only two tests change, as a result of no longer matching the 0x in a pointer; the other tests were already excluding that.) llvm-svn: 362316
* Defer building 'this' captures until we have left the capturing regionRichard Smith2019-05-312-6/+4
| | | | | | | | | | and returned to the context in which 'this' should be captured. This means we now always mark 'this' referenced from the context in which it's actually referenced, rather than potentially from some context nested within that. llvm-svn: 362182
* Fix r361893 to also update a recently-added test.Richard Smith2019-05-281-163/+163
| | | | llvm-svn: 361895
* Defer creating fields for captures until we finish building theRichard Smith2019-05-281-7/+7
| | | | | | | | | | | | | | | capturing expression or statement. No functionality change yet. The intent is that we will also delay building the initialization expression until the enclosing context, so that: a) we build the initialization expression in the right context, and b) we can elide captures that are not odr-used, as suggested by P0588R1. This also consolidates some duplicated code building capture fields into a single place. llvm-svn: 361893
* [OpenMP] Set pragma start loc to `#pragma` locJoel E. Denny2019-05-2848-2653/+2653
| | | | | | | | | | | | | | | This patch adjusts `PragmaOpenMPHandler` to set the location of `tok::annot_pragma_openmp` to the `#pragma` location instead of the `omp` location so that the former becomes the start location of the OpenMP AST node. This can be useful when, for example, rewriting a directive using Clang's Rewrite facility. Most of this patch updates tests for changes to locations in diagnostics and `-ast-dump` output. Reviewed By: ABataev, lebedev.ri, Meinersbur, aaron.ballman Differential Revision: https://reviews.llvm.org/D61509 llvm-svn: 361867
* When dumping the AST to JSON, dump the type information from a typeid ↵Aaron Ballman2019-05-271-2/+11
| | | | | | expression with a type operand. llvm-svn: 361769
* When dumping the AST to JSON, dump whether a function is variadic or not.Aaron Ballman2019-05-271-0/+2
| | | | llvm-svn: 361768
* When dumping the AST to JSON, dump the declared name of a MemberExpr operand.Aaron Ballman2019-05-273-0/+13
| | | | llvm-svn: 361767
* When dumping the AST to JSON, dump the argument name to a sizeof pack ↵Aaron Ballman2019-05-271-1/+2
| | | | | | expression. llvm-svn: 361766
* Add test cases for dumping AST expression nodes to JSON; NFC.Aaron Ballman2019-05-271-0/+8992
| | | | llvm-svn: 361764
* Adding an explicit triple to this test to appease build bots.Aaron Ballman2019-05-241-1/+1
| | | | llvm-svn: 361662
* Add JSON dumping tests for ObjC statements; add support for dumping @catch ↵Aaron Ballman2019-05-241-0/+719
| | | | | | catch-all statements. llvm-svn: 361660
* Add support for dumping Objective C AST declaration nodes to JSON.Aaron Ballman2019-05-241-0/+1704
| | | | llvm-svn: 361652
* Do not use the incorrect attribute spelling list index when translating a ↵Aaron Ballman2019-05-211-0/+7
| | | | | | | | no_sanitize_foo attribute into a no_sanitize("foo") attribute. This fixes a crash when AST pretty printing declarations marked with no_sanitize_memory. llvm-svn: 361274
* Add support for dumping AST comment nodes to JSON.Aaron Ballman2019-05-211-0/+1492
| | | | llvm-svn: 361265
* Add more tests for AST JSON output; NFC.Aaron Ballman2019-05-201-0/+5427
| | | | | | This adds tests for dumping expressions in C. It also updates a comment to note an issue to be fixed with printing character literals discovered as part of this testing. llvm-svn: 361193
* Dump macro expansion information as needed when outputting the AST to JSON.Aaron Ballman2019-05-201-0/+179
| | | | llvm-svn: 361172
* Add more tests for AST JSON output; NFC.Aaron Ballman2019-05-173-0/+15152
| | | | | | This adds tests for dumping records and statements. llvm-svn: 361065
* Introduce the ability to dump the AST to JSON.Aaron Ballman2019-05-133-0/+1659
| | | | | | 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
* [clang] fixing -ast-print for variadic parameter pack in lambda captureNicolas Lesser2019-05-051-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: currently for: ``` template<typename ... T> void f(T... t) { auto l = [t...]{}; } ``` `clang -ast-print file.cpp` outputs: ``` template <typename ...T> void f(T ...t) { auto l = [t] { } ; } ``` notice that there is not `...` in the capture list of the lambda. this patch fixes this issue. and add test for it. Patch by Tyker Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61556 llvm-svn: 359980
* [Test] Remove obsolete test.Michael Kruse2019-04-161-21/+0
| | | | | | | | | | | | | | | | | | The FIXME of this test case has been addressed in r335084/r338800. Its execution still does not succeed because of multiple syntax errors. First, the "clang" namespace is missing on each of the 4 pragmas. Second, the pragma for defining the vector width is "vectorize_width(4)" instead of "vectorize(4)". Third, the pragma for defining the interleave factor is "interleave_count(8)" instead of "interleave(8)". The file was already using the wrong syntax when added in r210925 2014-06-13. The file ast-print-pragmas.cpp already checks for the correct pragma order, making this test redundant even if fixed. Differential Revision: https://reviews.llvm.org/D60749 llvm-svn: 358507
* Clean up ObjCPropertyDecl printingDavid Goldman2019-04-081-0/+22
| | | | | | | | | | | | | | | Summary: - `@property(attr, attr2)` instead of `@property ( attr,attr2 )`. - Change priority of attributes (see code/comments inline). - Support for printing weak and unsafe_unretained attributes. Subscribers: arphaman, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57965 llvm-svn: 357937
* [AST] Disable ast-dump-openmp-parallel-master-XFAIL.c testRoman Lebedev2019-03-201-0/+3
| | | | | | | | Fails on MSVC buildbot (but not locally). Not important as it is 'testing' something that isn't supported yet anyway: https://bugs.llvm.org/show_bug.cgi?id=41022 llvm-svn: 356577
OpenPOWER on IntegriCloud