summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Thread safety: Adding FIXMEs and a couple cleanupsCaitlin Sadowski2011-09-161-0/+1
| | | | llvm-svn: 139894
* Thread safety: cleaning up FIXME for trylocksCaitlin Sadowski2011-09-151-4/+4
| | | | llvm-svn: 139805
* Add the location of the interface reference to IBOutletCollectionAttr.Argyrios Kyrtzidis2011-09-131-2/+2
| | | | | | Depends on a llvm tablegen commit. llvm-svn: 139618
* Keep the source range of attributes. Depends on a llvm tablegen commit.Argyrios Kyrtzidis2011-09-131-113/+111
| | | | llvm-svn: 139600
* Record the full source range of an attribute.Argyrios Kyrtzidis2011-09-131-3/+3
| | | | llvm-svn: 139599
* Bring llvm.annotation* intrinsics support back to where it was in llvm-gcc: canJulien Lerouge2011-09-091-0/+8
| | | | | | | annotate global, local variables, struct fields, or arbitrary statements (using the __builtin_annotation), rdar://8037476. llvm-svn: 139423
* Clean up the sentinel-attribute checking code a lot. DocumentJohn McCall2011-09-091-8/+7
| | | | | | | | | | | | what 'nullPos' is supposed to mean, at least at this one site. Use closed forms for the arithmetic. Rip out some clever but ultimately pointless code that was trying to use 0 or 0L depending the size of a pointer vs. the size of int; first, it didn't work on LLP64 systems, and second, the sentinel checking code requires a pointer-typed value anyway, so this fixit would not have actually removed the warning. llvm-svn: 139361
* Thread safety: added support for function scopes in attribute arguments.Caitlin Sadowski2011-09-081-2/+6
| | | | | | This patch was written by DeLesley Hutchins. llvm-svn: 139302
* Make sure the FunctionDecl's created by "#pragma weak" have correct ↵Eli Friedman2011-09-071-8/+31
| | | | | | ParmVarDecl's. PR10878. llvm-svn: 139224
* Make helpers static, remove unused variables.Benjamin Kramer2011-09-031-4/+4
| | | | llvm-svn: 139078
* Extend the ASTContext constructor to delay the initialization ofDouglas Gregor2011-09-021-11/+11
| | | | | | | | builtin types (When requested). This is another step toward making ASTUnit build the ASTContext as needed when loading an AST file, rather than doing so after the fact. No actual functionality change (yet). llvm-svn: 138985
* Thread-safety analysis: adding in a basic lockset tracking system. ThisCaitlin Sadowski2011-08-231-50/+115
| | | | | | | | | | | | | | | | system flags an error when unlocking a lock which was not held, locking the same lock twice, having a different lockset on each iteration of a loop, or going out of scope while still holding a lock. In order to successfully use the lockset, this patch also makes sure that attribute arguments are attached correctly for later parsing. This patch was also worked on by DeLesley Hutchins. Note: This patch has been reviewed by Chandler Carruth and Jeffrey Yasskin. Feel free to provide post-commit review comments for a subsequent patch. llvm-svn: 138350
* Reflow code. No functionality change.Benjamin Kramer2011-08-191-7/+8
| | | | llvm-svn: 138032
* Update a comment to match the recently-changed codeDouglas Gregor2011-08-101-1/+1
| | | | llvm-svn: 137216
* For the availability attribute, allow a declaration to be deprecatedDouglas Gregor2011-08-101-3/+3
| | | | | | in the same version that it is introduced. Stuff happens. llvm-svn: 137214
* Thread Safety: Added basic argument parsing for all new attributes.Caitlin Sadowski2011-08-091-51/+160
| | | | | | | | | | | | This patch special cases the parser for thread safety attributes so that all attribute arguments are put in the argument list (instead of a special parameter) since arguments may not otherwise resolve correctly without two-token lookahead. This patch also adds checks to make sure that attribute arguments are lockable objects. llvm-svn: 137130
* Make helper functions static.Benjamin Kramer2011-08-021-6/+5
| | | | llvm-svn: 136679
* Added basic parsing for all remaining attributes, thread safetyCaitlin Sadowski2011-07-281-3/+227
| | | | | | | analysis. This includes checking that the attributes are applied in the correct contexts and with the correct number of arguments. llvm-svn: 136383
* Make Sema::WeakUndeclaredIdentifiers lazily deserialized.Douglas Gregor2011-07-281-9/+12
| | | | llvm-svn: 136368
* Added parsing for guarded_var, pt_guarded_var, lockable,Caitlin Sadowski2011-07-281-0/+110
| | | | | | scoped_lockable, and no_thread_safety_analysis attributes, all for thread safety analysis llvm-svn: 136364
* Add support for C++0x unicode string and character literals, from Craig Topper!Douglas Gregor2011-07-271-6/+6
| | | | llvm-svn: 136210
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-16/+16
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Document the existing objc_precise_lifetime attribute.John McCall2011-07-221-0/+30
| | | | | | | | | Introduce and document a new objc_returns_inner_pointer attribute, and consume it by performing a retain+autorelease on message receivers when they're not immediately loaded from an object with precise lifetime. llvm-svn: 135764
* Style tweak to the more idiomatic 'assert(!bad_state())'.Chandler Carruth2011-07-111-3/+3
| | | | | | Patch by Caitlin Sadowski. llvm-svn: 134938
* Hoist the logic for checking the number of arguments to an attributeChandler Carruth2011-07-111-79/+48
| | | | | | | | into a static helper. Original patch by Caitlin Sadowski, style tweaks by me. llvm-svn: 134937
* objc-arc: Support objc_arc_weak_unavailable on thoseFariborz Jahanian2011-07-061-0/+15
| | | | | | | classes which are incompatible with weak references. // rdar://9693477 llvm-svn: 134522
* Move the Sema argument to all of the Sema-using helper functions inChandler Carruth2011-07-021-164/+162
| | | | | | | | | SemaDeclAttr to the first argument. This makes them follow the very consistent policy elsewhere in Sema for helper functions. Original patch by Caitlin Sadowski, with some tweaking by me. llvm-svn: 134290
* Rename static helpers to use 'camelCaseNames' per the new styleChandler Carruth2011-07-011-142/+142
| | | | | | | | recommendations before adding more of them. Patch by Caitlin Sadowski. llvm-svn: 134289
* Mechanical rename of 'd' Decl pointer parameters to 'D'. This is moreChandler Carruth2011-07-011-317/+317
| | | | | | | | | | conventional in the rest of Clang's codebase, and closer to the current style recommendations. It also makes the code more internally consistent as FD, VD, etc are used frequently for particular decl variables. Patch by Caitlin Sadowski. llvm-svn: 134288
* Fix an obvious typo in an attribute's diagnostics.Chandler Carruth2011-06-301-1/+1
| | | | | | | | | | | Patch by Caitlin Sadowski. Unfortunately, this attribute doesn't seem to have a single test. It is only mentioned in comments in one test, and as a string literal in a copy of some Clang code checked in as a test for the Indexer. =[ It dates from 2009 r74280 as part of OpenCL 1.0. llvm-svn: 134136
* Handle nonnull attribute with optional argument number onFariborz Jahanian2011-06-271-13/+18
| | | | | | | functions with arguments of transparent unions type. // rdar://9584012 llvm-svn: 133941
* objc-arc/mrc: Allow ns_returns_not_retained attribute on propertiesFariborz Jahanian2011-06-251-0/+2
| | | | | | | | | to turn off warning on those properties which follow Cocoa naming convention for retaining objects and yet they were not meant for such purposes. Also, perform consistancy checking for declared getters of such methods. // rdar://9636091 llvm-svn: 133849
* Only do delayed diagnostics if there were no errors when parsing the decl.Argyrios Kyrtzidis2011-06-241-1/+1
| | | | | | Fixes crash in http://llvm.org/PR10109 & rdar://9584039. llvm-svn: 133816
* Rename objc_lifetime -> objc_ownership, and modify diagnostics to talk about ↵Argyrios Kyrtzidis2011-06-241-3/+3
| | | | | | | | 'ownership', not 'lifetime'. rdar://9477613. llvm-svn: 133779
* Automatic Reference Counting.John McCall2011-06-151-4/+108
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Eliminate a 'default' case in template argument deduction, where weDouglas Gregor2011-06-151-1/+6
| | | | | | | | | | | | | | | | | | were just punting on template argument deduction for a number of type nodes. Most of them, obviously, didn't matter. As a consequence of this, make extended vector types (via the ext_vector_type attribute) actually work properly for several important cases: - If the attribute appears in a type-id (i.e, not attached to a typedef), actually build a proper vector type - Build ExtVectorType whenever the size is constant; previously, we were building DependentSizedExtVectorType when the size was constant but the type was dependent, which makes no sense at all. - Teach template argument deduction to handle ExtVectorType/DependentSizedExtVectorType. llvm-svn: 133060
* Don't add redundant FormatAttr, ConstAttr, or NoThrowAttr attributes,Douglas Gregor2011-06-151-3/+30
| | | | | | | either imlicitly (for builtins) or explicitly (due to multiple specification of the same attributes). Fixes <rdar://problem/9612060>. llvm-svn: 133045
* Add ms_struct attribute on record typeeFariborz Jahanian2011-04-261-0/+8
| | | | | | (and ignore it for now) - wip. llvm-svn: 130224
* "note" location of forward class used as receiver ofFariborz Jahanian2011-04-231-2/+4
| | | | | | | a 'deprecated' selector in the diagnostics for the selector. // rdar://9309223 llvm-svn: 130062
* ADT/Triple: Switch to using .isOSDarwin() predicate.Daniel Dunbar2011-04-191-2/+2
| | | | llvm-svn: 129823
* Support for C++11 (non-template) alias declarations.Richard Smith2011-04-151-8/+8
| | | | llvm-svn: 129567
* Improve diagnostics on GNU attributes by warning about attributes that ↵Ted Kremenek2011-04-151-11/+12
| | | | | | should have no arguments or parameters. Patch by Michael Han! llvm-svn: 129560
* Implement ARM pcs attribute. Basically it's another way of calling ↵Anton Korobeynikov2011-04-141-2/+49
| | | | | | | | | | convention selection (AAPCS or AAPCS+VFP), similar to fastcall / stdcall / whatevercall seen on x86. In particular, all library functions should always be AAPCS regardless of floating point ABI used. llvm-svn: 129534
* Extend the new 'availability' attribute with support for anDouglas Gregor2011-03-261-1/+3
| | | | | | | 'unavailable' argument, which specifies that the declaration to which the attribute appertains is unavailable on that platform. llvm-svn: 128329
* Teach DelayedDiagnostic to copy its string, rather than hope that theDouglas Gregor2011-03-231-1/+1
| | | | | | | string itself lives longer than the DelayedDiagnostic. Fixes a recent use-after-free regression due to my availability attribute work. llvm-svn: 128148
* Ignore weak_import on Objective-C property and method declarations onDouglas Gregor2011-03-231-4/+5
| | | | | | all platforms, not just darwin. Fixes the regression in this test case. llvm-svn: 128147
* Implement a new 'availability' attribute, that allows one to specifyDouglas Gregor2011-03-231-19/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | which versions of an OS provide a certain facility. For example, void foo() __attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6))); says that the function "foo" was introduced in 10.2, deprecated in 10.4, and completely obsoleted in 10.6. This attribute ties in with the deployment targets (e.g., -mmacosx-version-min=10.1 specifies that we want to deploy back to Mac OS X 10.1). There are several concrete behaviors that this attribute enables, as illustrated with the function foo() above: - If we choose a deployment target >= Mac OS X 10.4, uses of "foo" will result in a deprecation warning, as if we had placed attribute((deprecated)) on it (but with a better diagnostic) - If we choose a deployment target >= Mac OS X 10.6, uses of "foo" will result in an "unavailable" warning (in C)/error (in C++), as if we had placed attribute((unavailable)) on it - If we choose a deployment target prior to 10.2, foo() is weak-imported (if it is a kind of entity that can be weak imported), as if we had placed the weak_import attribute on it. Naturally, there can be multiple availability attributes on a declaration, for different platforms; only the current platform matters when checking availability attributes. The only platforms this attribute currently works for are "ios" and "macosx", since we already have -mxxxx-version-min flags for them and we have experience there with macro tricks translating down to the deprecated/unavailable/weak_import attributes. The end goal is to open this up to other platforms, and even extension to other "platforms" that are really libraries (say, through a #pragma clang define_system), but that hasn't yet been designed and we may want to shake out more issues with this narrower problem first. Addresses <rdar://problem/6690412>. As a drive-by bug-fix, if an entity is both deprecated and unavailable, we only emit the "unavailable" diagnostic. llvm-svn: 128127
* Add support for language-specific address spaces. On top of that,Peter Collingbourne2011-03-181-0/+1
| | | | | | | | | add support for the OpenCL __private, __local, __constant and __global address spaces, as well as the __read_only, _read_write and __write_only image access specifiers. Patch originally by ARM; language-specific address space support by myself. llvm-svn: 127915
* Fixed source range for all DeclaratorDecl's.Abramo Bagnara2011-03-081-1/+2
| | | | llvm-svn: 127225
* Don't hard-code these constants, or at least don't hard-code them so hard.John McCall2011-03-021-40/+60
| | | | llvm-svn: 126841
OpenPOWER on IntegriCloud