summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Revert r175912, "Add support for coldcc to clang" at John's request.Peter Collingbourne2013-02-231-10/+0
| | | | llvm-svn: 175936
* Add support for coldcc to clangPeter Collingbourne2013-02-221-0/+10
| | | | llvm-svn: 175912
* Don't crash if we try to apply 'alignas' to a variable declared with anRichard Smith2013-02-221-1/+1
| | | | | | incomplete type. llvm-svn: 175880
* Handle alignas(foo...) pack expansions.Richard Smith2013-02-221-19/+25
| | | | llvm-svn: 175875
* Don't crash when applying an alloc_size attribute on a K&R function.Argyrios Kyrtzidis2013-02-221-1/+5
| | | | llvm-svn: 175867
* Implement C++11 [dcl.align]p6-p8, and C11 6.7.5/7. This had to be split out ofRichard Smith2013-02-221-2/+1
| | | | | | | | the normal attribute-merging path, because we can't merge alignment attributes without knowing the complete set of alignment attributes which apply to a particular declaration. llvm-svn: 175861
* Add a new 'type_visibility' attribute to allow users toJohn McCall2013-02-201-22/+62
| | | | | | | | | | | | | | control the visibility of a type for the purposes of RTTI and template argument restrictions independently of how visibility propagates to its non-type member declarations. Also fix r175326 to not ignore template argument visibility on a template explicit instantiation when a member has an explicit attribute but the instantiation does not. The type_visibility work is rdar://11880378 llvm-svn: 175587
* Replace TypeLoc llvm::cast support to be well-defined.David Blaikie2013-02-181-2/+2
| | | | | | | | | | | | | | The TypeLoc hierarchy used the llvm::cast machinery to perform undefined behavior by casting pointers/references to TypeLoc objects to derived types and then using the derived copy constructors (or even returning pointers to derived types that actually point to the original TypeLoc object). Some context is in this thread: http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056804.html Though it's spread over a few months which can be hard to read in the mail archive. llvm-svn: 175462
* The meat of this patch is in BuildCXXMemberCalLExpr where we make it useNick Lewycky2013-02-121-0/+1
| | | | | | | | | | | | MarkMemberReferenced instead of marking functions referenced directly. An audit of callers to MarkFunctionReferenced and DiagnoseUseOfDecl also caused a few other changes: * don't mark functions odr-used when considering them for an initialization sequence. Do mark them referenced though. * the function nominated by the cleanup attribute should be diagnosed. * operator new/delete should be diagnosed when building a 'new' expression. llvm-svn: 174951
* Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.Jordan Rose2013-02-081-1/+2
| | | | | | | Nearly all of these changes are one-to-one replacements; the few that aren't have to do with custom identifier validation. llvm-svn: 174768
* Fix diagnostic for bad alignas use: it can't be applied to functions.Richard Smith2013-02-011-2/+5
| | | | llvm-svn: 174160
* Implement [dcl.align]p5 and C11 6.7.5/4: alignas cannot underalign.Richard Smith2013-02-011-37/+79
| | | | | | Also support alignas(0), which C++11 and C11 require us to ignore. llvm-svn: 174157
* [Sema][Attr]Fix alignment attribute printing.Michael Han2013-02-011-18/+20
| | | | | | | | | Remove "IsMSDeclspec" argument from Align attribute since the arguments in Attr.td should only model those appear in source code. Introduce attribute Accessor, and teach TableGen to generate syntax kind accessors for Align attribute, and use those accessors to decide if an alignment attribute is a declspec attribute. llvm-svn: 174133
* Downgrade 'attribute ignored when parsing type' from error to warning, to matchRichard Smith2013-01-291-1/+1
| | | | | | | | | the diagnostic's warn_ name. Switch some places (notably C++11 attributes) which really wanted an error over to a different diagnostic. Finally, suppress the diagnostic entirely for __ptr32, __ptr64 and __w64, to avoid producing diagnostics in important system headers. llvm-svn: 173788
* Implement C++11 [dcl.align]p1 and C11 6.7.5/2 rules for alignas and _Alignas.Richard Smith2013-01-291-3/+41
| | | | llvm-svn: 173779
* Propagate the spelling list index for an attribute across template ↵Richard Smith2013-01-291-2/+2
| | | | | | instantiation. llvm-svn: 173768
* Actually remove the hack which was blocking the Borland-style attributes fromRichard Smith2013-01-291-7/+0
| | | | | | | working, and add the missing attribute spellings. This brings _pascal, _fastcall, _stdcall and _cdecl to life in -fborland-extensions mode. llvm-svn: 173749
* Replace AS_MSTypespec with AS_Keyword, for representing any attribute spelledRichard Smith2013-01-291-5/+5
| | | | | | | | | as a keyword. Rationalize existing attributes to use it as appropriate, and to not lie about some __declspec attributes being GNU attributes. In passing, remove a gross hack which was discarding attributes which we could handle. This results in us actually respecting the __pascal keyword again. llvm-svn: 173746
* Finish semantic analysis for [[carries_dependency]] attribute.Richard Smith2013-01-281-4/+18
| | | | | | | | | | This required plumbing through a new flag to determine whether a ParmVarDecl is actually a parameter of a function declaration (as opposed to a function typedef etc, where the attribute is prohibited). Weirdly, this attribute (just like [[noreturn]]) cannot be applied to a function type, just to a function declaration (and its parameters). llvm-svn: 173726
* Tests and a minor bugfix for [dcl.attr.depend]p1 (C++11 [[carries_dependency]]Richard Smith2013-01-281-1/+1
| | | | | | attribute). llvm-svn: 173645
* PR14922: when printing an attribute, use the real syntax of the attribute ↵Michael Han2013-01-241-193/+372
| | | | | | | | | | | | | (GNU, C++11, MS Declspec) instead of hardcoded GNU syntax. Introduce a spelling index to Attr class, which is an index into the attribute spelling list of an attribute defined in Attr.td. This index will determine the actual spelling used by an attribute, as it incorporates both the syntax and naming of the attribute. When constructing an attribute AST node, the spelling index is computed based on attribute kind, scope (if it's a C++11 attribute), and name, then passed to Attr that will use the index to print itself. Thanks to Richard Smith for the idea and review. llvm-svn: 173358
* Fix some wonky formatting, remove spurious emacs major mode marker. NoNick Lewycky2013-01-241-9/+7
| | | | | | functionality change! llvm-svn: 173314
* Implement C++11 semantics for [[noreturn]] attribute. This required splittingRichard Smith2013-01-171-12/+37
| | | | | | | | it apart from [[gnu::noreturn]] / __attribute__((noreturn)), since their semantics are not equivalent (for instance, we treat [[gnu::noreturn]] as affecting the function type, whereas [[noreturn]] does not). llvm-svn: 172691
* Delay linkage checks when validating the weakref attribute.Rafael Espindola2013-01-161-6/+2
| | | | llvm-svn: 172678
OpenPOWER on IntegriCloud