summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Thread safety analysis: downgraded requirement that mutex expressions refer ↵DeLesley Hutchins2012-04-061-21/+17
| | | | | | to a lockable type from error to warning. llvm-svn: 154198
* Added a new attribute, objc_root_class, which informs the compiler when a ↵Patrick Beard2012-04-061-0/+19
| | | | | | | | | root class is intentionally declared. The warning this inhibits, -Wobjc-root-class, is opt-in for now. However, all clang unit tests that would trigger the warning have been updated to use -Wno-objc-root-class. <rdar://problem/7446698> llvm-svn: 154187
* Minor cleanup in attribute-related diagnostics, from Alexander Kornienko!Douglas Gregor2012-03-141-14/+11
| | | | llvm-svn: 152725
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-4/+4
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Refactor Clang sema attribute handling.Michael Han2012-03-071-7/+7
| | | | | | | | | | | | | | | | | This submission improves Clang sema handling by using Clang tablegen to generate common boilerplate code. As a start, it implements AttributeList enumerator generation and case statements for AttributeList::getKind. A new field "SemaHandler" is introduced in Attr.td and by default set to 1 as most of attributes in Attr.td have semantic checking in Sema. For a small number of attributes that don't appear in Sema, the value is set to 0. Also there are a small number of attributes that only appear in Sema but not in Attr.td. Currently these attributes are still hardcoded in Sema AttributeList. Reviewed by Delesley Hutchins. llvm-svn: 152169
* objc: When issue diagnostic about deprecated method, alsoFariborz Jahanian2012-03-021-1/+8
| | | | | | | issue the note if it is because message is sent to a forward class declaration in delayed diagnostic. // rdar://10290322 llvm-svn: 151942
* Fix regression from llvm-gcc where we should NOT emit a warning about ↵Ted Kremenek2012-03-011-1/+8
| | | | | | __attribute__((NSObject)) on a property declaration. This is needed to have retain properties for non-object pointers. Fixes <rdar://problem/10930507>. llvm-svn: 151786
* Turned on support for __declspecs: noreturn, noinline, nothrow and naked in ↵Aaron Ballman2012-02-231-4/+13
| | | | | | MS compatibility mode. llvm-svn: 151295
* Turned on support for __declspec(deprecated) in MS compatibility mode.Aaron Ballman2012-02-231-1/+2
| | | | llvm-svn: 151225
* Thread safety analysis: Don't check for lockable on undefined types.DeLesley Hutchins2012-02-161-0/+3
| | | | llvm-svn: 150702
* In C++11 mode, when an integral constant expression is desired and we have aRichard Smith2012-02-041-5/+6
| | | | | | | | | | | | | | | | | | value of class type, look for a unique conversion operator converting to integral or unscoped enumeration type and use that. Implements [expr.const]p5. Sema::VerifyIntegerConstantExpression now performs the conversion and returns the converted result. Some important callers of Expr::isIntegralConstantExpr have been switched over to using it (including all of those required for C++11 conformance); this switch brings a side-benefit of improved diagnostics and, in several cases, simpler code. However, some language extensions and attributes have not been moved across and will not perform implicit conversions on constant expressions of literal class type where an ICE is required. In passing, fix static_assert to perform a contextual conversion to bool on its argument. llvm-svn: 149776
* Split Sema::MarkDeclarationReferenced into multiple functions; the ↵Eli Friedman2012-02-021-1/+1
| | | | | | additional entry points are needed to implement C++11 odr-use marking correctly. No functional change in this patch; I'll actually make the change which fixes the odr-use marking in a followup patch. llvm-svn: 149586
* Complain about attempts to use 'protected' visibility on targetsJohn McCall2012-01-291-3/+10
| | | | | | | | like Darwin that don't support it. We should also complain about invalid -fvisibility=protected, but that information doesn't seem to exist at the most appropriate time, so I've left a FIXME behind. llvm-svn: 149186
* Added source location for the template keyword in AST template-id expressions.Abramo Bagnara2012-01-271-1/+3
| | | | llvm-svn: 149127
* Remove redundant checks.Jean-Daniel Dupas2012-01-271-2/+1
| | | | llvm-svn: 149125
* Don't suppress access-control or invalid-type diagnostics from aJohn McCall2012-01-261-2/+4
| | | | | | | | | | | | | declarator just because we were able to build an invalid decl for it. The invalid-type diagnostics, in particular, are still useful to know, and may indicate something about why the decl is invalid. Also, recover from an illegal pointer/reference-to-unqualified-retainable type using __strong instead of __autoreleasing; in general, a random object is much more likely to be __strong, so this avoids unnecessary cascading errors in the most common case. llvm-svn: 149074
* The following patch adds __attribute__((no_address_safety_analysis)) which ↵Kostya Serebryany2012-01-241-0/+20
| | | | | | | | | | | | | | | will allow to disable address safety analysis (such as e.g. AddressSanitizer or SAFECode) for a specific function. When building with AddressSanitizer, add AddressSafety function attribute to every generated function except for those that have __attribute__((no_address_safety_analysis)). With this patch we will be able to 1. disable AddressSanitizer for a particular function 2. disable AddressSanitizer-hostile optimizations (such as some cases of load widening) when AddressSanitizer is on. llvm-svn: 148842
* Instantiate dependent attributes when instantiating templates.DeLesley Hutchins2012-01-201-7/+5
| | | | llvm-svn: 148592
* Remove unreachable code in Clang. (replace with llvm_unreachable where ↵David Blaikie2012-01-171-4/+2
| | | | | | appropriate or when GCC requires it) llvm-svn: 148292
* Remove unnecessary default cases in switches over enums.David Blaikie2012-01-171-2/+0
| | | | | | This allows -Wswitch-enum to find switches that need updating when these enums are modified. llvm-svn: 148281
* Minor refactoring of sentinel warning on blocks. Add a test for this warning.Eli Friedman2012-01-061-4/+5
| | | | llvm-svn: 147641
* After further discussion, rename attribute ↵Ted Kremenek2012-01-051-4/+4
| | | | | | 'objc_disable_automatic_synthesis' to 'objc_requires_property_definitions'. llvm-svn: 147622
* Rename attribute 'objc_suppress_autosynthesis' to ↵Ted Kremenek2012-01-041-1/+1
| | | | | | 'objc_disable_automatic_synthesis'. llvm-svn: 147567
* objc: diagnose misplacement of objc_suppress_autosynthesisFariborz Jahanian2012-01-031-0/+5
| | | | | | attribute. llvm-svn: 147490
* objc: introduce objc_suppress_autosynthesis class Fariborz Jahanian2012-01-031-0/+15
| | | | | | attributes for later use. llvm-svn: 147457
* objc: after issuing the warning on direct use of __attribute__((NSObject))Fariborz Jahanian2011-12-161-3/+1
| | | | | | on properties, prevent consequential error diagnostics. // rdar://10591336 llvm-svn: 146737
* Add ability to supply additional message to availability macros,Fariborz Jahanian2011-12-101-1/+8
| | | | | | // rdar://10095131 llvm-svn: 146304
* 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
OpenPOWER on IntegriCloud