summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Pretty up the wrong-number-of-arguments-for-attribute diagnostic byJohn McCall2011-03-021-14/+9
| | | | | | | using a custom plural form. Split out the range diagnostics as their own message. llvm-svn: 126840
* Provide an attribute, objc_method_family, to allow the inferred familyJohn McCall2011-03-021-0/+48
| | | | | | | | | | 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
* Use NestedNameSpecifierLoc within out-of-line variables, function, andDouglas Gregor2011-02-251-2/+2
| | | | | | | tag definitions. Also, add support for template instantiation of NestedNameSpecifierLocs. llvm-svn: 126470
* rework processing of unavailable and deprecated attributes to avoid Chris Lattner2011-02-241-25/+19
| | | | | | | unneeded allocation of an empty StringLiteral when these don't have a message. llvm-svn: 126364
* accept and ignore a few things for better OpenBSD compatibility,Chris Lattner2011-02-181-1/+2
| | | | | | patch by Amit Kulkarni! llvm-svn: 125944
* Step #2/N of __label__ support: keep pushing LabelDecl forward,Chris Lattner2011-02-171-2/+2
| | | | | | | | | | making them be template instantiated in a more normal way and make them handle attributes like other decls. This fixes the used/unused label handling stuff, making it use the same infrastructure as other decls. llvm-svn: 125771
* When parsing an out-of-line member function declaration, we must delayJohn McCall2011-02-141-30/+47
| | | | | | | | | | | | | | | | | | | | | | access-control diagnostics which arise from the portion of the declarator following the scope specifier, just in case access is granted by friending the individual method. This can also happen with in-line member function declarations of class templates due to templated-scope friend declarations. We were really playing fast-and-loose before with this sort of thing, and it turned out to work because *most* friend functions are in file scope. Making us delay regardless of context exposed several bugs with how we were manipulating delay. I ended up needing a concept of a context that's independent of the declarations in which it appears, and then I actually had to make some things save contexts correctly, but delay should be much cleaner now. I also encapsulated all the delayed-diagnostics machinery in a single subobject of Sema; this is a pattern we might want to consider rolling out to other components of Sema. llvm-svn: 125485
* OpenCL: add support for __kernel, kernel keywords and EXTENSION,Peter Collingbourne2011-02-141-0/+8
| | | | | | FP_CONTRACT pragmas. Patch originally by ARM. llvm-svn: 125475
* When checking the 'weak' and 'weakref' attributes, look for non-externalJohn McCall2011-02-081-21/+40
| | | | | | | linkage rather than the presence of the 'static' storage class specifier. Fixes rdar://problem/8814626. llvm-svn: 125126
* Downgrade error about attribute 'iboutlet' and 'ibaction' being applied to ↵Ted Kremenek2011-02-041-3/+3
| | | | | | anything but a instance method to a warning. llvm-svn: 124858
* Give OpaqueValueExpr a source location, because its source locationDouglas Gregor2011-01-281-1/+2
| | | | | | | | might be queried in places where we absolutely require a valid location (e.g., for template instantiation). Fixes some major brokenness in the use of __is_convertible_to. llvm-svn: 124465
* Revert r124217 because it didn't catch the actual error case it was trying toJeffrey Yasskin2011-01-271-20/+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/+20
| | | | | | | | | | | | | | | 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-15/+89
| | | | | | attributes for the benefit of the static analyzer. llvm-svn: 124174
* Get rid of [[hiding]], [[override]] and [[base_check]].Anders Carlsson2011-01-231-79/+0
| | | | llvm-svn: 124087
* Get rid of the [[final]] C++0x attribute.Anders Carlsson2011-01-231-32/+5
| | | | llvm-svn: 124083
* Sema: support for processing non-inheritable declaration attributes earlyPeter Collingbourne2011-01-211-22/+49
| | | | llvm-svn: 123960
* Refactor the application of type attributes so that attributes fromJohn McCall2011-01-051-34/+110
| | | | | | | | | | | | | | | | | | | | | | | | | the declaration-specifiers and on the declarator itself are moved to the appropriate declarator chunk. This permits a greatly simplified model for how to apply these attributes, as well as allowing a much more efficient query for the GC attribute. Now all qualifier queries follow the same basic strategy of "local qualifiers, local qualifiers on the canonical type, then look through arrays". This can be easily optimized by changing the canonical qualified-array-type representation. Do not process type attributes as decl attributes on declarations with declarators. When computing the type of a block, synthesize a prototype function declarator chunk if the decl-spec type was not a function. This simplifies the logic for building block signatures. Change the logic which inserts an objc_read_weak on a block literal to only fire if the block has a __weak __block variable, rather than if the return type of the block is __weak qualified, which is not actually a sensible thing to ask. llvm-svn: 122871
* Funciton -> FunctionPeter Collingbourne2011-01-021-3/+3
| | | | llvm-svn: 122709
* Unkown -> UnknownPeter Collingbourne2011-01-021-2/+2
| | | | llvm-svn: 122708
* Refactor how we collect attributes during parsing, and add slots for attributesJohn McCall2010-12-241-1/+1
| | | | | | | 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
* Warn when message is sent to receiver ofFariborz Jahanian2010-12-211-3/+8
| | | | | | | | unknown type and there is a possibility that at runtime method is resolved to a deprecated or unavailable method. Addreses // rdar://8769853 llvm-svn: 122294
* Validate Microsoft's uuid attribute string.Francois Pichet2010-12-201-2/+40
| | | | llvm-svn: 122220
* Add support for the Microsoft uuid attribute:Francois Pichet2010-12-191-1/+26
| | | | | | | | example: struct __declspec(uuid("6d5140c1-7436-11ce-8034-00aa006009fa")) test { }; llvm-svn: 122173
* __attribute__((nonnull)) can apply to reference-to-pointerDouglas Gregor2010-12-151-2/+2
| | | | | | parameters. Fixes <rdar://problem/8769025>. llvm-svn: 121864
* Added missing IgnoreParens().Abramo Bagnara2010-12-141-1/+1
| | | | llvm-svn: 121795
* Basic, Sema: add support for CUDA launch_bounds attributePeter Collingbourne2010-12-121-0/+48
| | | | llvm-svn: 121654
* Sema: diagnose kernel functions with non-void return typePeter Collingbourne2010-12-121-0/+15
| | | | llvm-svn: 121653
* Fix PR8720 by printing an error message with a substring that the gcc ↵Rafael Espindola2010-12-071-0/+5
| | | | | | testsuite searches for. llvm-svn: 121137
* Remove a fixme which was fixed in a previous commit.Argyrios Kyrtzidis2010-12-061-2/+0
| | | | llvm-svn: 121029
* Use Sema's MarkDeclarationReferenced, which takes care of templates, instead ↵Argyrios Kyrtzidis2010-12-061-1/+1
| | | | | | | | of calling Decl's setUsed directly. Thanks to John for the hint! llvm-svn: 121014
* Use the source location of the parameter, when it makes sense, for ↵Argyrios Kyrtzidis2010-12-061-8/+10
| | | | | | diagnostics in HandleCleanupAttr. llvm-svn: 121013
* Mark functions referenced by 'cleanup' attribute as used. Fixes rdar://8728293Argyrios Kyrtzidis2010-12-041-0/+1
| | | | llvm-svn: 120872
* Add some warning messages about invalid use of common/nocommon attributes.Eric Christopher2010-12-031-2/+10
| | | | llvm-svn: 120799
* Add support for the common and nocommon attributes.Eric Christopher2010-12-021-0/+12
| | | | | | rdar://8560647 llvm-svn: 120650
* 80-col fixups.Eric Christopher2010-12-011-21/+38
| | | | llvm-svn: 120613
* Basic, Sema: add support for CUDA location attributesPeter Collingbourne2010-12-011-0/+105
| | | | llvm-svn: 120545
* Remove static_casts from SemaDeclAttr.cppPeter Collingbourne2010-11-231-22/+22
| | | | llvm-svn: 120053
* Drop the warning about __attribute__((may_alias)) being usedDan Gohman2010-11-171-6/+0
| | | | | | | on a non-type declaration, as GCC permits it on variables too. This fixes PR8635. llvm-svn: 119517
* Front-end support for __attribute__((may_alias)). This is notDan Gohman2010-11-171-0/+17
| | | | | | yet hooked up to anything yet. llvm-svn: 119407
* Re-work the handling of implicit 'this' arguments and silly GCC-style attributeChandler Carruth2010-11-161-19/+56
| | | | | | | | | | | | | | | | argument indexes. This handles the offsets in a consistent manner for all of the attributes which I saw working with these concepts. I've also added tests for the attribute that motivated this: nonnull. I consolidated the tests for format attributes into one file, and fleshed them out a bit to trigger more of the warning cases. Also improved the quality of some of the diagnostics that occur with invalid argument indices. The only really questionable change here is supporting the implicit this argument for the ownership attribute. I'm not sure it's really a sensible concept there, but implemented the logic for consistency. llvm-svn: 119339
* Kill off the remaining places which generate CK_Unknown casts.John McCall2010-11-161-2/+1
| | | | llvm-svn: 119326
* 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
* Assorted work leading towards the elimination of CK_Unknown.John McCall2010-11-151-1/+2
| | | | llvm-svn: 119138
* Don't compute linkage for a declaration as part of the #pragma weakJohn McCall2010-10-271-8/+12
| | | | | | | forward-declaration support unless there's really a mapping for that name. llvm-svn: 117426
* Tidy up comment (remove extraneous text).Ted Kremenek2010-10-211-2/+1
| | | | llvm-svn: 117044
* Don't rely on a StringRef being null-terminated (it's not) for deprecation ↵Benjamin Kramer2010-10-091-6/+6
| | | | | | | | messages. Store pointer and length of the message in DelayedDiagnostic and hide the gory union details. llvm-svn: 116153
* Patch for adding message to unavailable attribute.Fariborz Jahanian2010-10-061-4/+18
| | | | | | | And its documentation. Finishes off // rdar: // 6734520. llvm-svn: 115862
* Simplified code for deprecated attribute wih message a little.Fariborz Jahanian2010-10-061-2/+2
| | | | llvm-svn: 115856
* Add message to attribute(deprecated).Fariborz Jahanian2010-10-061-10/+36
| | | | | | | attribute(unavailable) to do next. // rdar:// 6734520. llvm-svn: 115842
OpenPOWER on IntegriCloud