summaryrefslogtreecommitdiffstats
path: root/clang/unittests/AST/DeclPrinterTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [AST] Use written names instead of `type-param-0-0` in more cases when ↵Sam McCall2019-11-151-2/+1
| | | | | | | | | | | | | | | | | | | printing types and decls. Summary: This doesn't cover decls in diagnostics, which use NamedDecl::getNameForDiagnostic(). (That should also be fixed later I think). This covers some cases of https://github.com/clangd/clangd/issues/76 (hover, but not outline or sighelp) Reviewers: hokein Subscribers: ilya-biryukov, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70236
* 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
* [DeclPrinter] Allow printing fully qualified name of function declarationSerge Pavlov2017-11-231-4/+47
| | | | | | | | | | | When requesting a tooltip for a function call in an IDE, the fully qualified name helps to remove ambiguity in the function signature. Patch by Nikolai Kosjar! Differential Revision: https://reviews.llvm.org/D40013 llvm-svn: 318896
* [DeclPrinter] Honor TerseOutput for constructorsAlex Lorenz2017-11-161-16/+44
| | | | | | | | Patch by Nikolai Kosjar! Differential Revision: https://reviews.llvm.org/D39957 llvm-svn: 318365
* ASTPrinter: Objective-C method declarations don't need a space afterAlex Lorenz2017-06-021-1/+1
| | | | | | | | the return type rdar://32332039 llvm-svn: 304553
* Remove deprecated methods ast_matchers::BoundNodes::{getStmtAs,getDeclAs}Alexander Kornienko2016-12-131-1/+1
| | | | llvm-svn: 289543
* Make output of -ast-print a valid C++ code.Serge Pavlov2016-11-101-94/+30
| | | | | | | | | | | | | | | | | | Output generated by option -ast-print looks like C/C++ code, and it really is for plain C. For C++ the produced output was not valid C++ code, but the differences were small. With this change the output is fixed and can be compiled. Tests are changed so that output produced by -ast-print is compiled again with the same flags and both outputs are compared. Option -ast-print is extensively used in clang tests but it itself was tested poorly, existing tests only checked that compiler did not crash. There are unit tests in file DeclPrinterTest.cpp, but they test only terse output mode. Differential Revision: https://reviews.llvm.org/D26452 llvm-svn: 286439
* Rename AST node matchers to match the AST node names directly. Part of this ↵Aaron Ballman2015-09-171-23/+23
| | | | | | 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
* Move a test from static-assert.cpp to DeclPrinterTestDavid Majnemer2015-06-051-0/+18
| | | | | | | | 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
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix Reviewers: dblaikie Reviewed By: dblaikie Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D8926 llvm-svn: 234678
* AST printer: fix double space before base class with no access specifier.Richard Smith2014-07-231-6/+6
| | | | llvm-svn: 213719
* When pretty-printing a declaration of a pack, put the ellipsis before the nameRichard Smith2014-07-231-12/+11
| | | | | | | | being declared, not at the end. When pretty-printing a non-type template parameter, put the name of the parameter in the middle of the type, not at the end. llvm-svn: 213718
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-071-1/+2
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
* Decl printing: add tests for typedefsDmitri Gribenko2014-03-031-0/+34
| | | | | | Patch by Konrad Kleine. llvm-svn: 202709
* Add a StmtPrinter test for implicit and explicit conversion operator calls.Benjamin Kramer2014-02-261-0/+1
| | | | | | Put back a comment that I removed too aggressively. llvm-svn: 202255
* Pretty Printer: Print constexpr and ref qualifiers. Don't print return types ↵Benjamin Kramer2014-02-251-14/+10
| | | | | | on destructors. llvm-svn: 202181
* Reapply "Pretty Printer: Fix printing of conversion operator decls and calls."Benjamin Kramer2014-02-251-6/+3
| | | | | | There were many additional tests that had the bad behavior baked in. llvm-svn: 202174
* clang/unittests/AST,ASTMatchers: Remove _MSC_VER.NAKAMURA Takumi2014-02-161-3/+14
| | | | llvm-svn: 201485
* unittests: explicit stringify StringRefs for conversionSaleem Abdulrasool2014-01-251-3/+4
| | | | | | | | | When clang is built outside of the LLVM tree (against a corresponding version), there is no definition providing for operator<<(std::ostream &, StringRef) which is required for the assertion routines in google-test tests. Avoid the compilation failure by explicitly stringifying the StringRef prior to use. llvm-svn: 200096
* When formatting a C++-only declaration name, enable C++ mode in the formatter'sRichard Smith2014-01-221-1/+1
| | | | | | | | | language options. This is not really ideal -- we should require the right language options to be passed in, or not require language options to format a name -- but it fixes a number of *obviously* wrong formattings. Patch by Olivier Goffart! llvm-svn: 199778
* Switch to ssize_t from size_t to unbreak windows builders.David Majnemer2014-01-141-3/+3
| | | | | | | Builders that have -fms-compatibility on by default define size_t implicitly. Tests that provide conflicting definitions would cause unintended failures. llvm-svn: 199195
* Provide couple of DeclPrint tests for my last patch.Fariborz Jahanian2012-12-201-0/+18
| | | | llvm-svn: 170635
* Audit DeclPrinter with -ast-dump on Cocoa.h andFariborz Jahanian2012-12-191-1/+1
| | | | | | | | | fix any bad objectiveC syntax coming out of DeclPrinter. This is on going. Also, introduce a new PrintPolicy and use it as needed when declaration tag is to be produced via DeclPrinter. llvm-svn: 170606
* This is the libclang patch providing minimal API toFariborz Jahanian2012-12-181-1/+1
| | | | | | | | | | use clang's formatter. Currently, formatter is used to format declaration tags for xml comments. Since formatter is in flux and its change will break several of the clang comment tests, only a single tests is formatted using this facility. Doug has reviewed and approved it for check-in. llvm-svn: 170467
* PR14558: Compute triviality of special members (etc) at the end of the classRichard Smith2012-12-111-2/+1
| | | | | | | | | definition, rather than at the end of the definition of the set of nested classes. We still defer checking of the user-specified exception specification to the end of the nesting -- we can't check that until we've parsed the in-class initializers for non-static data members. llvm-svn: 169805
* In DeclPrint add printing of '= default'Fariborz Jahanian2012-12-051-2/+2
| | | | | | in constructors. llvm-svn: 169440
* In DeclPrint add printing of 'explicit'Fariborz Jahanian2012-12-051-2/+1
| | | | | | constructors. llvm-svn: 169435
* fix comment.Fariborz Jahanian2012-12-051-1/+1
| | | | llvm-svn: 169413
* Testing C++ declarations embedded inFariborz Jahanian2012-12-051-18/+11
| | | | | | | | | <declaration> tag of Comment XML. Added DeclPrint support for constructors and fix tests accordingly. This is wip. // rdar://12378714 llvm-svn: 169412
* Patch for decl printer test of objective-c methods.Fariborz Jahanian2012-10-181-6/+36
| | | | | | Patch by Dmitri Gribenko. llvm-svn: 166209
* DeclPrinter tests: simplify the code by using the new runToolOnCodeWithArgsDmitri Gribenko2012-08-311-27/+10
| | | | | | function from Tooling. llvm-svn: 162976
* DeclPrinter tests: since now some platforms use C++11 by default, make itDmitri Gribenko2012-08-311-105/+97
| | | | | | explicitly visible in test cases which language variant is used. llvm-svn: 162974
* Reland r160052: Default to -std=c++11 on Windows.Nico Weber2012-08-301-0/+2
| | | | | | Also update the tests that rely on c++98 to explicitly mention that. llvm-svn: 162890
* ASTTests: Suppress TestCXXConstructorDecl11 on msvc for now. It seems ↵NAKAMURA Takumi2012-08-251-1/+2
| | | | | | incompatible. llvm-svn: 162631
* Use LLVM's plugin registry to enable registering new compilationDaniel Jasper2012-08-241-1/+1
| | | | | | | databases. Move JSONCompilationDatabase.h to its own files and register it as plugin. llvm-svn: 162541
* Rename the ASTMatchers to better match AST nodes. Now, allDaniel Jasper2012-08-241-46/+46
| | | | | | | | | ASTMatchers have the same name as the corresponding AST nodes but are lower case. The only exceptions are the "CXX" prefixes which are not copied over to the matcher names as the goal is to actually remove these prefixes from the AST node names. llvm-svn: 162536
* DeclPrinter tests: mark test case we get wrong currently with WRONG.Dmitri Gribenko2012-08-241-1/+1
| | | | llvm-svn: 162512
* DeclPrinter tests: add two more tests.Dmitri Gribenko2012-08-241-0/+23
| | | | llvm-svn: 162511
* DeclPrinter, terse mode: don't print function bodiesDmitri Gribenko2012-08-211-17/+34
| | | | llvm-svn: 162294
* Rename PrintingPolicy::DontRecurseInDeclContext to PrintingPolicy::TerseOutputDmitri Gribenko2012-08-211-1/+1
| | | | | | to reflect the intention, not the implementation. llvm-svn: 162293
* DeclPrinter: add terse output mode and lots of testsDmitri Gribenko2012-08-201-0/+1200
Add a flag PrintingPolicy::DontRecurseInDeclContext to provide "terse" output from DeclPrinter. The motivation is to use DeclPrinter to print declarations in user-friendly format, without overwhelming user with inner detail of the declaration being printed. Also add many tests for DeclPrinter. There are quite a few things that we print incorrectly: search for WRONG in DeclPrinterTest.cpp -- and these tests check our output against incorrect output, so that we can fix/refactor/rewrite the DeclPrinter later. llvm-svn: 162245
OpenPOWER on IntegriCloud