summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
Commit message (Collapse)AuthorAgeFilesLines
* objc: warn if NSObject attribute appears other than in a typedef.Fariborz Jahanian2011-11-291-0/+4
| | | | | | // rdar://10453342 llvm-svn: 145358
* Downgrade err_iboutlet_object_type to a warning. It was breaking a bunch of ↵Ted Kremenek2011-11-011-2/+2
| | | | | | code. We will reconsider promoting it back to an error later. llvm-svn: 143470
* Do not warn when weak-import attribute is applied to enumFariborz Jahanian2011-10-261-1/+1
| | | | | | | decl. in Darwin due to certain projects requirement. // rdar://10277579 llvm-svn: 143082
* Fix grammar for C++11 alignment specifiers, and add a few FIXMEs.Peter Collingbourne2011-10-231-0/+4
| | | | llvm-svn: 142760
* c++: support gcc's application of weak attribute onFariborz Jahanian2011-10-211-0/+4
| | | | | | | | | | | | | class declaration which forces any such class and any class that inherits from such a class to have their typeinfo symbols be marked as weak. // rdar://10246395 A test/CodeGenCXX/weak-extern-typeinfo.cpp M lib/Sema/SemaDeclCXX.cpp M lib/Sema/SemaDeclAttr.cpp M lib/CodeGen/CGRTTI.cpp llvm-svn: 142693
* objc: more changes in use of IBOutletCollection attribute.Fariborz Jahanian2011-10-181-3/+2
| | | | | | | 'Class' is disallowed as argument. If the argument is missing, NSObject is assumed. // rdar://10296078 llvm-svn: 142409
* Allow for annotate attributes after access specifiers. When suchErik Verbruggen2011-10-131-0/+16
| | | | | | attributes are found, propagate them to subsequent declarations. llvm-svn: 141861
* For the various CF and NS attributes, don't complain if the parameterDouglas Gregor2011-10-091-2/+6
| | | | | | or return types are dependent. Fixes PR9049. llvm-svn: 141518
* Rename TagDecl::isDefinition -> isCompleteDefinitionJohn McCall2011-10-071-1/+1
| | | | | | | for better self-documenting code, since the semantics are subtly different from getDefinition(). llvm-svn: 141355
* Implicitly assume that a ObjC category to an unavailable interface is also ↵Argyrios Kyrtzidis2011-10-061-0/+3
| | | | | | | | unavailable; only give an 'unavailable' error on the @implementation of the category. rdar://10234078 llvm-svn: 141335
* When using an unavailable/deprecated interface Foo inside Foo's ↵Argyrios Kyrtzidis2011-10-061-1/+1
| | | | | | | | interface/implementation don't emit unavailable errors. llvm-svn: 141334
* objc arc: Suppress certain arc diagnostics on unavailableFariborz Jahanian2011-10-031-0/+11
| | | | | | functions. // rdar://10186536 llvm-svn: 141037
* Propagate __attribute__((returns_twice)) from C to IL.Rafael Espindola2011-10-031-0/+20
| | | | llvm-svn: 141002
* Hey, maybe we shouldn't silently ignore decl attributesJohn McCall2011-10-011-0/+28
| | | | | | on declarators written as types. llvm-svn: 140931
* objc arc: allow objc_returns_inner_pointer on methods that return Fariborz Jahanian2011-09-301-1/+3
| | | | | | | a reference type, since inner reference is much like an inner pointer. // rdar://10139365 llvm-svn: 140880
* Add explicit attributes to mark functions as having had theirJohn McCall2011-09-301-0/+39
| | | | | | | | | | | CoreFoundation object-transfer properties audited, and add a #pragma to cause them to be automatically applied to functions in a particular span of code. This has to be implemented largely in the preprocessor because of the requirement that the region be entirely contained in a single file; that's hard to impose from the parser without registering for a ton of callbacks. llvm-svn: 140846
* Add an ns_bridged attribute, used to specify that a John McCall2011-09-291-0/+34
| | | | | | | | | | | | | | pointer to the annotated struct type can be used as an Objective-C object pointer. If an argument is given, the type is actually "toll-free bridged" to the specific type named there, rather than just to 'id'. For now, we cannot rely on all types being so annotated, and we'll always have to have exceptions for things like CFTypeRef (aka const void*), but this is clearly a good foundation for improving toolage in this area. llvm-svn: 140779
* Like IBOutletCollection, it only makes sense to apply the IBOutlet ↵Ted Kremenek2011-09-291-25/+31
| | | | | | annotation to Objective-C object types. Fixes <rdar://problem/10142685>. llvm-svn: 140778
* objc-arc: mark functions which return types which can't be dealt withFariborz Jahanian2011-09-261-1/+3
| | | | | | | in arc mode and are in system headers as unavailable. // rdar://10186625 llvm-svn: 140565
* Removing a bunch of dead returns/breaks after llvm_unreachables.David Blaikie2011-09-231-1/+0
| | | | llvm-svn: 140407
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-1/+1
| | | | llvm-svn: 140367
* ArrayRef-ifying Function/BlockDecl's setParamsDavid Blaikie2011-09-211-1/+1
| | | | llvm-svn: 140268
* Rename LangOptions::Microsoft to LangOptions::MicrosoftExt to make it clear ↵Francois Pichet2011-09-171-1/+1
| | | | | | | | that this flag must be used only for Microsoft extensions and not emulation; to avoid confusion with the new LangOptions::MicrosoftMode flag. Many of the code now under LangOptions::MicrosoftExt will eventually be moved under the LangOptions::MicrosoftMode flag. llvm-svn: 139987
* 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
OpenPOWER on IntegriCloud