9 Commits

Author SHA1 Message Date
Matheus Izvekov
8c2574832e
Reland: [clang] improve print / dump of anonymous declarations (#124858) 2025-01-29 00:31:53 -03:00
Dmitri Gribenko
e38f4f6904 Revert "[clang] improve print / dump of anonymous declarations (#124605)"
This reverts commit f949f876daeda520a5b7dbeb2cbb35b8c4383acb.

This commit introduces an llvm_unreachable call that is actually
reachable. I posted a reproducer on the pull request discussion.
2025-01-28 17:07:26 +01:00
Matheus Izvekov
f949f876da
[clang] improve print / dump of anonymous declarations (#124605)
ast-print: A DeclRef to an anonymous NTTP will print
'value-parameter-DEPTH-INDEX',
similar to how type parameters are printed.

ast-dump: A bareDeclRef to an anonymous entity will print some extra
identifying information,
instead of an empty name, like indexes.
Falls back to source locations if nothing else is available.
2025-01-27 21:36:43 -03:00
Aaron Ballman
2ceee2f884 Add -Wno-strict-prototypes to C tests; NFC
This patch adds -Wno-strict-prototypes to all of the test cases that
use functions without prototypes, but not as the primary concern of the
test. e.g., attributes testing whether they can/cannot be applied to a
function without a prototype, etc.

This is done in preparation for enabling -Wstrict-prototypes by
default.
2022-02-24 15:30:30 -05:00
Aaron Ballman
059a335ee9 Store the calculated constant expression value into the ConstantExpr object
With https://reviews.llvm.org/D63376, we began storing the APValue
directly into the ConstantExpr object so that we could reuse the
calculated value later. However, it missed a case when not in C++11
mode but the expression is known to be constant.
2021-02-11 10:18:16 -05:00
Fangrui Song
96289ce633 [test] Fix unused check prefixes in test/AST 2020-10-31 21:46:45 -07:00
Bruno Ricci
ecbf2f5f3d
[clang][test][NFC] Also test for serialization in AST dump tests, part 2/n.
The outputs between the direct ast-dump test and the ast-dump test after
deserialization should match modulo a few differences.

For hand-written tests, strip the "<undeserialized declarations>"s and
the "imported"s with sed.

For tests generated with "make-ast-dump-check.sh", regenerate the
output.

Part 2/n.
2020-06-21 13:59:11 +01:00
Aaron Ballman
fc86a998a2 Added test cases for dumping variadic-like functions; NFC.
llvm-svn: 351355
2019-01-16 16:12:30 +00:00
Aaron Ballman
4b5b0c0025 Move AST tests into their own test directory; NFC.
This moves everything primarily testing the functionality of -ast-dump and -ast-print into their own directory, rather than leaving the tests spread around the testing directory.

llvm-svn: 348017
2018-11-30 18:43:02 +00:00