summaryrefslogtreecommitdiff
path: root/lib/AST/DeclPrinter.cpp
Commit message (Collapse)AuthorAge
* Removing an "if (this == nullptr)" check from two print methods. The conditionRichard Trieu2014-06-09
| | | | | | | | will never be true in a well-defined context. The checking for null pointers has been moved into the caller logic so it does not rely on undefined behavior. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210498 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Use 'nullptr'. AST edition.Craig Topper2014-05-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208517 91177308-0d34-0410-b5e6-96231b3b80d8
* Use nullptr instead of 0 for const char * value.Yaron Keren2014-05-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208178 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replacing ClassTemplateDecl iterators spec_begin() and spec_end() ↵Aaron Ballman2014-03-14
| | | | | | with iterator_range specializations(). Updating all of the usages of the iterators with range-based for loops. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203940 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replacing FunctionTemplateDecl iterators spec_begin() and spec_end() ↵Aaron Ballman2014-03-14
| | | | | | with iterator_range specializations(). Updating all of the usages of the iterators with range-based for loops. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203938 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replacing ObjCImplementationDecl iterators ivar_begin() and ↵Aaron Ballman2014-03-14
| | | | | | ivar_end() with iterator_range ivars(). Updating all of the usages of the iterators with range-based for loops. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203932 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replacing ObjCCategoryDecl iterators ivar_begin() and ivar_end() ↵Aaron Ballman2014-03-14
| | | | | | with iterator_range ivars(). Updating all of the usages of the iterators with range-based for loops. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203924 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replacing ObjCInterfaceDecl iterators ivar_begin() and ivar_end() ↵Aaron Ballman2014-03-13
| | | | | | with iterator_range ivars(). Updating all of the usages of the iterators with range-based for loops. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203849 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replacing CXXRecordDecl iterators init_begin() and init_end() with ↵Aaron Ballman2014-03-13
| | | | | | iterator_range inits(). Updating all of the usages of the iterators with range-based for loops. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203819 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replacing ObjCMethodDecl iterators param_begin() and param_end() ↵Aaron Ballman2014-03-07
| | | | | | with iterator_range params(). Updating all of the usages of the iterators with range-based for loops. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203255 91177308-0d34-0410-b5e6-96231b3b80d8
* Pretty Printer: Print constexpr and ref qualifiers. Don't print return types ↵Benjamin Kramer2014-02-25
| | | | | | on destructors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202181 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply "Pretty Printer: Fix printing of conversion operator decls and calls."Benjamin Kramer2014-02-25
| | | | | | There were many additional tests that had the bad behavior baked in. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202174 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Pretty Printer: Fix printing of conversion operator decls and calls."Rafael Espindola2014-02-25
| | | | | | | | This reverts commit r202167. It broke Analysis/auto-obj-dtors-cfg-output.cpp git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202173 91177308-0d34-0410-b5e6-96231b3b80d8
* Pretty Printer: Fix printing of conversion operator decls and calls.Benjamin Kramer2014-02-25
| | | | | | | | | | | | | - Don't emit anything when we encounter a call to a conversion operator. "bar(a & b)" instead of "bar(a & b.operator int())" This preserves the semantics and is still idempotent if we print the AST multiple times. - Properly print declarations of conversion operators. "explicit operator bool();" instead of "bool operator _Bool();" PR18776. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202167 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename getResultType() on function and method declarations to getReturnType()Alp Toker2014-01-25
| | | | | | | | | | | | | | | A return type is the declared or deduced part of the function type specified in the declaration. A result type is the (potentially adjusted) type of the value of an expression that calls the function. Rule of thumb: * Declarations have return types and parameters. * Expressions have result types and arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200082 91177308-0d34-0410-b5e6-96231b3b80d8
* Only mark dump() function definitions 'used' in debug buildsAlp Toker2014-01-04
| | | | | | | | | | | | | | | | This has the dual effect of (1) enabling more dead-stripping in release builds and (2) ensuring that debug helper functions aren't stripped away in debug builds, as they're intended to be called from the debugger. Note that the attribute is applied to definitions rather than declarations in headers going forward because it's now conditional on NDEBUG: /// \brief Mark debug helper function definitions like dump() that should not be /// stripped from debug builds. Requires corresponding macro added in LLVM r198456. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198489 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed a FIXME; created a print method for Selectors that accepts a ↵Aaron Ballman2014-01-03
| | | | | | | | raw_ostream, and started using it in places it made sense. No functional changes intended, just API cleanliness. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198428 91177308-0d34-0410-b5e6-96231b3b80d8
* ASTContext: Declare builtin types implicitlyAlp Toker2013-12-15
| | | | | | | | | | | | | | __builtin_va_list and friends have been showing up where they shouldn't for way to long, making unwanted appearences in -ast-print, tooling and source level visitors and even the hello world tutorial on the clang website. This commit factors down the implicit typedef and record creation facilities to ensure they're marked implicit. Also fixes a unit test that was testing incorrect behaviour, and removes old hacks in the DeclPrinter that tried to skip implicit declarations manually. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197336 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an AdjustedType sugar node for adjusting calling conventionsReid Kleckner2013-12-05
| | | | | | | | | | | | | | | | Summary: In general, this type node can be used to represent any type adjustment that occurs implicitly without losing type sugar. The immediate use of this is to adjust the calling conventions of member function pointer types without breaking template instantiation. Fixes PR17996. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D2332 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196451 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Improved variable lookup procedure for threadprivate variables.Alexey Bataev2013-09-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191416 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix pretty-printing for unnamed unions.Eli Friedman2013-08-12
| | | | | | | This is just a couple of minor fixes to account for the existence of ElaboratedType. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188209 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve clarity/consistency of a few UsingDecl methods and related helpers.Enea Zaffanella2013-07-22
| | | | | | | | | | | | | | No functionality change. In Sema helper functions: * renamed isTypeName as HasTypenameKeyword In UsingDecl: * renamed get/setUsingLocation to get/setUsingLoc * renamed is/setTypeName as has/setTypename git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186816 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed source range of C++03 access declarations.Enea Zaffanella2013-07-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186522 91177308-0d34-0410-b5e6-96231b3b80d8
* Improved source code fidelity for gcc mode attribute.Enea Zaffanella2013-06-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184417 91177308-0d34-0410-b5e6-96231b3b80d8
* OpenMP threadprivate with qualified names.Alexey Bataev2013-05-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181683 91177308-0d34-0410-b5e6-96231b3b80d8
* In VarDecl nodes, store the thread storage class specifier as written.Enea Zaffanella2013-05-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181113 91177308-0d34-0410-b5e6-96231b3b80d8
* [documenting declaration]: Remove arc liftime qualifiersFariborz Jahanian2013-05-01
| | | | | | | | when doccumenting declrations in comments. // rdar://13757500 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180880 91177308-0d34-0410-b5e6-96231b3b80d8
* [ObjC declaration documentation] declaration of Fariborz Jahanian2013-05-01
| | | | | | | | | types involving Objective-C pointers must have their arc qualifiers elided as they don't add any additional info. // rdar://13757500. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180860 91177308-0d34-0410-b5e6-96231b3b80d8
* C++1y: Allow aggregates to have default initializers.Richard Smith2013-04-20
| | | | | | | | | | | | Add a CXXDefaultInitExpr, analogous to CXXDefaultArgExpr, and use it both in CXXCtorInitializers and in InitListExprs to represent a default initializer. There's an additional complication here: because the default initializer can refer to the initialized object via its 'this' pointer, we need to make sure that 'this' points to the right thing within the evaluation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179958 91177308-0d34-0410-b5e6-96231b3b80d8
* Annotate flavor of TLS variable (statically or dynamically initialized) onto ↵Richard Smith2013-04-13
| | | | | | the AST. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179447 91177308-0d34-0410-b5e6-96231b3b80d8
* Add 178663 back.Rafael Espindola2013-04-03
| | | | | | | | | | | http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb went back green before it processed the reverted 178663, so it could not have been the culprit. Revert "Revert 178663." This reverts commit 4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178682 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 178663.Rafael Espindola2013-04-03
| | | | | | | | | | Looks like it broke http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb Revert "Don't compute a patched/semantic storage class." This reverts commit 8f187f62cb0487d31bc4afdfcd47e11fe9a51d05. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178681 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't compute a patched/semantic storage class.Rafael Espindola2013-04-03
| | | | | | | | | | | For variables and functions clang used to store two storage classes. The one "as written" in the code and a patched one, which, for example, propagates static to the following decls. This apparently is from the days clang lacked linkage computation. It is now redundant and this patch removes it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178663 91177308-0d34-0410-b5e6-96231b3b80d8
* OpenMP threadprivate directive parsing and semantic analysisAlexey Bataev2013-03-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177705 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix empty declaration printing.Michael Han2013-02-25
| | | | | | | | | Don't print the semicolon when visiting an empty declaration because the semicolon will be printed as a terminator later. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176035 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Semantic analysis for empty-declaration and attribute-declaration.Michael Han2013-02-22
| | | | | | | | | | Introduce a new AST Decl node "EmptyDecl" to model empty-declaration. Have attributes from attribute-declaration appertain to the EmptyDecl node by creating the AST representations of these attributes and attach them to the EmptyDecl node so these attributes can be sema checked just as attributes attached to "normal" declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175900 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach -ast-print how to print trailing-return-types.Richard Smith2013-02-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175864 91177308-0d34-0410-b5e6-96231b3b80d8
* DeclPrinter: fix CXXConstructExpr printing with implicit default argumentDmitri Gribenko2013-02-03
| | | | | | | | | | | | | | | | | | | | | | | | This is an improvement of r173630, that handles the following case: struct VirualDestrClass { VirualDestrClass(int arg); virtual ~VirualDestrClass(); }; struct ConstrWithCleanupsClass { ConstrWithCleanupsClass(const VirualDestrClass& cplx = VirualDestrClass(42)); }; ConstrWithCleanupsClass cwcNoArg; That was printed as: ConstrWithCleanupsClass cwcNoArg(); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174296 91177308-0d34-0410-b5e6-96231b3b80d8
* Added outer template parameter lists to friend type AST nodes.Enea Zaffanella2013-01-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174050 91177308-0d34-0410-b5e6-96231b3b80d8
* Decl printer: fix CXXConstructExpr with implicit default argumentDmitri Gribenko2013-01-27
| | | | | | | Patch by Will Wilson. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173630 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixes couple of friend declaration -ast-print bugFariborz Jahanian2012-12-21
| | | | | | | | | | found by running -ast-print on all-std-headers.cpp which caused it to go into infinite loop. Now -ast-print prints all declarations found in all-std-headers.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170928 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement AST dumper for Decls.Alexander Kornienko2012-12-20
| | | | | | | | | | http://llvm-reviews.chandlerc.com/D52 Patch by Philip Craig! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170634 91177308-0d34-0410-b5e6-96231b3b80d8
* Audit DeclPrinter with -ast-dump on Cocoa.h andFariborz Jahanian2012-12-19
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170606 91177308-0d34-0410-b5e6-96231b3b80d8
* This is the libclang patch providing minimal API toFariborz Jahanian2012-12-18
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170467 91177308-0d34-0410-b5e6-96231b3b80d8
* Use @import rather than @__experimental_modules_import, since theDouglas Gregor2012-12-11
| | | | | | | latter is rather a mess to type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169919 91177308-0d34-0410-b5e6-96231b3b80d8
* More C++ testing of declarations embedded inFariborz Jahanian2012-12-06
| | | | | | | | | <declaration> tag of Comment XML and fixing DeclPrint of templates along the way - wip. //rdar://12378714 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169453 91177308-0d34-0410-b5e6-96231b3b80d8
* In DeclPrint add printing of '= default'Fariborz Jahanian2012-12-05
| | | | | | | in constructors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169440 91177308-0d34-0410-b5e6-96231b3b80d8
* In DeclPrint add printing of 'explicit'Fariborz Jahanian2012-12-05
| | | | | | | constructors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169435 91177308-0d34-0410-b5e6-96231b3b80d8
* Testing C++ declarations embedded inFariborz Jahanian2012-12-05
| | | | | | | | | | <declaration> tag of Comment XML. Added DeclPrint support for constructors and fix tests accordingly. This is wip. // rdar://12378714 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169412 91177308-0d34-0410-b5e6-96231b3b80d8
* Testing C++ declarations embedded inFariborz Jahanian2012-12-05
| | | | | | | | | <declaration> tag of Comment XML and added support for friend declaration printing. This is wip. // rdar://12378714 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169346 91177308-0d34-0410-b5e6-96231b3b80d8