summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/attr-mode.c
Commit message (Collapse)AuthorAgeFilesLines
* [Headers][mips] Add `__attribute__((__mode__(__unwind_word__)))` to the ↵Simon Atanasyan2019-02-131-1/+16
| | | | | | | | | | | | | | | | | | _Unwind_Word / _Unwind_SWord definitions The rationale of this change is to fix _Unwind_Word / _Unwind_SWord definitions for MIPS N32 ABI. This ABI uses 32-bit pointers, but _Unwind_Word and _Unwind_SWord types are eight bytes long. # The __attribute__((__mode__(__unwind_word__))) is added to the type definitions. It makes them equal to the corresponding definitions used by GCC and allows to override types using `getUnwindWordWidth` function. # The `getUnwindWordWidth` virtual function override in the `MipsTargetInfo` class and provides correct type size values. Differential revision: https://reviews.llvm.org/D58165 llvm-svn: 353965
* Determine the attribute subject for diagnostics based on declarative ↵Aaron Ballman2017-11-261-2/+2
| | | | | | | | | | information in DeclNodes.td. This greatly reduces the number of enumerated values used for more complex diagnostics; these are now only required when the "attribute only applies to" diagnostic needs to be generated manually as part of semantic processing. This also clarifies some terminology used by the diagnostic (methods -> Objective-C methods, fields -> non-static data members, etc). Many of the tests needed to be updated in multiple places for the diagnostic wording tweaks. The first instance of the diagnostic for that attribute is fully specified and subsequent instances cut off the complete list (to make it easier if additional subjects are added in the future for the attribute). llvm-svn: 319002
* Enable support for __float128 in Clang and enable it on pertinent platformsNemanja Ivanovic2016-05-091-1/+1
| | | | | | | | | | | | | | | | | | This patch corresponds to reviews: http://reviews.llvm.org/D15120 http://reviews.llvm.org/D19125 It adds support for the __float128 keyword, literals and target feature to enable it. Based on the latter of the two aforementioned reviews, this feature is enabled on Linux on i386/X86 as well as SystemZ. This is also the second attempt in commiting this feature. The first attempt did not enable it on required platforms which caused failures when compiling type_traits with -std=gnu++11. If you see failures with compiling this header on your platform after this commit, it is likely that your platform needs to have this feature enabled. llvm-svn: 268898
* Fix for PR8901: attribute "mode" rejected for enums and dependent types.Denis Zobnin2016-02-021-2/+2
| | | | | | | | | Allow "mode" attribute for enum types, except for vector modes, for compatibility with GCC. Support "mode" attribute with dependent types. Differential Revision: http://reviews.llvm.org/D16219 llvm-svn: 259497
* Fix attribute((mode([word|unwind_word]))) for x32Reid Kleckner2016-02-011-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch by H.J. Lu ``` typedef unsigned int gcc_word __attribute__((mode(word))); ``` and ``` typedef unsigned int gcc_unwind_word __attribute__((mode(unwind_word))); ``` define the largest unsigned integer types which can be stored in a general purpose register, which may not be the pointer type. For x32, they aren't pointer nor unsigned long. We should 1. Make getUnwindWordWidth and getRegisterWidth virtual, 2. Override them for x32, similar to hasInt128Type. 3. Use getRegisterWidth for __attribute__((mode(word))); This fixes PR 24706. Reviewers: rnk Differential Revision: http://reviews.llvm.org/D16779 llvm-svn: 259383
* Allow __attribute__((mode)) to appertain to field declarations again. ↵Aaron Ballman2016-01-191-2/+6
| | | | | | | | Corrects compile issues with LibreOffice. Patch by Stephan Bergmann llvm-svn: 258213
* PR26111: segmentation fault with __attribute__((mode(QI))) on function ↵Alexey Bataev2016-01-151-0/+3
| | | | | | | | | declaration, by Denis Zobnin Allow "mode" attribute to be applied to VarDecl, not ValueDecl (which includes FunctionDecl and EnumConstantDecl), emit an error if this attribute is used with function declarations and enum constants. Differential Revision: http://reviews.llvm.org/D16112 llvm-svn: 257868
* Recommited:Stepan Dyatkovskiy2013-09-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Fix for PR16752. Second commit. PR16752: 'mode' attribute for unusual targets doesn't work properly Description: Troubles could be happened due to some assumptions in handleModeAttr function (see SemaDeclAttr.cpp). For example, it assumes that 32 bit integer is 'int', while it could be 16 bit only. Instead of asking target: 'which type do you want to use for int32_t ?' it just hardcodes general opinion. That doesn't looks pretty correct. Please consider the next solution: 1. In Basic/TargetInfo add getIntTypeByWidth and getRealTypeByWidth methods. Methods asks target for proper type for given bit width. 2. Fix handleModeAttr according to new methods in TargetInfo. Fixes: 1st Commit (Done): Add new methods for TargetInfo: getRealTypeByWidth and getIntTypeByWidth for ASTContext names are almost same(invokes new methods from TargetInfo): getIntTypeForBitwidth and getRealTypeForBitwidth 2nd Commit (Current): Fix SemaDeclAttr, handleModeAttr function. Also test/Sema/attr-mode.c was fixed. 'XC' mode test was disabled for PPC64 machines. llvm-svn: 190926
* Attribute tablegen now understands that attribute arguments can be optional. ↵Aaron Ballman2013-09-091-2/+3
| | | | | | This allows for automated checking of the number of arguments expected vs number of arguments given for attributes. Greatly reduces the amount of manual checking required. llvm-svn: 190368
* err_attribute_missing_parameter_name has been replaced by ↵Aaron Ballman2013-07-301-2/+2
| | | | | | err_attribute_argument_type. llvm-svn: 187420
* Add test for r185584.Roman Divacky2013-07-041-0/+1
| | | | llvm-svn: 185668
* Add support for TF/TC modes available on eg. PowerPC64.Roman Divacky2013-07-031-0/+9
| | | | llvm-svn: 185578
* Add support for attribute((mode(unwind_word))).Rafael Espindola2013-01-071-0/+2
| | | | | | Patch by Nick Lewycky. Fixes pr8703. llvm-svn: 171781
* Correctly treat 64 bit integers specified via the mode attribute as the 'long'Chandler Carruth2010-01-261-1/+38
| | | | | | | | | | type when that type is 64 bits wide, and the 'long long' type when 'long' is only 32 bits wide. This fixes PR6108. Also adds a bunch of test cases to ensure proper conversion between equally sized standard types and mode-specified types on both 32 and 64 bit targets. llvm-svn: 94527
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* PR3691: Add support for complex modes. I also tossed in support for XF Eli Friedman2009-03-031-0/+5
| | | | | | | | while I was at it. There are still a lot of diagnostics missing from this code, and it isn't completely correct for anything other than x86, but it should work correctly on x86 for valid cases. llvm-svn: 65935
* Make ProcessDeclAttributes walk the declarator structure pulling Chris Lattner2008-06-291-0/+2
| | | | | | | | | | | | | decl attributes out of the various places they can hide. This makes us correctly reject things like this: t.c:2:22: error: mode attribute only supported for integer and floating-point types int **__attribute((mode(HI)))* i32; ^ because you can't make a pointer be HImode. llvm-svn: 52876
* rename some attr tests for consistency.Chris Lattner2008-06-261-0/+15
llvm-svn: 52770
OpenPOWER on IntegriCloud