summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
Commit message (Collapse)AuthorAgeFilesLines
* ObjectiveC - Introducing objc_bridge_related attribute Fariborz Jahanian2013-12-041-0/+21
| | | | | | | | which specifies couple of (optional) method selectors for bridging a CFobject to or from an ObjectiveC object. This is wip. // rdsr://15499111 llvm-svn: 196408
* [objc] Introduce ObjCInterfaceDecl::getDesignatedInitializers() to get theArgyrios Kyrtzidis2013-12-031-2/+4
| | | | | | | | | | designated initializers of an interface. If the interface declaration does not have methods marked as designated initializers then the interface inherits the designated initializers of its super class. llvm-svn: 196315
* [objc] Introduce attribute 'objc_designated_initializer'.Argyrios Kyrtzidis2013-12-031-0/+25
| | | | | | It only applies to methods of init family in an interface declaration. llvm-svn: 196314
* Refactored the work group-related attributes to use a template, which ↵Aaron Ballman2013-12-021-33/+10
| | | | | | reduces the amount of duplicate code in the handler. No functional change intended. llvm-svn: 196165
* Simplifying a test for duplicate vec_type_hint attributes. The assert and ↵Aaron Ballman2013-12-021-5/+1
| | | | | | attribute kind test were superfluous. No functional change intended. llvm-svn: 196162
* The CUDA device attribute doesn't need custom logic to check the number of ↵Aaron Ballman2013-12-021-14/+2
| | | | | | attribute arguments (the common attribute handler already does this). Switching to use the simple attribute handler. No functional change intended. llvm-svn: 196155
* Automate attribute language option checking by specifying the list of ↵Aaron Ballman2013-12-021-155/+59
| | | | | | options to test in tablegen. llvm-svn: 196138
* Factored attribute mutual exclusion code into a helper function; split the ↵Aaron Ballman2013-12-021-35/+37
| | | | | | cf_audited_transfer and cf_unknown_transfer attributes into separate helper methods for simplicity. No functional changes intended. llvm-svn: 196126
* Re-enabled support for the Subjects for the weak attribute. This changes the ↵Aaron Ballman2013-12-021-19/+2
| | | | | | diagnostic involved to be more accurate -- for C++ code, it will now report that weak applies to variables, functions or classes. Added additional test case for this. llvm-svn: 196120
* The __w64 attribute handler was more generically named, but only applied to ↵Aaron Ballman2013-12-021-8/+4
| | | | | | __w64 specifically. Renamed and removed some unused code. No functional change intended. llvm-svn: 196116
* The FieldDecl is already covered by the ValueDecl case, so it is being removed.Aaron Ballman2013-12-021-2/+0
| | | | llvm-svn: 196110
* Switching the ibaction attribute handler to the generalized handler. No ↵Aaron Ballman2013-12-021-6/+2
| | | | | | functional change intended. llvm-svn: 196107
* Replacing custom subject application logic with table-generated logic. ↵Aaron Ballman2013-12-021-53/+2
| | | | | | Affects: guarded_var, pt_guarded_var, guarded_by, pt_guarded_by, acquired_after and acquired_before. No functional change intended. llvm-svn: 196105
* Refactored the tls_model attribute to use a custom subset subject. No ↵Aaron Ballman2013-11-291-6/+0
| | | | | | functional change intended. llvm-svn: 195964
* Using a custom subject to reenable the Subjects line for the ns_bridged ↵Aaron Ballman2013-11-291-6/+0
| | | | | | attribute. No functional change intended. llvm-svn: 195963
* Enables support for custom subject lists for attributes. As a testbed, uses ↵Aaron Ballman2013-11-291-10/+2
| | | | | | the custom subject for the ibaction attribute. llvm-svn: 195960
* Converts the lockable attributes to use the simple attribute handler because ↵Aaron Ballman2013-11-271-33/+2
| | | | | | the semantic checking was already automated. llvm-svn: 195866
* Automated checking for C++ when determining what argument to send to the ↵Aaron Ballman2013-11-271-16/+0
| | | | | | diagnostic for attribute subjects. In turn, this allows the Subjects to be enabled for some more attributes and improves diagnostics. Updated a test case based on the improved diagnostic. llvm-svn: 195864
* Adding the Subjects entry back for the noreturn attributes. This caused some ↵Aaron Ballman2013-11-271-19/+1
| | | | | | test cases to be updated because the original diagnostic was about applying to methods as well as functions, but the semantic checking disallowed methods. llvm-svn: 195862
* Enabling the subject list for the warn_unused attribute, and adding a test ↵Aaron Ballman2013-11-271-9/+1
| | | | | | case. Previously, would issue a "warning ignored" diagnostic instead of the more specific "only applies to." llvm-svn: 195851
* Adding in the subject for the init_priority attribute.Aaron Ballman2013-11-271-2/+2
| | | | llvm-svn: 195850
* Refactored semantic handlers that would unilaterally apply the attribute to ↵Aaron Ballman2013-11-271-161/+36
| | | | | | a Decl so they all go through a common interface. No functional change intended. llvm-svn: 195848
* Trivial fix: remove unused variableAlexander Kornienko2013-11-271-1/+0
| | | | llvm-svn: 195846
* Laying the basic groundwork for table generating the diagnostics for ↵Aaron Ballman2013-11-271-371/+29
| | | | | | | | | | | | attribute subjects. This makes some modifications to the way subjects are listed in Attr.td, and updates the attr emitter to handle the new constructs. I have disabled some attribute subject lines on purpose in Attr.td; this part is a WIP with the goal being to restore those subjects incrementally. By commenting them out, it leaves the original behavior the same as before for those attributes and so those are not functionality changes. llvm-svn: 195841
* Remove 'DistinctSpellings' support from Attr.td and change its only user toRichard Smith2013-11-271-26/+21
| | | | | | | | look at the attribute spelling instead. The 'ownership_*' attributes should probably be split into separate *Attr classes, but that's more than I wanted to do here. llvm-svn: 195805
* Replacing a custom diagnostic with a more standard one. No functional change ↵Aaron Ballman2013-11-261-3/+4
| | | | | | intended. llvm-svn: 195770
* Making type_tag_for_datatype consistent with its declared subject from ↵Aaron Ballman2013-11-251-0/+6
| | | | | | | | Attr.td. Also updated the related testcase. Reviewed by Dmitri Gribenko. llvm-svn: 195675
* SemaDeclAttr.cpp: Try to fix a warning [-Wunnamed-type-template-args]NAKAMURA Takumi2013-11-251-1/+1
| | | | llvm-svn: 195589
* Switching the common attribute over to using the generic diagnostic, and ↵Aaron Ballman2013-11-241-1/+2
| | | | | | removing the now-unused diagnostic. Updates a test case. llvm-svn: 195581
* __declspec(uuid) is only supported for C++ code according to MSDN (as well ↵Aaron Ballman2013-11-241-0/+14
| | | | | | as behaviorally in MSVC). This adds a generic diagnostic that we use for uuid, and can use for some other attributes as well, and adds a testcase. llvm-svn: 195580
* __declspec(uuid) is only allowed on a class according to MSDN; this makes ↵Aaron Ballman2013-11-241-0/+6
| | | | | | the semantic checking consistent with what the attribute specifies in Attr.td. Also adds a test case. llvm-svn: 195579
* Making some attribute diagnostics more consistent. Removes a newly-unused ↵Aaron Ballman2013-11-241-1/+7
| | | | | | | | diagnostic. Reviewed by Fariborz Jahanian llvm-svn: 195578
* Remove optional parameter bit from attribute ObjCSuppressProtocol.Ted Kremenek2013-11-231-2/+1
| | | | | | This refines some diagnostics and reduces some boilerplate checking logic. llvm-svn: 195560
* Add back experimental attribute objc_suppress_protocol_methods (slightly ↵Ted Kremenek2013-11-231-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | renamed). This is still an experimental attribute, but I wanted it in tree for review. It may still get yanked. This attribute can only be applied to a class @interface, not a class extension or category. It does not change the type system rules for Objective-C, but rather the implementation checking for Objective-C classes that explicitly conform to a protocol. During protocol conformance checking, clang recursively searches up the class hierarchy for the set of methods that compose a protocol. This attribute will cause the compiler to not consider the methods contributed by a super class, its categories, and those from its ancestor classes. Thus this attribute is used to force subclasses to redeclare (and hopefully re-implement) methods if they decide to explicitly conform to a protocol where some of those methods may be provided by a super class. This attribute intentionally leaves out properties, which are associated with state. This attribute only considers methods (at least right now) that are non-property accessors. These represent methods that "do something" as dictated by the protocol. This may be further refined, and this should be considered a WIP until documentation gets written or this gets removed. llvm-svn: 195533
* Whitespace. No functional change intended.Aaron Ballman2013-11-221-4/+4
| | | | llvm-svn: 195503
* ObjectiveC migrator. Improve on definition, useFariborz Jahanian2013-11-221-6/+2
| | | | | | | | and testing of objc_bridgmutable attribute per Aaron Ballman's comments. // rdar://15498044 llvm-svn: 195396
* ObjectiveC. Implement attribute 'objc_bridge_mutable'Fariborz Jahanian2013-11-211-0/+27
| | | | | | | | whose semantic is currently identical to objc_bridge, but their differences may manifest down the road with further enhancements. // rdar://15498044 llvm-svn: 195376
* Revert "Add new attribute 'objc_suppress_protocol' to suppress protocol ↵Ted Kremenek2013-11-211-28/+1
| | | | | | | | | | | conformance for a class." After implementing this patch, a few concerns about the language feature itself emerged in my head that I had previously not considered. I want to resolve those design concerns first before having a half-designed language feature in the tree. llvm-svn: 195328
* Add new attribute 'objc_suppress_protocol' to suppress protocol conformance ↵Ted Kremenek2013-11-211-1/+28
| | | | | | | | | | | | | | | | | | | | | | | for a class. The idea is to allow a class to stipulate that its methods (and those of its parents) cannot be used for protocol conformance in a subclass. A subclass is then explicitly required to re-implement those methods of they are present in the class marked with this attribute. Currently the attribute can only be applied to an @interface, and not a category or class extension. This is by design. Unlike protocol conformance, where a category can add explicit conformance of a protocol to class, this anti-conformance really needs to be observed uniformly by all clients of the class. That's because the absence of the attribute implies more permissive checking of protocol conformance. This unfortunately required changing method lookup in ObjCInterfaceDecl to take an optional protocol parameter. This should not slow down method lookup in most cases, and is just used for protocol conformance. llvm-svn: 195323
* Refactor some of handleObjCBridgeAttr to make it more concise and the ↵Ted Kremenek2013-11-211-8/+7
| | | | | | diagnostic reusable. llvm-svn: 195322
* Refactored integer argument checking code into a helper method. Removes a ↵Aaron Ballman2013-11-211-111/+61
| | | | | | considerable amount of duplicated code. llvm-svn: 195302
* Implemented DefaultIntArgument in the table generator and start using it in ↵Aaron Ballman2013-11-211-4/+4
| | | | | | semantic analysis. Removes some magic numbers. llvm-svn: 195287
* There is no such thing as __declspec(ms_struct), this is a GNU attribute. ↵Aaron Ballman2013-11-201-1/+2
| | | | | | Switched the attribute to have the proper spelling, gave it a subject, updated the warning to be more accurate, and updated the test case as appropriate. llvm-svn: 195277
* Removed a duplicate diagnostic related to attribute subjects for thread ↵Aaron Ballman2013-11-201-28/+22
| | | | | | safety annotations, and replaced it with the more general attribute diagnostic. Updated the test case in the one instance where wording changed. No functional change intended. llvm-svn: 195275
* Removing a custom error diagnostic and replacing it with a stock one. Added ↵Aaron Ballman2013-11-201-2/+4
| | | | | | a test case to ensure the diagnostic was firing properly. llvm-svn: 195188
* Switching some string literals to be generated by the AttributeList object ↵Aaron Ballman2013-11-191-5/+5
| | | | | | itself. llvm-svn: 195160
* bjectiveC. Use a uniform diagnostic forFariborz Jahanian2013-11-191-3/+7
| | | | | | 'objc_bridge' attribute. // rdar://15454846. llvm-svn: 195135
* ObjectiveC 'objc_bridging'. Assorment of improvements Fariborz Jahanian2013-11-191-1/+2
| | | | | | per Doug/Jordan comments. // rdar://15454846. llvm-svn: 195066
* ObjectiveC ARC. Adopt objc_bridge attributeFariborz Jahanian2013-11-191-33/+1
| | | | | | | on struct/union/class instead of typedef of such types. // rdar://15454846 llvm-svn: 195061
* ObjectiveC ARC. Only briding of pointer to struct CF object is allowed.Fariborz Jahanian2013-11-151-3/+8
| | | | | | | Improve on wording on illegal objc_bridge argumment. // rdar://15454846 llvm-svn: 194881
OpenPOWER on IntegriCloud