summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/TargetAttributesSema.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Removing the notion of TargetAttributesSema and replacing it with one where ↵Aaron Ballman2014-01-091-295/+0
| | | | | | the parsed attributes are responsible for knowing their target-specific nature, instead of letting Sema figure it out. This is necessary so that __has_attribute can eventually determine whether a parsed attribute applies to the given target or not. llvm-svn: 198896
* Updated the wording of two attribute-related diagnostics so that they print ↵Aaron Ballman2014-01-021-1/+1
| | | | | | the offending attribute name. Also updates the associated test cases. llvm-svn: 198355
* Simplifying some diagnostics so that they don't need to work with ↵Aaron Ballman2013-12-261-1/+1
| | | | | | StringRefs. No functional changes intended. llvm-svn: 198051
* Allow target-specific attributes to share a spelling between different ↵Aaron Ballman2013-12-151-23/+32
| | | | | | | | | | attributes via the ParseKind field. Attributes will be given a common parsed attribute identifier (the AttributeList::AT_* enum), but retain distinct Attr subclasses. This new functionality is used to implement the ARM and MSP430 interrupt attribute. Patch reviewed by Richard Smith over IRC. llvm-svn: 197343
* Reverting changes from r196415; this patch exposed a different, but ↵Aaron Ballman2013-12-061-1/+2
| | | | | | unrelated bug regarding the __has_attribute implementation. Reverting to unblock the Chrome tsan builds. llvm-svn: 196583
* Giving a Subjects list to DllExport, which allows the removal of some custom ↵Aaron Ballman2013-12-041-9/+1
| | | | | | semantic handling. The same cannot be done for DllImport, and so comments were left explaining why. llvm-svn: 196429
* Common functionality is already checked within SemaDeclAttr.cpp and so it ↵Aaron Ballman2013-12-041-65/+4
| | | | | | does not need to be re-checked for each target. llvm-svn: 196428
* The MSP430Interrupt attribute does have a sema handler (it's in ↵Aaron Ballman2013-12-041-0/+2
| | | | | | TargetAttributesSema). Added a FIXME about the attribute being nameless when it really does have a valid name, and a comment explaining why we're using the name instead of the attribute kind. llvm-svn: 196420
* Getting rid of some hard-coded strings. No functional changes intended, ↵Aaron Ballman2013-12-041-5/+5
| | | | | | though some test cases needed to be updated for attribute names becoming quoted. llvm-svn: 196417
* This attribute somehow remained nameless in the attribute tablegen, until now.Aaron Ballman2013-12-041-2/+1
| | | | llvm-svn: 196415
* Implement ARM GNU-style interrupt attributeTim Northover2013-10-011-0/+47
| | | | | | | | | | This attribute allows users to use a modified C or C++ function as an ARM exception-handling function and, with care, to successfully return control to user-space after the issue has been dealt with. rdar://problem/14207019 llvm-svn: 191769
* Consolidating the notion of a GNU attribute parameter with the attribute ↵Aaron Ballman2013-08-311-3/+3
| | | | | | argument list. llvm-svn: 189711
* Replacing err_attribute_argument_not_int with err_attribute_not_type_attrAaron Ballman2013-07-301-2/+3
| | | | llvm-svn: 187419
* Remove the mblaze backend from clang.Rafael Espindola2013-07-251-53/+0
| | | | | | Approval in here http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/064169.html llvm-svn: 187143
* Added the attribute name to the err_attribute_wrong_number_arguments ↵Aaron Ballman2013-07-231-8/+16
| | | | | | | | diagnostic for clarity; updated almost all of the affected test cases. Thanks to Fariborz Jahanian for the suggestion! llvm-svn: 186980
* Warn on and drop dllimport attrs from variable definitionsReid Kleckner2013-05-201-0/+9
| | | | | | | AsmPrinter::EmitLinkage() does not handle dllimport linkage. The LLVM verifier should also be fixed to reject this. llvm-svn: 182320
* PR14922: when printing an attribute, use the real syntax of the attribute ↵Michael Han2013-01-241-8/+17
| | | | | | | | | | | | | (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
* First step in implementation of mips16 and nomips16 attributes.Reed Kotler2013-01-161-0/+51
| | | | | | Waiting for new llvm attribute code for the next step. llvm-svn: 172626
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-2/+2
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Reapply r158700 and fixup patches, minus one hunk that slipped through andAlexis Hunt2012-06-191-2/+2
| | | | | | | caused a crash in an obscure case. On the plus side, it caused me to catch another bug by inspection. llvm-svn: 158767
* Revert r158700 and dependent patches r158716, r158717, and r158731.Jakob Stoklund Olesen2012-06-191-2/+2
| | | | | | | | The original r158700 caused crashes in the gcc test suite, g++.abi/vtable3a.C among others. It also caused failures in the libc++ test suite. llvm-svn: 158749
* Improve the specification of spellings in Attr.td.Alexis Hunt2012-06-191-2/+2
| | | | | | | | | | | | | | | | | Note that this is mostly a structural patch that handles the change from the old spelling style to the new one. One consequence of this is that all AT_foo_bar enum values have changed to not be based off of the first spelling, but rather off of the class name, so they are now AT_FooBar and the like (a straw poll on IRC showed support for this). Apologies for code churn. Most attributes have GNU spellings as a temporary solution until everything else is sorted out (such as a Keyword spelling, which I intend to add if someone else doesn't beat me to it). This is definitely a WIP. I've also killed BaseCheckAttr since it was unused, and I had to go through every attribute anyway. llvm-svn: 158700
* Refactor all theRafael Espindola2012-05-131-21/+13
| | | | | | | | | if (Inherited) Attr->setInherited(true); To a central location. llvm-svn: 156728
* Fix an old (2009) FIXME:Rafael Espindola2012-05-101-24/+40
| | | | | | | | | | | | | | | | | | | | | // FIXME: This needs to happen before we merge declarations. Then, // let attribute merging cope with attribute conflicts. This was already being done for variables, but for functions we were merging then first and then applying the attributes. To avoid duplicating merging logic, some of the helpers in SemaDeclAttr.cpp become methods that can handle merging two attributes in one decl or inheriting attributes from one decl to another. With this change we are now able to produce errors for variables with incompatible visibility attributes or warn about unused dllimports in variables. This changes the attribute list iteration back to being in reverse source code order, as that matches what decl merging does and avoids differentiating the two cases is the merge*Attr methods. llvm-svn: 156531
* Process attributes in the order they appear in the source code. This make clangRafael Espindola2012-05-071-10/+5
| | | | | | | | | | | | | | match gcc behavior for two conflicting visibilities in the same decl. It also makes handling of dllimport/dllexport more natural. As a bonus we now warn on the dllimport in void __attribute__((dllimport)) foo13(); void __attribute__((dllexport)) foo13(); as does gcc. llvm-svn: 156343
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-1/+1
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Fix compiler warning about && in ||.Benjamin Kramer2011-09-301-2/+2
| | | | | | | This time the warning found an actual bug, we don't want to handle force_align_arg_pointer differently than __force_align_arg_pointer__. llvm-svn: 140877
* Support dllimport and dllexport on x86-64 Windows. PR10978. Patch by Ruben ↵Eli Friedman2011-09-301-4/+5
| | | | | | Van Boxem. llvm-svn: 140871
* 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
* Keep the source range of attributes. Depends on a llvm tablegen commit.Argyrios Kyrtzidis2011-09-131-1/+2
| | | | llvm-svn: 139600
* Extend the ASTContext constructor to delay the initialization ofDouglas Gregor2011-09-021-2/+2
| | | | | | | | builtin types (When requested). This is another step toward making ASTUnit build the ASTContext as needed when loading an AST file, rather than doing so after the fact. No actual functionality change (yet). llvm-svn: 138985
* Support for C++11 (non-template) alias declarations.Richard Smith2011-04-151-1/+1
| | | | llvm-svn: 129567
* Triple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 instead.NAKAMURA Takumi2011-02-171-2/+1
| | | | | | No one uses *-mingw64. mingw-w64 is represented as {i686|x86_64}-w64-mingw32. llvm-svn: 125742
* Fix whitespace.NAKAMURA Takumi2011-02-171-1/+0
| | | | llvm-svn: 125741
* 1. Add some ABI information for the Microblaze.Wesley Peck2010-12-191-0/+51
| | | | | | 2. Add attibutes "interrupt_handler" and "save_volatiles" for the Microblaze target. llvm-svn: 122184
* Split out a header to hold APIs meant for the Sema implementation from Sema.h.John McCall2010-08-251-1/+1
| | | | | | | Clients of Sema don't need to know (for example) the list of diagnostics we support. llvm-svn: 112093
* Remove Sema.h's dependency on DeclCXX.h.John McCall2010-08-251-1/+2
| | | | llvm-svn: 112032
* Generate Attr subclasses with TableGen.Alexis Hunt2010-08-181-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Now all classes derived from Attr are generated from TableGen. Additionally, Attr* is no longer its own linked list; SmallVectors or Attr* are used. The accompanying LLVM commit contains the updates to TableGen necessary for this. Some other notes about newly-generated attribute classes: - The constructor arguments are a SourceLocation and a Context&, followed by the attributes arguments in the order that they were defined in Attr.td - Every argument in Attr.td has an appropriate accessor named getFoo, and there are sometimes a few extra ones (such as to get the length of a variadic argument). Additionally, specific_attr_iterator has been introduced, which will iterate over an AttrVec, but only over attributes of a certain type. It can be accessed through either Decl::specific_attr_begin/end or the global functions of the same name. llvm-svn: 111455
* Move Sema's headers into include/clang/Sema, renaming a few along the way.Douglas Gregor2010-08-121-1/+1
| | | | llvm-svn: 110945
* Don't emit a warning about a dllimport attribute being used in a typedefTed Kremenek2010-02-211-2/+6
| | | | | | when -fms-extensions is specified. Fixes <rdar://problem/7653870>. llvm-svn: 96722
* Also don't warn about force_align_arg_pointer on function typedefs. (This willCharles Davis2010-02-181-1/+2
| | | | | | | break if you declare an actual function using that typedef. Come to think of it, maybe I should make this part of the type.) llvm-svn: 96570
* Two fixes related to force_align_arg_pointer:Charles Davis2010-02-181-2/+7
| | | | | | | - Also recognize __force_align_arg_pointer__. - Don't warn if it's used on a function pointer typedef. llvm-svn: 96568
* Revert r95939, as suggested by Alexandre Julliard from the Wine project (andCharles Davis2010-02-171-6/+4
| | | | | | our own Chris Lattner). llvm-svn: 96431
* dllimport and dllexport are declspec attributes, too. They're alsoCharles Davis2010-02-161-0/+88
| | | | | | | | Win32-specific. Also, fix a test to use FileCheck instead of grepping LLVM IR. llvm-svn: 96364
* Warn about using the new force_align_arg_pointer attribute on a functionCharles Davis2010-02-111-4/+6
| | | | | | | pointer. If you don't like the new warning, you can turn it off with -Wno-force-align-arg-pointer. llvm-svn: 95939
* Fix a potential null-pointer use, and fix the style of my new function.Charles Davis2010-02-101-2/+2
| | | | | | Thanks, Anton! llvm-svn: 95821
* Add support for the force_align_arg_pointer attribute. This is an x86-specificCharles Davis2010-02-101-0/+42
| | | | | | | | attribute, so it uses Anton's new target-specific attribute support. It's supposed to ensure that the stack is 16-byte aligned, but since necessary support is lacking from LLVM, this is a no-op for now. llvm-svn: 95820
* Generalize target weirdness handling having proper layering in mind:Anton Korobeynikov2010-01-101-0/+86
1. Add helper class for sema checks for target attributes 2. Add helper class for codegen of target attributes As a proof-of-concept - implement msp430's 'interrupt' attribute. llvm-svn: 93118
OpenPOWER on IntegriCloud