summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/AttributeList.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Rename attribute 'objc_suppress_autosynthesis' to ↵Ted Kremenek2012-01-041-1/+1
| | | | | | 'objc_disable_automatic_synthesis'. llvm-svn: 147567
* objc: introduce objc_suppress_autosynthesis class Fariborz Jahanian2012-01-031-0/+1
| | | | | | attributes for later use. llvm-svn: 147457
* Propagate __attribute__((returns_twice)) from C to IL.Rafael Espindola2011-10-031-1/+1
| | | | llvm-svn: 141002
* Add explicit attributes to mark functions as having had theirJohn McCall2011-09-301-0/+2
| | | | | | | | | | | 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/+1
| | | | | | | | | | | | | | 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
* Added basic parsing for all remaining attributes, thread safetyCaitlin Sadowski2011-07-281-0/+13
| | | | | | | analysis. This includes checking that the attributes are applied in the correct contexts and with the correct number of arguments. llvm-svn: 136383
* Added parsing for guarded_var, pt_guarded_var, lockable,Caitlin Sadowski2011-07-281-0/+5
| | | | | | scoped_lockable, and no_thread_safety_analysis attributes, all for thread safety analysis llvm-svn: 136364
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-1/+1
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Document the existing objc_precise_lifetime attribute.John McCall2011-07-221-0/+1
| | | | | | | | | 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
* objc-arc: Support objc_arc_weak_unavailable on thoseFariborz Jahanian2011-07-061-0/+1
| | | | | | | classes which are incompatible with weak references. // rdar://9693477 llvm-svn: 134522
* Rename objc_lifetime -> objc_ownership, and modify diagnostics to talk about ↵Argyrios Kyrtzidis2011-06-241-1/+1
| | | | | | | | 'ownership', not 'lifetime'. rdar://9477613. llvm-svn: 133779
* Automatic Reference Counting.John McCall2011-06-151-0/+5
| | | | | | | | | | 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
* Add ms_struct attribute on record typeeFariborz Jahanian2011-04-261-0/+1
| | | | | | (and ignore it for now) - wip. llvm-svn: 130224
* Implement ARM pcs attribute. Basically it's another way of calling ↵Anton Korobeynikov2011-04-141-0/+1
| | | | | | | | | | 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
* Insomniac refactoring: change how the parser allocates attributes so thatJohn McCall2011-03-241-33/+76
| | | | | | | | | AttributeLists do not accumulate over the lifetime of parsing, but are instead reused. Also make the arguments array not require a separate allocation, and make availability attributes store their stuff in augmented memory, too. llvm-svn: 128209
* Implement a new 'availability' attribute, that allows one to specifyDouglas Gregor2011-03-231-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Provide an attribute, objc_method_family, to allow the inferred familyJohn McCall2011-03-021-0/+1
| | | | | | | | | | of an Objective-C method to be overridden on a case-by-case basis. This is a higher-level tool than ns_returns_retained &c.; it lets users specify that not only does a method have different retain/release semantics, but that it semantically acts differently than one might assume from its name. This in turn is quite useful to static analysis. llvm-svn: 126839
* accept and ignore a few things for better OpenBSD compatibility,Chris Lattner2011-02-181-0/+1
| | | | | | patch by Amit Kulkarni! llvm-svn: 125944
* OpenCL: add support for __kernel, kernel keywords and EXTENSION,Peter Collingbourne2011-02-141-0/+1
| | | | | | FP_CONTRACT pragmas. Patch originally by ARM. llvm-svn: 125475
* Revert r124217 because it didn't catch the actual error case it was trying toJeffrey Yasskin2011-01-271-1/+0
| | | | | | | | | | catch: lock_guard(my_mutex); declares a variable instead of creating a temporary. llvm-svn: 124398
* Add an attribute to forbid temporary instances of a type. This allows classJeffrey Yasskin2011-01-251-0/+1
| | | | | | | | | | | | | | | authors to write class __attribute__((forbid_temporaries)) Name { ... }; when they want to force users to name all variables of the type. This protects people from doing things like creating a scoped_lock that only lives for a single statement instead of an entire scope. The warning produced by this attribute can be disabled by -Wno-forbid-temporaries. llvm-svn: 124217
* Add the ns_consumes_self, ns_consumed, cf_consumed, and ns_returns_autoreleasedJohn McCall2011-01-251-0/+4
| | | | | | attributes for the benefit of the static analyzer. llvm-svn: 124174
* Get rid of [[hiding]], [[override]] and [[base_check]].Anders Carlsson2011-01-231-2/+0
| | | | llvm-svn: 124087
* Get rid of the [[final]] C++0x attribute.Anders Carlsson2011-01-231-1/+0
| | | | llvm-svn: 124083
* Refactor how we collect attributes during parsing, and add slots for attributesJohn McCall2010-12-241-2/+2
| | | | | | | on array and function declarators. This is pretty far from complete, and I'll revisit it later if someone doesn't beat me to it. llvm-svn: 122535
* Add support for the Microsoft uuid attribute:Francois Pichet2010-12-191-0/+1
| | | | | | | | example: struct __declspec(uuid("6d5140c1-7436-11ce-8034-00aa006009fa")) test { }; llvm-svn: 122173
* Basic, Sema: add support for CUDA launch_bounds attributePeter Collingbourne2010-12-121-0/+1
| | | | llvm-svn: 121654
* Add support for the common and nocommon attributes.Eric Christopher2010-12-021-0/+2
| | | | | | rdar://8560647 llvm-svn: 120650
* Basic, Sema: add support for CUDA location attributesPeter Collingbourne2010-12-011-0/+5
| | | | llvm-svn: 120545
* Front-end support for __attribute__((may_alias)). This is notDan Gohman2010-11-171-1/+1
| | | | | | yet hooked up to anything yet. llvm-svn: 119407
* Add support for "neon_vector_type" and "neon_polyvector_type" attributesBob Wilson2010-11-161-0/+2
| | | | | | | | to create the special Neon vector types. These are intended to be used in Clang's version of <arm_neon.h> to define special Neon vector types that will be mangled according to ARM's ABI. llvm-svn: 119301
* Region-allocate all AttributeList objects from a factory object instead of ↵Ted Kremenek2010-11-101-17/+6
| | | | | | | | | | | | | | | | | | | | | | | | manually managing them using new/delete and OwningPtrs. After memory profiling Clang, I witnessed periodic leaks of these objects; digging deeper into the code, it was clear that our management of these objects was a mess. The ownership rules were murky at best, and not always followed. Worse, there are plenty of error paths where we could screw up. This patch introduces AttributeList::Factory, which is a factory class that creates AttributeList objects and then blows them away all at once. While conceptually simple, most of the changes in this patch just have to do with migrating over to the new interface. Most of the changes have resulted in some nice simplifications. This new strategy currently holds on to all AttributeList objects during the lifetime of the Parser object. This is easily tunable. If we desire to have more bound the lifetime of AttributeList objects more precisely, we can have the AttributeList::Factory object (in Parser) push/pop its underlying allocator as we enter/leave key methods in the Parser. This means that we get simple memory management while still having the ability to finely control memory use if necessary. Note that because AttributeList objects are now BumpPtrAllocated, we may reduce malloc() traffic in many large files with attributes. This fixes the leak reported in: <rdar://problem/8650003> llvm-svn: 118675
* fix http://llvm.org/PR8371 in the straightforward way, also adding a commentGabor Greif2010-10-151-0/+1
| | | | llvm-svn: 116570
* Add support for attribute((naked)), patch by Zoxc on cfe-commits!Daniel Dunbar2010-09-291-0/+1
| | | | | | - Minor style tweaks by me. llvm-svn: 115056
* Add symantic support for the Pascal calling convention viaDawn Perchik2010-09-031-0/+2
| | | | | | | "__attribute((pascal))" or "__pascal" (and "_pascal" under -fborland-extensions). Support still needs to be added to llvm. llvm-svn: 112939
* Abstract out passing around types and kill off ActionBase.John McCall2010-08-241-2/+2
| | | | llvm-svn: 111901
* Another step in the process of making the parser depend on Sema:John McCall2010-08-201-0/+134
- move DeclSpec &c into the Sema library - move ParseAST into the Parse library Reflect this change in a thousand different includes. Reflect this change in the link orders. llvm-svn: 111667
OpenPOWER on IntegriCloud