summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclPrinter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [ATTR] Automatic line feed after pragma-like attribute.Alexey Bataev2015-10-121-4/+42
| | | | | | | Automatically insert line feed after pretty printing of all pragma-like attributes + fix printing of pragma-like pragmas on declarations. Differential Revision: http://reviews.llvm.org/D13546 llvm-svn: 250017
* Fix printing of parameterized Objective-C interfaces.Bob Wilson2015-10-011-1/+1
| | | | | | This change was accidentally omitted from Doug's change in r241541. llvm-svn: 248975
* [OpenCL 2.0] Enable program scope variables, Section 6.5.1.Anastasia Stulova2015-09-301-1/+1
| | | | | | | | | | | | | | | | | | - Remove virtual SC_OpenCLWorkGroupLocal storage type specifier as it conflicts with static local variables now and prevents diagnosing static local address space variables correctly. - Allow static local and global variables (OpenCL2.0 s6.8 and s6.5.1). - Improve diagnostics of allowed ASes for variables in different scopes: (i) Global or static local variables have to be in global or constant ASes (OpenCL1.2 s6.5, OpenCL2.0 s6.5.1); (ii) Non-kernel function variables can't be declared in local or constant ASes (OpenCL1.1 s6.5.2 and s6.5.3). http://reviews.llvm.org/D13105 llvm-svn: 248906
* [DeclPrinter] Don't crash when printing a using decl with a special nameBenjamin Kramer2015-09-231-1/+1
| | | | | | Fixes PR24872. llvm-svn: 248376
* Implement variance for Objective-C type parameters.Douglas Gregor2015-07-071-0/+13
| | | | | | | | | | | | | | | Introduce co- and contra-variance for Objective-C type parameters, which allows us to express that (for example) an NSArray is covariant in its type parameter. This means that NSArray<NSMutableString *> * is a subtype of NSArray<NSString *> *, which is expected of the immutable Foundation collections. Type parameters can be annotated with __covariant or __contravariant to make them co- or contra-variant, respectively. This feature can be detected by __has_feature(objc_generics_variance). Implements rdar://problem/20217490. llvm-svn: 241549
* Parsing, semantic analysis, and AST for Objective-C type parameters.Douglas Gregor2015-07-071-5/+40
| | | | | | | | | | | | | | | | | | | | Produce type parameter declarations for Objective-C type parameters, and attach lists of type parameters to Objective-C classes, categories, forward declarations, and extensions as appropriate. Perform semantic analysis of type bounds for type parameters, both in isolation and across classes/categories/extensions to ensure consistency. Also handle (de-)serialization of Objective-C type parameter lists, along with sundry other things one must do to add a new declaration to Clang. Note that Objective-C type parameters are typedef name declarations, like typedefs and C++11 type aliases, in support of type erasure. Part of rdar://problem/6294649. llvm-svn: 241541
* Replace __double_underscored type nullability qualifiers with ↵Douglas Gregor2015-06-241-4/+3
| | | | | | | | | | | | | | | | _Uppercase_underscored Addresses a conflict with glibc's __nonnull macro by renaming the type nullability qualifiers as follows: __nonnull -> _Nonnull __nullable -> _Nullable __null_unspecified -> _Null_unspecified This is the major part of rdar://problem/21530726, but does not yet provide the Darwin-specific behavior for the old names. llvm-svn: 240596
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-221-1/+1
| | | | llvm-svn: 240353
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-221-1/+1
| | | | | | | | | | | | The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. llvm-svn: 240270
* Code completion for nullability type specifiers.Douglas Gregor2015-06-191-14/+2
| | | | | | Another part of rdar://problem/18868820. llvm-svn: 240159
* Implement the 'null_resettable' attribute for Objective-C properties.Douglas Gregor2015-06-191-2/+8
| | | | | | | | 'null_resettable' properties are those whose getters return nonnull but whose setters take nil, to "reset" the property to some default. Implements rdar://problem/19051334. llvm-svn: 240155
* Extend type nullability qualifiers for Objective-C.Douglas Gregor2015-06-191-8/+66
| | | | | | | | | | | | | | | Introduce context-sensitive, non-underscored nullability specifiers (nonnull, nullable, null_unspecified) for Objective-C method return types, method parameter types, and properties. Introduce Objective-C-specific semantics, including computation of the nullability of the result of a message send, merging of nullability information from the @interface of a class into its @implementation, etc . This is the Objective-C part of rdar://problem/18868820. llvm-svn: 240154
* [AST] There is no message for C++1z-style static_assertDavid Majnemer2015-06-051-2/+4
| | | | | | | | | | We would crash in the DeclPrinter trying to pretty-print the static_assert message. C++1z-style assertions don't have a message so we would crash. This fixes PR23756. llvm-svn: 239170
* Objective-C. Assortment of improvements pretty printingFariborz Jahanian2014-10-031-3/+12
| | | | | | | objective-C declarations, including printing of availability attributes on methods. llvm-svn: 219013
* Pretty print attributes associated with record declarations.Aaron Ballman2014-09-151-0/+6
| | | | llvm-svn: 217784
* AST printer: fix double space before base class with no access specifier.Richard Smith2014-07-231-2/+4
| | | | llvm-svn: 213719
* When pretty-printing a declaration of a pack, put the ellipsis before the nameRichard Smith2014-07-231-12/+18
| | | | | | | | 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
* Removing an "if (this == nullptr)" check from two print methods. The conditionRichard Trieu2014-06-091-1/+3
| | | | | | | 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. llvm-svn: 210498
* [C++11] Use 'nullptr'. AST edition.Craig Topper2014-05-121-18/+19
| | | | llvm-svn: 208517
* Use nullptr instead of 0 for const char * value.Yaron Keren2014-05-071-5/+5
| | | | llvm-svn: 208178
* [C++11] Replacing ClassTemplateDecl iterators spec_begin() and spec_end() ↵Aaron Ballman2014-03-141-4/+3
| | | | | | with iterator_range specializations(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203940
* [C++11] Replacing FunctionTemplateDecl iterators spec_begin() and spec_end() ↵Aaron Ballman2014-03-141-4/+3
| | | | | | with iterator_range specializations(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203938
* [C++11] Replacing ObjCImplementationDecl iterators ivar_begin() and ↵Aaron Ballman2014-03-141-3/+2
| | | | | | ivar_end() with iterator_range ivars(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203932
* [C++11] Replacing ObjCCategoryDecl iterators ivar_begin() and ivar_end() ↵Aaron Ballman2014-03-141-4/+2
| | | | | | with iterator_range ivars(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203924
* [C++11] Replacing ObjCInterfaceDecl iterators ivar_begin() and ivar_end() ↵Aaron Ballman2014-03-131-4/+4
| | | | | | with iterator_range ivars(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203849
* [C++11] Replacing CXXRecordDecl iterators init_begin() and init_end() with ↵Aaron Ballman2014-03-131-4/+1
| | | | | | iterator_range inits(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203819
* [C++11] Replacing ObjCMethodDecl iterators param_begin() and param_end() ↵Aaron Ballman2014-03-071-4/+3
| | | | | | with iterator_range params(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203255
* Pretty Printer: Print constexpr and ref qualifiers. Don't print return types ↵Benjamin Kramer2014-02-251-1/+15
| | | | | | on destructors. llvm-svn: 202181
* Reapply "Pretty Printer: Fix printing of conversion operator decls and calls."Benjamin Kramer2014-02-251-4/+6
| | | | | | There were many additional tests that had the bad behavior baked in. llvm-svn: 202174
* Revert "Pretty Printer: Fix printing of conversion operator decls and calls."Rafael Espindola2014-02-251-6/+4
| | | | | | | | This reverts commit r202167. It broke Analysis/auto-obj-dtors-cfg-output.cpp llvm-svn: 202173
* Pretty Printer: Fix printing of conversion operator decls and calls.Benjamin Kramer2014-02-251-4/+6
| | | | | | | | | | | | | - 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. llvm-svn: 202167
* Rename getResultType() on function and method declarations to getReturnType()Alp Toker2014-01-251-5/+6
| | | | | | | | | | | | | | | 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. llvm-svn: 200082
* Only mark dump() function definitions 'used' in debug buildsAlp Toker2014-01-041-1/+1
| | | | | | | | | | | | | | | | 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. llvm-svn: 198489
* Fixed a FIXME; created a print method for Selectors that accepts a ↵Aaron Ballman2014-01-031-4/+4
| | | | | | | | raw_ostream, and started using it in places it made sense. No functional changes intended, just API cleanliness. llvm-svn: 198428
* ASTContext: Declare builtin types implicitlyAlp Toker2013-12-151-11/+0
| | | | | | | | | | | | | | __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. llvm-svn: 197336
* Add an AdjustedType sugar node for adjusting calling conventionsReid Kleckner2013-12-051-2/+1
| | | | | | | | | | | | | | | | 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 llvm-svn: 196451
* [OPENMP] Improved variable lookup procedure for threadprivate variables.Alexey Bataev2013-09-261-2/+3
| | | | llvm-svn: 191416
* Fix pretty-printing for unnamed unions.Eli Friedman2013-08-121-0/+2
| | | | | | | This is just a couple of minor fixes to account for the existence of ElaboratedType. llvm-svn: 188209
* Improve clarity/consistency of a few UsingDecl methods and related helpers.Enea Zaffanella2013-07-221-1/+1
| | | | | | | | | | | | 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 llvm-svn: 186816
* Fixed source range of C++03 access declarations.Enea Zaffanella2013-07-171-2/+6
| | | | llvm-svn: 186522
* Improved source code fidelity for gcc mode attribute.Enea Zaffanella2013-06-201-5/+7
| | | | llvm-svn: 184417
* OpenMP threadprivate with qualified names.Alexey Bataev2013-05-131-2/+2
| | | | llvm-svn: 181683
* In VarDecl nodes, store the thread storage class specifier as written.Enea Zaffanella2013-05-041-4/+7
| | | | llvm-svn: 181113
* [documenting declaration]: Remove arc liftime qualifiersFariborz Jahanian2013-05-011-8/+8
| | | | | | | when doccumenting declrations in comments. // rdar://13757500 llvm-svn: 180880
* [ObjC declaration documentation] declaration of Fariborz Jahanian2013-05-011-8/+15
| | | | | | | | types involving Objective-C pointers must have their arc qualifiers elided as they don't add any additional info. // rdar://13757500. llvm-svn: 180860
* C++1y: Allow aggregates to have default initializers.Richard Smith2013-04-201-1/+1
| | | | | | | | | | | 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. llvm-svn: 179958
* Annotate flavor of TLS variable (statically or dynamically initialized) onto ↵Richard Smith2013-04-131-7/+18
| | | | | | the AST. llvm-svn: 179447
* Add 178663 back.Rafael Espindola2013-04-031-4/+4
| | | | | | | | | | | 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. llvm-svn: 178682
* Revert 178663.Rafael Espindola2013-04-031-4/+4
| | | | | | | | | | 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. llvm-svn: 178681
* Don't compute a patched/semantic storage class.Rafael Espindola2013-04-031-4/+4
| | | | | | | | | | | 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. llvm-svn: 178663
OpenPOWER on IntegriCloud