summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Switched FormatAttr to using an IdentifierArgument instead of a ↵Aaron Ballman2013-09-031-6/+10
| | | | | | StringArgument since that is a more accurate modeling. llvm-svn: 189851
* Consumed analysis: add return_typestate attribute.DeLesley Hutchins2013-09-031-0/+61
| | | | | | | | | | Patch by chris.wailes@gmail.com Functions can now declare what state the consumable type the are returning will be in. This is then used on the caller side and checked on the callee side. Constructors now use this attribute instead of the 'consumes' attribute. llvm-svn: 189843
* Consolidating the notion of a GNU attribute parameter with the attribute ↵Aaron Ballman2013-08-311-190/+162
| | | | | | argument list. llvm-svn: 189711
* Consumed analysis: add 'consumable' class attribute.DeLesley Hutchins2013-08-301-15/+60
| | | | | | | | | | | | Patch by chris.wailes@gmail.com Adds the 'consumable' attribute that can be attached to classes. This replaces the previous method of scanning a class's methods to see if any of them have consumed analysis attributes attached to them. If consumed analysis attributes are attached to methods of a class that isn't marked 'consumable' a warning is generated. llvm-svn: 189702
* Add ms_abi and sysv_abi attribute handling.Charles Davis2013-08-301-0/+20
| | | | | | Based on a patch by Benno Rice! llvm-svn: 189644
* Remove Inheritable/NonInheritable flags from ProcessDeclAttributes. They don'tRichard Smith2013-08-291-48/+21
| | | | | | do anything useful. llvm-svn: 189548
* Mode is now handled as a non-inheritable attribute, and CUDADevice & ↵Aaron Ballman2013-08-281-5/+4
| | | | | | CUDAHost are now handled as inheritable attributes. In all three cases, this makes the processing behavior more consistent with the declared behavior in Attr.td. llvm-svn: 189532
* Since r179585, __declspec(property) has gotten special treatment as an ↵Aaron Ballman2013-08-261-1/+0
| | | | | | attribute where it is not processed as part of the typical Sema attribute functionality. Specifying this attribute as being "ignored" because there is no sema handler for it as a Decl attribute, and no AST node generated for it. llvm-svn: 189284
* Updated the consumed analysis warnings to use a more standardized diagnostic.Aaron Ballman2013-08-211-8/+8
| | | | | | Patch thanks to Christian Wailes! llvm-svn: 188940
* Removed unnecessary asserts.Aaron Ballman2013-08-211-38/+0
| | | | | | Patch thanks to Christian Wailes! llvm-svn: 188934
* Don't reject attribute used in an "extern const" variable definition.Rafael Espindola2013-08-161-1/+1
| | | | | | | Before this patch we would warn and drop the attribute in extern const char test3[] __attribute__((used)) = ""; llvm-svn: 188588
* Patch by Chris Wailes <chris.wailes@gmail.com>.DeLesley Hutchins2013-08-121-0/+77
| | | | | | | | | | | | | | | | | | Reviewed by delesley, dblaikie. Add the annotations and code needed to support a basic 'consumed' analysis. Summary: This new analysis is based on academic literature on linear types. It tracks the state of a value, either as unconsumed, consumed, or unknown. Methods are then annotated as CallableWhenUnconsumed, and when an annotated method is called while the value is in the 'consumed' state a warning is issued. A value may be tested in the conditional statement of an if-statement; when this occurs we know the state of the value in the different branches, and this information is added to our analysis. The code is still highly experimental, and the names of annotations or the algorithm may be subject to change. llvm-svn: 188206
* Sema: Assertion failure during CodeGen in CodeGenModule::EmitUuidofInitializerDavid Majnemer2013-08-091-21/+10
| | | | | | | | | Make sure we can properly generate code when the UUID has curly braces on it, strip the curly braces at the sema layer. This fixes PR16813. llvm-svn: 188061
* err_attribute_missing_parameter_name has been replaced by ↵Aaron Ballman2013-07-301-1/+2
| | | | | | err_attribute_argument_type. llvm-svn: 187420
* Replacing err_attribute_argument_not_int with err_attribute_not_type_attrAaron Ballman2013-07-301-10/+15
| | | | llvm-svn: 187419
* err_attribute_not_string has been subsumed by err_attribute_argument_type.Aaron Ballman2013-07-301-39/+33
| | | | llvm-svn: 187400
* Refactor some attributes to use checkFunctionOrMethodArgumentIndex instead ↵Aaron Ballman2013-07-301-159/+46
| | | | | | of using custom logic. No functional changes intended. llvm-svn: 187398
* Support for Thread Safety Analysis in CDavid Blaikie2013-07-291-1/+1
| | | | | | Patch by Ethan Jackson. llvm-svn: 187365
* Added the attribute name to the err_attribute_wrong_number_arguments ↵Aaron Ballman2013-07-231-26/+50
| | | | | | | | diagnostic for clarity; updated almost all of the affected test cases. Thanks to Fariborz Jahanian for the suggestion! llvm-svn: 186980
* Going back to using getName for consistency.Aaron Ballman2013-07-231-7/+2
| | | | llvm-svn: 186966
* Replacing some manual diagnostic checks with an existing helper method. ↵Aaron Ballman2013-07-231-12/+3
| | | | | | Adding missing test cases for the diagnostics. llvm-svn: 186944
* Consolidate several attribute argument diagnostics into a single, selectable ↵Aaron Ballman2013-07-231-44/+68
| | | | | | diagnostic. This makes the diagnostic more consistent. llvm-svn: 186940
* Correcting the NSObject and Overloadable attribute diagnostics so that the ↵Aaron Ballman2013-07-231-6/+2
| | | | | | count reported matches reality. llvm-svn: 186936
* add type attribute warn_unused, for -Wunused-variable warnings (pr#14253)Lubos Lunak2013-07-201-0/+14
| | | | | | | | | The functionality is equivalent to the GCC attribute. Variables of tagged types will be warned about as unused if they are not used in any way except for possible (even non-trivial) ctors/dtors called. Useful for tagging classes like std::string (which is not part of this commit). llvm-svn: 186765
* Switching to use checkAttributeNumArgs for trivial cases. No functional ↵Aaron Ballman2013-07-181-10/+4
| | | | | | changes intended. llvm-svn: 186591
* Replacing a morally duplicate diagnostic by adding it to an existing ↵Aaron Ballman2013-07-181-3/+6
| | | | | | diagnostic's select list. Updates the tests for the more consistent diagnostic. llvm-svn: 186584
* Removed a parameter from handleAttrWithMessage to make it more consistent ↵Aaron Ballman2013-07-181-5/+5
| | | | | | with other attribute handlers, as well as other attribute error messages. Added missing test cases for the unavailable attribute, and updated the deprecated test case. llvm-svn: 186578
* Use SmallVectorImpl& for function arguments instead of SmallVector.Craig Topper2013-07-051-4/+4
| | | | llvm-svn: 185715
* Check LongDoubleFormat instead of just Width as this is PowerPC specific.Roman Divacky2013-07-031-1/+2
| | | | llvm-svn: 185584
* Add support for TF/TC modes available on eg. PowerPC64.Roman Divacky2013-07-031-5/+8
| | | | llvm-svn: 185578
* Don't allow __attribute__((common)) in C++. PR16330.Eli Friedman2013-06-201-0/+6
| | | | llvm-svn: 184493
* Improved source code fidelity for gcc mode attribute.Enea Zaffanella2013-06-201-4/+7
| | | | llvm-svn: 184417
* Adding in parsing and the start of semantic support for __sptr and __uptr ↵Aaron Ballman2013-05-221-12/+6
| | | | | | | | | | pointer type qualifiers. This patch also fixes the correlated __ptr32 and __ptr64 pointer qualifiers so that they are truly type attributes instead of declaration attributes. For more information about __sptr and __uptr, see MSDN: http://msdn.microsoft.com/en-us/library/aa983399.aspx Patch reviewed by Richard Smith. llvm-svn: 182535
* Warn on and drop dllimport attrs from variable definitionsReid Kleckner2013-05-201-3/+2
| | | | | | | AsmPrinter::EmitLinkage() does not handle dllimport linkage. The LLVM verifier should also be fixed to reject this. llvm-svn: 182320
* Implement __declspec(selectany) under -fms-extensionsReid Kleckner2013-05-201-0/+13
| | | | | | | | | | | | | | | | selectany only applies to externally visible global variables. It has the effect of making the data weak_odr. The MSDN docs suggest that unused definitions can only be dropped at linktime, so Clang uses weak instead of linkonce. MSVC optimizes away references to constant selectany data, so it must assume that there is only one definition, hence weak_odr. Reviewers: espindola Differential Revision: http://llvm-reviews.chandlerc.com/D814 llvm-svn: 182266
* Thread safety analysis: add two new attributes to the thread safety analysis:DeLesley Hutchins2013-05-171-0/+34
| | | | | | | assert_exclusive_lock and assert_shared_lock. These attributes are used to mark functions that dynamically check (i.e. assert) that a lock is held. llvm-svn: 182170
* Refactor diagnostics for MS attributes without -fms-extensionsReid Kleckner2013-05-171-66/+73
| | | | | | | This shares the warn_attribute_unused diagnostic and reduces the indentation level. No functionality change. llvm-svn: 182096
* ArrayRef'ize InitializationSequence constructor and ↵Dmitri Gribenko2013-05-031-2/+2
| | | | | | | | InitializationSequence::Diagnose() Patch by Robert Wilhelm. llvm-svn: 181022
* Basic support for Microsoft property declarations andJohn McCall2013-04-161-0/+1
| | | | | | | | references thereto. Patch by Tong Shen! llvm-svn: 179585
* Annotate flavor of TLS variable (statically or dynamically initialized) onto ↵Richard Smith2013-04-131-2/+2
| | | | | | the AST. llvm-svn: 179447
* Rework how ObjC method inherit deprecated/availability.Ted Kremenek2013-04-061-1/+4
| | | | | | | | | | | | | | | | | | | | | New rule: - Method decls in @implementation are considered "redeclarations" and inherit deprecated/availability from the @interface. - All other cases are consider overrides, which do not inherit deprecated/availability. For example: (a) @interface redeclares a method in an adopted protocol. (b) A subclass redeclares a method in a superclass. (c) A protocol redeclares a method from another protocol it adopts. The idea is that API authors should have the ability to easily move availability/deprecated up and down a class/protocol hierarchy. A redeclaration means that the availability/deprecation is a blank slate. Fixes <rdar://problem/13574571> llvm-svn: 178937
* Add 178663 back.Rafael Espindola2013-04-031-4/+2
| | | | | | | | | | | http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb went back green before it processed the reverted 178663, so it could not have been the culprit. Revert "Revert 178663." This reverts commit 4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41. llvm-svn: 178682
* Revert 178663.Rafael Espindola2013-04-031-2/+4
| | | | | | | | | | Looks like it broke http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb Revert "Don't compute a patched/semantic storage class." This reverts commit 8f187f62cb0487d31bc4afdfcd47e11fe9a51d05. llvm-svn: 178681
* Don't compute a patched/semantic storage class.Rafael Espindola2013-04-031-4/+2
| | | | | | | | | | | For variables and functions clang used to store two storage classes. The one "as written" in the code and a patched one, which, for example, propagates static to the following decls. This apparently is from the days clang lacked linkage computation. It is now redundant and this patch removes it. llvm-svn: 178663
* Generate metadata to implement the -cl-kernel-arg-info option.Guy Benyei2013-03-241-1/+19
| | | | | | OpenCL 1.2 spec. 5.7.3. llvm-svn: 177839
* Add support for the 'endian' attribute for OpenCL.Joey Gouly2013-03-141-0/+13
| | | | llvm-svn: 177035
* Add support for the OpenCL attribute 'vec_type_hint'.Joey Gouly2013-03-081-0/+33
| | | | | | Patch by Murat Bolat! llvm-svn: 176686
* Process #pragma weak only after we know the linkage of the function or variableRafael Espindola2013-03-021-24/+24
| | | | | | we are looking at. llvm-svn: 176414
* Be more careful in applying pragma weak. Fixes pr14974.Rafael Espindola2013-02-261-2/+10
| | | | | | | | | | GCC applies a pragma weak to a decl if it matches the mangled name. We used to apply if it matched the plain name. This patch is a compromise: we apply the pragma only if it matches the name and the decl has C language linkage. llvm-svn: 176110
* Unify clang/llvm attributes for asan/tsan/msan (Clang part)Kostya Serebryany2013-02-261-9/+49
| | | | | | | | | | | | | | | | | | | These are two related changes (one in llvm, one in clang). LLVM: - rename address_safety => sanitize_address (the enum value is the same, so we preserve binary compatibility with old bitcode) - rename thread_safety => sanitize_thread - rename no_uninitialized_checks -> sanitize_memory CLANG: - add __attribute__((no_sanitize_address)) as a synonym for __attribute__((no_address_safety_analysis)) - add __attribute__((no_sanitize_thread)) - add __attribute__((no_sanitize_memory)) for S in address thread memory If -fsanitize=S is present and __attribute__((no_sanitize_S)) is not set llvm attribute sanitize_S llvm-svn: 176076
OpenPOWER on IntegriCloud