Aaron Ballman
7605072e61
In preparation for being able to use simple Boolean logic expressions involving capabilities, the semantics for attributes now looks through the types of the constituent parts of a capability expression instead of at the aggregate expression type.
...
llvm-svn: 205629
2014-04-04 15:13:57 +00:00
Paul Robinson
f067435026
Implement the 'optnone' attribute, which suppresses most optimizations
...
on a function.
llvm-svn: 205255
2014-03-31 22:29:15 +00:00
Aaron Ballman
69e6e7c604
Capability attributes can now be declared on a typedef declaration as well as a structure declaration. This allows for C code to use Boolean expressions on a capability as part of another attribute. Eg) __attribute__((requires_capability(!SomeCapability)))
...
llvm-svn: 204657
2014-03-24 19:29:19 +00:00
Aaron Ballman
18d85aed39
Replacing the exclusive_lock_function, shared_lock_function and unlock_function attributes with the acquire_capability and release_capability attributes. The old spellings will continue to work, but the underlying semantic attributes have been replaced.
...
Downgraded the capability diagnostics from error to warning to match the desired behavior, and updated the existing test cases.
llvm-svn: 204350
2014-03-20 16:02:49 +00:00
Aaron Ballman
40bd0aaf68
[C++11] Replacing FunctionProtoType iterators param_type_begin() and param_type_end() with iterator_range param_types(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 204045
2014-03-17 15:23:01 +00:00
Fariborz Jahanian
6efab6eed7
Objective-C. Allow objc_designated_initializer for private
...
initializers; but only those declared in class extensions
(not in implementations). // rdar://16305347
llvm-svn: 203954
2014-03-14 18:19:46 +00:00
Aaron Ballman
be22bcb180
[C++11] Replacing DeclBase iterators specific_attr_begin() and specific_attr_end() with iterator_range specific_attrs(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203474
2014-03-10 17:08:28 +00:00
Argyrios Kyrtzidis
0098a4bd04
[Sema] Fix assertion hit with #pragma weak.
...
rdar://16264844
llvm-svn: 203372
2014-03-09 05:15:28 +00:00
Aaron Ballman
e8a8baef44
[C++11] Replacing RecordDecl iterators field_begin() and field_end() with iterator_range fields(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203355
2014-03-08 20:12:42 +00:00
Aaron Ballman
8abdd0e090
Reformatting the style used within the massive attribute semantic handling switch statement, so now there is only one style used in this block of code, instead of three or more styles.
...
No functional change intended.
llvm-svn: 203120
2014-03-06 14:02:27 +00:00
Ted Kremenek
7bceca1fcf
Remove 2 dead 'break' statements. The 'break' usage in this switch is inconsistent, making this hard to see.
...
llvm-svn: 203079
2014-03-06 05:37:35 +00:00
Aaron Ballman
6c8100748f
Capabilities are required to pass a name specifying what type of capability is being annotated. There are currently only two supported names: mutex and role. Adding functionality to check for the capability name and diagnose when it's unexpected.
...
Note that for backwards compatibility, an unnamed capability will default to being a "mutex." This allows the deprecated lockable attribute to continue to function.
llvm-svn: 203012
2014-03-05 21:47:13 +00:00
Nico Rieck
8e9791f62c
Sema: Definition of dllimport globals is not allowed
...
Upgrades the warning to an error and clarifies the message by treating the
definition as error instead of the attribute.
llvm-svn: 202300
2014-02-26 21:27:13 +00:00
David Majnemer
67e541e1c8
Attr: Remove ForceInline
...
The __forceinline keyword's semantics are now recast as AlwaysInline and
the kw___forceinline token has its language mode set for KEYMS.
This preserves the semantics of the previous implementation but with
less duplication of code.
llvm-svn: 202131
2014-02-25 09:53:29 +00:00
Nico Rieck
6047866232
Reorganize and improve semantic tests for dllexport/import
...
llvm-svn: 201947
2014-02-22 19:47:30 +00:00
Aaron Ballman
7c19ab17c7
Exposing the noduplicate attribute within Clang, which marks functions so that the optimizer does not duplicate code.
...
Patch thanks to Marcello Maggioni!
llvm-svn: 201941
2014-02-22 16:59:24 +00:00
Ted Kremenek
438f8db6d5
Per feedback from Aaron Ballman, push cast-to-ObjCProtocolDecl inside handleObjCSuppresProtocolAttr().
...
llvm-svn: 201922
2014-02-22 01:06:05 +00:00
Ted Kremenek
27cfe10df8
Add requirement that attribute 'objc_protocol_requires_explicit_implementation' can only be applied to protocol definitions.
...
llvm-svn: 201899
2014-02-21 22:49:04 +00:00
Aaron Ballman
9e9d184133
Adding role-based capability attributes that allow you to express role management: asserting a capability is held, acquiring a capability and releasing a capability. Also includes some skeleton documentation for these new attributes.
...
This functionality should be considered a WIP.
llvm-svn: 201890
2014-02-21 21:05:14 +00:00
Aaron Ballman
efe348ec44
DeLesley Hutchins (who wrote the original thread-safety attribute functionality) and I have agreed to start migrating from lock-specific terminology to "capability"-specific terminology. This opens the door for future threading-related analysis passes so that a common nomenclature can be used.
...
The following attributes have been (silently) deprecated, with their replacements listed:
lockable => capability
exclusive_locks_required => requires_capability
shared_locks_required => requires_shared_capability
locks_excluded => requires_capability
There are no functional changes intended.
llvm-svn: 201585
2014-02-18 17:36:50 +00:00
David Majnemer
abecae741c
Sema: Restrict alignment to 2**28.
...
Allowing alignment past this point causes wrap around within clang.
N.B. GCC has the same restriction.
llvm-svn: 201254
2014-02-12 20:36:10 +00:00
Jordan Rose
c939907a5a
'nonnull(1)' on a block parameter should apply to the block's argument.
...
Thanks to r199467, __attribute__((nonnull)) (without arguments) can apply
directly to parameters, instead of being applied to the whole function.
However, the old form of nonnull (with an argument index) could also apply
to the arguments of function and block pointers, and both of these can be
passed as parameters.
Now, if 'nonnull' with an argument is found on a parameter, /and/ the
parameter is a function or block pointer, it is handled the old way.
PR18795
llvm-svn: 201162
2014-02-11 17:27:59 +00:00
David Majnemer
4bb0980d96
MS ABI: Add support for #pragma pointers_to_members
...
Introduce a notion of a 'current representation method' for
pointers-to-members.
When starting out, this is set to 'best case' (representation method is
chosen by examining the class, selecting the smallest representation
that would work given the class definition or lack thereof).
This pragma allows the translation unit to dictate exactly what
representation to use, similar to how the inheritance model keywords
operate.
N.B. PCH support is forthcoming.
Differential Revision: http://llvm-reviews.chandlerc.com/D2723
llvm-svn: 201105
2014-02-10 19:50:15 +00:00
David Majnemer
98c9ee2068
MS ABI: Don't be so hasty to judge an inheritance model
...
If we are in the middle of defining the class, don't attempt to
validate previously annotated declarations. We may not have seen base
specifiers or virtual method declarations yet.
llvm-svn: 200959
2014-02-07 00:43:07 +00:00
David Majnemer
2c4e00ac1c
Sema: Diagnose improper application of inheritance keywords
...
We would previously allow inappropriate inheritance keywords to appear
on class declarations. We would also allow inheritance keywords on
templates which were not fully specialized; this was divergent from
MSVC.
Differential Revision: http://llvm-reviews.chandlerc.com/D2585
llvm-svn: 200423
2014-01-29 22:07:36 +00:00
Aaron Ballman
54fe5eb8cb
Relaxing the alignment requirements for fields in a transparent_union. Emits the diagnostic only when subsequent alignments are more strict than the alignment required by the first field.
...
Fixes PR15134
llvm-svn: 200277
2014-01-28 01:47:34 +00:00
Alp Toker
42a16a67f5
Rename getResultLoc() too
...
Follow up to r200082.
Spotted by Dmitri
llvm-svn: 200105
2014-01-25 23:51:36 +00:00
Alp Toker
314cc81b8c
Rename getResultType() on function and method declarations to getReturnType()
...
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
2014-01-25 16:55:45 +00:00
Alp Toker
601b22c377
Correct various uses of 'argument' that in fact refer to function parameters
...
Cleanup only.
llvm-svn: 199773
2014-01-21 23:35:24 +00:00
Alp Toker
9cacbabd33
Rename FunctionProtoType accessors from 'arguments' to 'parameters'
...
Fix a perennial source of confusion in the clang type system: Declarations and
function prototypes have parameters to which arguments are supplied, so calling
these 'arguments' was a stretch even in C mode, let alone C++ where default
arguments, templates and overloading make the distinction important to get
right.
Readability win across the board, especially in the casting, ADL and
overloading implementations which make a lot more sense at a glance now.
Will keep an eye on the builders and update dependent projects shortly.
No functional change.
llvm-svn: 199686
2014-01-20 20:26:09 +00:00
Aaron Ballman
3f5f3e7949
Formatting cleanups; no functional changes.
...
llvm-svn: 199671
2014-01-20 16:15:55 +00:00
Aaron Ballman
f28e49931a
Fixing a typo (turned out to be harmless since the default priority values are the same between the two attributes).
...
llvm-svn: 199666
2014-01-20 15:22:57 +00:00
Aaron Ballman
05a63787a2
Since the diagnostics engine understands Attr objects, this code is no longer required -- we can just pass in the attribute directly.
...
llvm-svn: 199664
2014-01-20 15:06:09 +00:00
Aaron Ballman
fc1951c505
Making some minor improvements to r199626.
...
llvm-svn: 199663
2014-01-20 14:19:44 +00:00
Ted Kremenek
dbf62e3eee
Wire up basic parser/sema support for attribute 'returns_nonnull'.
...
This attribute is supported by GCC. More generally it should
probably be a type attribute, but this behavior matches 'nonnull'.
This patch does not include warning logic for checking if a null
value is returned from a function annotated with this attribute.
That will come in subsequent patches.
llvm-svn: 199626
2014-01-20 05:50:47 +00:00
Ted Kremenek
b5867121a7
These attributes are no longer "checker-specific."
...
llvm-svn: 199625
2014-01-20 05:50:41 +00:00
Ted Kremenek
9aedc159ef
Enhance attribute 'nonnull' to be applicable to parameters directly (infix).
...
This allows the following syntax:
void baz(__attribute__((nonnull)) const char *str);
instead of:
void baz(const char *str) __attribute__((nonnull(1)));
This also extends to Objective-C methods.
The checking logic in Sema is not as clean as I would like. Effectively
now we need to check both the FunctionDecl/ObjCMethodDecl and the parameters,
so the point of truth is spread in two places, but the logic isn't that
cumbersome.
Implements <rdar://problem/14691443>.
llvm-svn: 199467
2014-01-17 06:24:56 +00:00
Aaron Ballman
12b9f6535b
Factored some function-like type reasoning out of SemaDeclAttr and onto Decl itself. This allows for more declarative subjects in attribute tablegen where the attribute appertains to something function-like, but not strictly a FunctionDecl.
...
llvm-svn: 199387
2014-01-16 13:55:42 +00:00
Aaron Ballman
36a5350e51
Distinguish between attributes explicitly written at the request of the user, and attributes implicitly generated to assist in bookkeeping by the compiler. This is done so by table generating a CreateImplicit method for each attribute.
...
Additionally, remove the optional nature of the spelling list index when creating attributes. This is supported by table generating a Spelling enumeration when the spellings for an attribute are distinct enough to warrant it.
llvm-svn: 199378
2014-01-16 13:03:14 +00:00
Reid Kleckner
3a4c638900
Remove unused function to fix clang -Werror build
...
llvm-svn: 199230
2014-01-14 18:10:42 +00:00
Aaron Ballman
2689133805
Simplifying the OpenCL image attribute. It does not need a semantic integer parameter because the required information is encoded in the spelling. Added an appropriate subject to the attribute, and simplified the semantic checking (which will likely be expanded upon in a future patch). Also, removed the GNU spelling since it was unsupported in the first place.
...
llvm-svn: 199229
2014-01-14 17:41:53 +00:00
DeLesley Hutchins
f28bbec90e
Consumed analysis: add two new attributes which fine-tune the behavior of
...
consumable objects. These are useful for implementing error codes that
must be checked. Patch also includes some significant refactoring, which was
necesary to implement the new behavior.
llvm-svn: 199169
2014-01-14 00:36:53 +00:00
Nick Lewycky
35a6ef4c35
Add a new attribute 'enable_if' which can be used to control overload resolution based on the values of the function arguments at the call site.
...
llvm-svn: 198996
2014-01-11 02:50:57 +00:00
Aaron Ballman
ab7691c4ce
Removing the notion of TargetAttributesSema and replacing it with one where the parsed attributes are responsible for knowing their target-specific nature, instead of letting Sema figure it out. This is necessary so that __has_attribute can eventually determine whether a parsed attribute applies to the given target or not.
...
llvm-svn: 198896
2014-01-09 22:48:32 +00:00
Aaron Ballman
b8c0adeac8
Treating the RegParmAttr as a TypeAttr because that is what it is.
...
Patch reviewed by Rafael Espindola.
llvm-svn: 198765
2014-01-08 13:23:01 +00:00
Aaron Ballman
2cfbc00506
Simplifying the mutual exclusion check now that the diagnostics engine knows how to handle Attr objects directly. Updates an associated test case due to the attribute name being properly quoted again.
...
llvm-svn: 198424
2014-01-03 16:23:46 +00:00
Aaron Ballman
3d216a579c
Removed an unnecessary %select from the alignas diagnostics. The attribute already knows how it was spelled.
...
llvm-svn: 198375
2014-01-02 23:39:11 +00:00
Aaron Ballman
1da282ae2d
Removing some more unnecessary manual quotes from attribute diagnostics. Updated the associated testcase because QualType pretty printing was an improvement.
...
llvm-svn: 198372
2014-01-02 23:15:58 +00:00
Aaron Ballman
9f6fec4419
Removing some more unnecessary manual quotes from attribute diagnostics.
...
llvm-svn: 198371
2014-01-02 23:02:01 +00:00
Aaron Ballman
05e420abad
Updated the wording of two attribute-related diagnostics so that they print the offending attribute name. Also updates the associated test cases.
...
llvm-svn: 198355
2014-01-02 21:26:14 +00:00
Aaron Ballman
2dfb03f362
Removed a string literal for a diagnostic, and updated the diagnostic to not manually quote. No functional changes intended.
...
llvm-svn: 198076
2013-12-27 16:30:46 +00:00
Aaron Ballman
3e424b5070
Teach the diagnostics engine about the Attr type to make reporting on semantic attributes easier (and not require hard-coded strings). This requires a getSpelling() function on the Attr class, which is table-driven. Updates a handful of cases where a hard-coded string was being used to test the functionality out. Updating associated test cases for the improved quoting.
...
llvm-svn: 198055
2013-12-26 18:30:57 +00:00
Aaron Ballman
88fe322053
Removed a string literal for an attribute name, which means the attribute name will be quoted in the diagnostic. Manually added some quotes to a diagnostic for consistency. Updated the test cases as appropriate.
...
llvm-svn: 198054
2013-12-26 17:30:44 +00:00
Aaron Ballman
cedaaea691
This diagnostic did not accept arguments, and did not have any test coverage. Parameterized the diagnostic, and made it more consistent with other attribute diagnostic wordings. Added test coverage.
...
Since this warning was generalized, it was also given a sensible warning group flag and the corresponding test was updated to reflect this.
llvm-svn: 198053
2013-12-26 17:07:49 +00:00
Aaron Ballman
faed0fa3d7
Simplifying some diagnostics so that they don't need to work with StringRefs. No functional changes intended.
...
llvm-svn: 198051
2013-12-26 16:30:30 +00:00
Aaron Ballman
190bad459c
Getting rid of a string literal in favor of the generalized diagnostic.
...
llvm-svn: 198050
2013-12-26 16:13:50 +00:00
Aaron Ballman
6828945dd2
No need for the manual quotes and extra getName() call. No functional changes intended.
...
llvm-svn: 198047
2013-12-26 15:06:01 +00:00
Aaron Ballman
553e68118f
Removing some unneeded code, and a diagnostic that was obsoleted. The type has already been determined to be a ValueDecl by virtue of the attribute subjects.
...
Added some test case coverage as well.
llvm-svn: 198046
2013-12-26 14:54:11 +00:00
Aaron Ballman
0390908588
Consolidating some mode attribute diagnostics. No functional changes intended.
...
llvm-svn: 197911
2013-12-23 15:23:11 +00:00
Aaron Ballman
888e935978
Removing the alloc_size attribute. The attribute was semantically handled, but silently ignored. Most of this feature was already reverted in June 2012 (r159016), this just cleans up the pieces left over.
...
llvm-svn: 197866
2013-12-21 17:15:13 +00:00
Aaron Ballman
bf7b1ee385
The const and nothrow attributes can be handled by the simple attribute handler. This removes a silent dropping of the attributes when they are duplicated on a Decl.
...
llvm-svn: 197864
2013-12-21 16:49:29 +00:00
Ted Kremenek
ec690e960e
Remove dead code identified by Aaron Ballman.
...
llvm-svn: 197730
2013-12-19 22:23:12 +00:00
Aaron Ballman
37c5f5da32
After discussing with John McCall, removing the ns_bridged attribute as it is unused.
...
llvm-svn: 197729
2013-12-19 22:12:51 +00:00
Aaron Ballman
9ead1243a5
Replacing calls to getAttr with calls to hasAttr for clarity. No functional change intended -- this only replaces Boolean uses of getAttr.
...
llvm-svn: 197648
2013-12-19 02:39:40 +00:00
Aaron Ballman
66039937e8
Added a comment about the launch_bounds attribute's AST node being required. Since there were no test cases for the attribute, some have been added. This promptly demonstrated a bug with the semantic handling, which is also fixed.
...
llvm-svn: 197637
2013-12-19 00:41:31 +00:00
Aaron Ballman
8edb5c2081
Refactor the Microsoft inheritance attribute handling so that it no longer has special treatment. Also fixes a minor bug where the attributes were being parsed as though they were GNU-style attributes when they were in fact keyword attributes.
...
llvm-svn: 197629
2013-12-18 23:44:18 +00:00
Ted Kremenek
b79ee57080
Implemented delayed processing of 'unavailable' checking, just like with 'deprecated'.
...
Fixes <rdar://problem/15584219> and <rdar://problem/12241361>.
This change looks large, but all it does is reuse and consolidate
the delayed diagnostic logic for deprecation warnings with unavailability
warnings. By doing so, it showed various inconsistencies between the
diagnostics, which were close, but not consistent. It also revealed
some missing "note:"'s in the deprecated diagnostics that were showing
up in the unavailable diagnostics, etc.
This change also changes the wording of the core deprecation diagnostics.
Instead of saying "function has been explicitly marked deprecated"
we now saw "'X' has been been explicitly marked deprecated". It
turns out providing a bit more context is useful, and often we
got the actual term wrong or it was not very precise
(e.g., "function" instead of "destructor"). By just saying the name
of the thing that is deprecated/deleted/unavailable we define
this issue away. This diagnostic can likely be further wordsmithed
to be shorter.
llvm-svn: 197627
2013-12-18 23:30:06 +00:00
Joey Gouly
2cd9db1cef
[OpenCL] Produce an error when the work group and vec type hint attributes
...
are used on non-kernel functions.
Reviewed by Aaron over IRC!
llvm-svn: 197243
2013-12-13 16:15:28 +00:00
Aaron Ballman
75a1729c4b
Added a Subjects clause to the section attribute and made its diagnostics more consistent with other attributes.
...
llvm-svn: 197104
2013-12-12 01:34:39 +00:00
Ted Kremenek
f41cf7f10f
Rename attribute 'objc_suppress_protocol_methods' to 'objc_protocol_requires_explicit_implementation'.
...
That's a mouthful, and not necessarily the final name. This also
reflects a semantic change where this attribute is now on the
protocol itself instead of a class. This attribute will require
that a protocol, when adopted by a class, is explicitly implemented
by the class itself (instead of walking the super class chain).
Note that this attribute is not "done". This should be considered
a WIP.
llvm-svn: 196955
2013-12-10 19:43:48 +00:00
Argyrios Kyrtzidis
e818681c88
Add a SubsetSubject in Attr.td to automate checking of where the objc_designated_initializer
...
attribute is acceptable.
llvm-svn: 196644
2013-12-07 06:08:04 +00:00
Aaron Ballman
ba0aea16e1
Turning the __w64 attribute into an ignored attribute to match other Microsoft extensions we do not currently support. Note that __w64 has been deprecated in MSVC since 2008.
...
llvm-svn: 196592
2013-12-06 18:56:03 +00:00
Fariborz Jahanian
1a2519a7e9
ObjectiveC - Introducing objc_bridge_related attribute
...
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
2013-12-04 20:32:50 +00:00
Argyrios Kyrtzidis
9ed9e5f31c
[objc] Introduce ObjCInterfaceDecl::getDesignatedInitializers() to get the
...
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
2013-12-03 21:11:30 +00:00
Argyrios Kyrtzidis
d1438b446e
[objc] Introduce attribute 'objc_designated_initializer'.
...
It only applies to methods of init family in an interface declaration.
llvm-svn: 196314
2013-12-03 21:11:25 +00:00
Aaron Ballman
1d0d2a48e7
Refactored the work group-related attributes to use a template, which reduces the amount of duplicate code in the handler. No functional change intended.
...
llvm-svn: 196165
2013-12-02 22:38:33 +00:00
Aaron Ballman
a9e0540c78
Simplifying a test for duplicate vec_type_hint attributes. The assert and attribute kind test were superfluous. No functional change intended.
...
llvm-svn: 196162
2013-12-02 22:16:55 +00:00
Aaron Ballman
f79ee2756d
The CUDA device attribute doesn't need custom logic to check the number of attribute arguments (the common attribute handler already does this). Switching to use the simple attribute handler. No functional change intended.
...
llvm-svn: 196155
2013-12-02 21:09:08 +00:00
Aaron Ballman
3aff633590
Automate attribute language option checking by specifying the list of options to test in tablegen.
...
llvm-svn: 196138
2013-12-02 19:30:36 +00:00
Aaron Ballman
fb76304f74
Factored attribute mutual exclusion code into a helper function; split the cf_audited_transfer and cf_unknown_transfer attributes into separate helper methods for simplicity. No functional changes intended.
...
llvm-svn: 196126
2013-12-02 18:05:46 +00:00
Aaron Ballman
604dfec8dc
Re-enabled support for the Subjects for the weak attribute. This changes the 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
2013-12-02 17:07:07 +00:00
Aaron Ballman
5010a76fe2
The __w64 attribute handler was more generically named, but only applied to __w64 specifically. Renamed and removed some unused code. No functional change intended.
...
llvm-svn: 196116
2013-12-02 16:17:55 +00:00
Aaron Ballman
7a47bb0397
The FieldDecl is already covered by the ValueDecl case, so it is being removed.
...
llvm-svn: 196110
2013-12-02 15:31:50 +00:00
Aaron Ballman
9beb517307
Switching the ibaction attribute handler to the generalized handler. No functional change intended.
...
llvm-svn: 196107
2013-12-02 15:13:14 +00:00
Aaron Ballman
e61b8b816a
Replacing custom subject application logic with table-generated logic. Affects: guarded_var, pt_guarded_var, guarded_by, pt_guarded_by, acquired_after and acquired_before. No functional change intended.
...
llvm-svn: 196105
2013-12-02 15:02:49 +00:00
Aaron Ballman
5b0481a398
Refactored the tls_model attribute to use a custom subset subject. No functional change intended.
...
llvm-svn: 195964
2013-11-29 16:20:30 +00:00
Aaron Ballman
f7cd09a047
Using a custom subject to reenable the Subjects line for the ns_bridged attribute. No functional change intended.
...
llvm-svn: 195963
2013-11-29 16:13:12 +00:00
Aaron Ballman
80469038c0
Enables support for custom subject lists for attributes. As a testbed, uses the custom subject for the ibaction attribute.
...
llvm-svn: 195960
2013-11-29 14:57:58 +00:00
Aaron Ballman
57ede3bd80
Converts the lockable attributes to use the simple attribute handler because the semantic checking was already automated.
...
llvm-svn: 195866
2013-11-27 19:35:27 +00:00
Aaron Ballman
17046b8506
Automated checking for C++ when determining what argument to send to the 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
2013-11-27 19:16:55 +00:00
Aaron Ballman
3a8e2d9136
Adding the Subjects entry back for the noreturn attributes. This caused some 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
2013-11-27 18:53:58 +00:00
Aaron Ballman
6a42b5a0c5
Enabling the subject list for the warn_unused attribute, and adding a test case. Previously, would issue a "warning ignored" diagnostic instead of the more specific "only applies to."
...
llvm-svn: 195851
2013-11-27 16:59:17 +00:00
Aaron Ballman
4a611153e1
Adding in the subject for the init_priority attribute.
...
llvm-svn: 195850
2013-11-27 16:34:09 +00:00
Aaron Ballman
6f9165a478
Refactored semantic handlers that would unilaterally apply the attribute to a Decl so they all go through a common interface. No functional change intended.
...
llvm-svn: 195848
2013-11-27 15:24:06 +00:00
Alexander Kornienko
b4586f4217
Trivial fix: remove unused variable
...
llvm-svn: 195846
2013-11-27 15:02:03 +00:00
Aaron Ballman
74eeeae3d3
Laying the basic groundwork for table generating the diagnostics for 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
2013-11-27 13:27:02 +00:00
Richard Smith
852e9ce3dd
Remove 'DistinctSpellings' support from Attr.td and change its only user to
...
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
2013-11-27 01:46:48 +00:00
Aaron Ballman
b0dc07419b
Replacing a custom diagnostic with a more standard one. No functional change intended.
...
llvm-svn: 195770
2013-11-26 16:14:15 +00:00
Aaron Ballman
90f8c6fb31
Making type_tag_for_datatype consistent with its declared subject from Attr.td. Also updated the related testcase.
...
Reviewed by Dmitri Gribenko.
llvm-svn: 195675
2013-11-25 18:50:49 +00:00
NAKAMURA Takumi
01d27f9705
SemaDeclAttr.cpp: Try to fix a warning [-Wunnamed-type-template-args]
...
llvm-svn: 195589
2013-11-25 00:52:29 +00:00