summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Highlight the offending function parameter when the format argument refers ↵Aaron Ballman2014-08-041-5/+6
| | | | | | to an invalid function parameter type. llvm-svn: 214723
* Highlight the offending function parameter when the format_arg argument ↵Aaron Ballman2014-08-041-6/+4
| | | | | | refers to an invalid function parameter type. llvm-svn: 214722
* Dropping some else-after-returns. No functional changes intended.Aaron Ballman2014-08-011-7/+7
| | | | llvm-svn: 214526
* Improving diagnostic source ranges for the nonnull attribute. Now it ↵Aaron Ballman2014-08-011-9/+31
| | | | | | highlights the attribute and the faulty nonpointer type when possible. llvm-svn: 214507
* Implemented a diagnostic to handle multiple, distinct ownership_return ↵Aaron Ballman2014-07-311-2/+15
| | | | | | attributes on the same declaration. This removes a FIXME from the code. llvm-svn: 214436
* Removing an outdated FIXME. No functional changes.Aaron Ballman2014-07-311-4/+0
| | | | llvm-svn: 214411
* Automate attribute argument count semantic checking when there are variadic ↵Aaron Ballman2014-07-311-67/+43
| | | | | | | | or optional arguments present. With this, the only time you should have to manually check attribute argument counts is when HasCustomParsing is set to true, or when you have variadic arguments that aren't really variadic (like ownership_holds and friends). Updating the diagnostics in the launch_bounds test since they have been improved in that case. Adding a test for nonnull since it has little test coverage, but has truly variadic arguments. llvm-svn: 214407
* Improving the "integer constant too large" diagnostics based on post-commit ↵Aaron Ballman2014-07-241-1/+2
| | | | | | feedback from Richard Smith. Amends r213657. llvm-svn: 213865
* Improve the checkUInt32Argument() helper function so that it diagnoses ↵Aaron Ballman2014-07-221-0/+6
| | | | | | integer constants larger than 32-bits. llvm-svn: 213658
* Objective-C. Changes per A. Ballman's commentFariborz Jahanian2014-07-161-6/+7
| | | | | | for my last patch. // rdar://17631257 llvm-svn: 213185
* Objective-C. Introducing __attribute__((objc_runtime_name("runtimename"))Fariborz Jahanian2014-07-161-0/+14
| | | | | | | | | to be applied to class or protocols. This will direct IRGen for Objective-C metadata to use the new name in various places where class and protocol names are needed. rdar:// 17631257 llvm-svn: 213167
* Fix typosAlp Toker2014-07-141-1/+1
| | | | | | Also consolidate 'backward compatibility' llvm-svn: 212974
* The returns_nonnull attribute does not require a function prototype because ↵Aaron Ballman2014-07-111-1/+1
| | | | | | it affects only the return value, not any arguments. In turn, asking for a function or method result type should not require a function prototype either, so getFunctionOrMethodResultType has been relaxed. llvm-svn: 212827
* Switch over a few uses of param_begin() to parameters()Alp Toker2014-07-071-1/+1
| | | | llvm-svn: 212442
* Make FunctionDecl::getReturnTypeSourceRange() support non-builtin typesAlp Toker2014-07-021-9/+4
| | | | | | | Also document that the function is a "best-effort" facility to extract source ranges from limited AST type location info. llvm-svn: 212174
* MS ABI: Ignore dll attributes on partial template specializationsHans Wennborg2014-06-241-0/+7
| | | | llvm-svn: 211648
* Merge handleDLLImportAttr and handleDLLExportAttr into one function.Hans Wennborg2014-06-241-13/+6
| | | | llvm-svn: 211647
* Objective-C. Diagnose when property access is using declaredFariborz Jahanian2014-06-161-7/+12
| | | | | | | property accessor methods which have become deprecated or available. // rdar://15951801 llvm-svn: 211039
* Objective-C. Use isObjCRetainableType in my lastFariborz Jahanian2014-06-121-5/+3
| | | | | | patch. NFC. llvm-svn: 210795
* Objective-C. Accept '__attribute__((__ns_returns_retained__))' Fariborz Jahanian2014-06-111-1/+12
| | | | | | | for function/methods returning block in MRR mode as well. // rdar://17259812 llvm-svn: 210706
* Refactoring. Remove release and take methods from ActionResult. Rename ↵Nikola Smiljanic2014-05-291-2/+2
| | | | | | takeAs to getAs. llvm-svn: 209800
* [C++11] Use 'nullptr'. Sema edition.Craig Topper2014-05-261-39/+39
| | | | llvm-svn: 209613
* Don't suppress warning about dllimport on typedefs etc. in MicrosoftExt modeHans Wennborg2014-05-231-12/+0
| | | | | | | | | | | | | | | | | It's true the MSVC doesn't warn about dllimport when applied to e.g. a typedef, but that applies to dllexport too. I'd like us to be consistent, and I think the right thing to do is to warn. The original test that came with implementing the old behaviour doesn't provide a good motivation, and it said it was checking that we're not repoting an *error*, which is still true since this is just a warning. There are plenty of tests e.g. in Sema/dllimport.c to check that we do warn about dllimport on non functions or variables. Differential Revision: http://reviews.llvm.org/D3832 llvm-svn: 209546
* Implement the flatten attribute.Peter Collingbourne2014-05-201-0/+3
| | | | | | | | | | This is a GNU attribute that causes calls within the attributed function to be inlined where possible. It is implemented by giving such calls the alwaysinline attribute. Differential Revision: http://reviews.llvm.org/D3816 llvm-svn: 209217
* Implement the no_split_stack attribute.Peter Collingbourne2014-05-191-0/+3
| | | | | | | | | This is a GNU attribute that allows split stacks to be turned off on a per-function basis. Differential Revision: http://reviews.llvm.org/D3817 llvm-svn: 209167
* [OpenCL] Reject reqd_work_group_size(X, Y, Z) where X, Y or Z == 0.Joey Gouly2014-05-191-2/+9
| | | | | | Patch by Pedro Ferreira! llvm-svn: 209127
* Allow dllimport/dllexport on inline functions and adjust the linkage.Hans Wennborg2014-05-151-15/+0
| | | | | | | | This is a step towards handling these attributes on classes (PR11170). Differential Revision: http://reviews.llvm.org/D3772 llvm-svn: 208925
* Decouple ExprCXX.h and DeclCXX.h and clean up includes a bit.Benjamin Kramer2014-05-101-0/+1
| | | | | | | Required pulling LambdaExpr::Capture into its own header. No functionality change. llvm-svn: 208470
* Add support for __declspec(thread) under -fms-extensionsReid Kleckner2014-05-011-0/+22
| | | | | | | | Reviewers: rsmith Differential Revision: http://reviews.llvm.org/D3551 llvm-svn: 207734
* In preparation for being able to use simple Boolean logic expressions ↵Aaron Ballman2014-04-041-15/+41
| | | | | | 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
* Implement the 'optnone' attribute, which suppresses most optimizationsPaul Robinson2014-03-311-1/+24
| | | | | | on a function. llvm-svn: 205255
* Capability attributes can now be declared on a typedef declaration as well ↵Aaron Ballman2014-03-241-45/+60
| | | | | | 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
* Replacing the exclusive_lock_function, shared_lock_function and ↵Aaron Ballman2014-03-201-67/+6
| | | | | | | | 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
* [C++11] Replacing FunctionProtoType iterators param_type_begin() and ↵Aaron Ballman2014-03-171-4/+2
| | | | | | param_type_end() with iterator_range param_types(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 204045
* Objective-C. Allow objc_designated_initializer for private Fariborz Jahanian2014-03-141-1/+5
| | | | | | | initializers; but only those declared in class extensions (not in implementations). // rdar://16305347 llvm-svn: 203954
* [C++11] Replacing DeclBase iterators specific_attr_begin() and ↵Aaron Ballman2014-03-101-24/+14
| | | | | | specific_attr_end() with iterator_range specific_attrs(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203474
* [Sema] Fix assertion hit with #pragma weak.Argyrios Kyrtzidis2014-03-091-0/+2
| | | | | | rdar://16264844 llvm-svn: 203372
* [C++11] Replacing RecordDecl iterators field_begin() and field_end() with ↵Aaron Ballman2014-03-081-6/+4
| | | | | | iterator_range fields(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203355
* Reformatting the style used within the massive attribute semantic handling ↵Aaron Ballman2014-03-061-115/+245
| | | | | | | | 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
* Remove 2 dead 'break' statements. The 'break' usage in this switch is ↵Ted Kremenek2014-03-061-2/+0
| | | | | | inconsistent, making this hard to see. llvm-svn: 203079
* Capabilities are required to pass a name specifying what type of capability ↵Aaron Ballman2014-03-051-1/+9
| | | | | | | | 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
* Sema: Definition of dllimport globals is not allowedNico Rieck2014-02-261-9/+0
| | | | | | | Upgrades the warning to an error and clarifies the message by treating the definition as error instead of the attribute. llvm-svn: 202300
* Attr: Remove ForceInlineDavid Majnemer2014-02-251-2/+0
| | | | | | | | | | 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
* Reorganize and improve semantic tests for dllexport/importNico Rieck2014-02-221-2/+2
| | | | llvm-svn: 201947
* Exposing the noduplicate attribute within Clang, which marks functions so ↵Aaron Ballman2014-02-221-0/+2
| | | | | | | | that the optimizer does not duplicate code. Patch thanks to Marcello Maggioni! llvm-svn: 201941
* Per feedback from Aaron Ballman, push cast-to-ObjCProtocolDecl inside ↵Ted Kremenek2014-02-221-3/+3
| | | | | | handleObjCSuppresProtocolAttr(). llvm-svn: 201922
* Add requirement that attribute ↵Ted Kremenek2014-02-211-2/+8
| | | | | | 'objc_protocol_requires_explicit_implementation' can only be applied to protocol definitions. llvm-svn: 201899
* Adding role-based capability attributes that allow you to express role ↵Aaron Ballman2014-02-211-2/+66
| | | | | | | | 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
* DeLesley Hutchins (who wrote the original thread-safety attribute ↵Aaron Ballman2014-02-181-51/+44
| | | | | | | | | | | | | | | 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
* Sema: Restrict alignment to 2**28.David Majnemer2014-02-121-8/+6
| | | | | | | | Allowing alignment past this point causes wrap around within clang. N.B. GCC has the same restriction. llvm-svn: 201254
OpenPOWER on IntegriCloud